Hello, I’m looking for way to make my SourceSets dynamically configurable, here is the situation: Imagine that I create in “gradle.properties” some Lists where I define my sources:
Now suppose that I use a flag to select which version whether -Pflag=NormalVersion or -Pflag=UxVersion during the build call. Then as we know we going to apply “java plugin” and define the sourceSets:
You might guess what is my question now: How to affect SourceSets.java.srcDirs to specific List of sources defined in gradle.properties and of course this depends on flag value? Thank you!!
Well I haven’t found how to cast my Lists defined in gradle.properties to java.srcDirs:
* What went wrong:
A problem occurred evaluating root project 'Myproject.Gradle'.
> Cannot cast object '['backend','shared','dashboard_web_ux','gwt_common_ux','surveys-backend','widgety_ux']' with class 'java.lang.String' to class 'java.lang.Iterable'