I have three classes which are using different dependencies (SDK and libraries) in their code. How can I make Gradle not to compile (and include) the unused dependencies while building?
For example my classes are:
SDKObjectBuilder1, SDKObjectBuilder2, SDKObjectBuilder3
And in my code under some condition, I will create an object only from one of these classes. Like:
Object sdk;
if(..) {
sdk = new SDKObjectBuilder1();
} else if (...) {
sdk = new SDKObjectBuilder2();
} else {
sdk = new SDKObjectBuilder3();
}
Now if sdk is an object of SDKObjectBuilder1 then the other two are unused (since no object is referring to them).
Can I make Gradle to not compile the unused dependencies in the other two classes?