Scenario: we have an Android application with several different additional components that we would like to include / exclude depending on customer needs and licensing. Is it possible to include specific projects based on the assembly parameter and without creating all permutations as assembly attributes ?
./gradlew assembleRelease -PincludeFeatureA=true -PincludeFeatureB=false
I thought I could do something like this in the dependencies:
dependencies { if(includeFeatureA){ compile project(':featureAEnabled') } else { compile project(':featureADisabled') } }
But that does not work.
Update. Given the number of switchable functions, using explicit build options for each permutation is cumbersome.
For example, given 3 functions with the ability to switch, I donโt want to create options like this:
Feature1 Feature1-Feature2 Feature1-Feature3 Feature1-Feature2-Feature3 Feature2 Feature2-Feature3 ...
Ken source share