In my Android projects, I can specify Gradle constants as follows: -
buildConfigField 'Boolean', 'analyticsEnabled', 'false'
and access them in my android application as follows: -
public boolean isAnalyticsEnabled() {
return BuildConfig.analyticsEnabled;
}
How can I get the same functions in the Java Gradle build script library?
To be more precise, I am developing a custom annotation processor as a pure Java project (library), which my Android application depends on.
I would like to define the constants in my Java Gradle assembly file that are available to my annotation processor.
If this is possible, then how can I achieve it?
source
share