How to exclude certain files from compiling

I am extending my android application flavour as follow

productFlavors {
ukProd {
applicationId ".a.h***.ukprod"
resValue ‘string’, ‘app_name’, “test”
}

wetProd {
applicationId ".a.h***.wetProd"
resValue ‘string’, ‘app_name’, “testq”
}
}
sourceSets {

wetProd {
java.srcDirs = sourceSets.ukProd.java.srcDirs
}
}
There is one class called model in ukProd flavour that I want to exclude during the compile time. I am find it difficult that how to use

exclude ‘mytasks/model.java’

in the above gradle command.

Many thanks.

Regards