Build type support for Java modules in Gradle Android project?

G'day.

I have an Android Gradle project, which consists of an Android module and 3 Java library modules (which the Android module depends on).

The Android Gradle plugin supports build types (debug, release, etc.), and I would like to be able to use these build types for library projects, so if I turn on debug, it will use the debug source sets for all 4 modules.

However, I'm not quite sure how to do this for pure Java modules. I know that I can define new sourceSets, but is there anyway to configure Gradle build scripts so that the original Java module sets change when the build type for the Android module changes?

Thanks in advance.

+4
source share

Source: https://habr.com/ru/post/1526641/


All Articles