How to avoid module dependency assembly when it is not included in a specific taste?

I currently have a project containing two modules :

  • application
  • stub

The application module is core and contains an application based on our customer library . This library is not yet fully operational, so we started developing with the home stub of this library contained in the stub module.

Now we need to declare two options in the application:

  • regular (one that uses the actual lib)
  • stub (one that uses a stub module)

Here is an excerpt from the app / build.gradle file:

android {
    ...
    productFlavors {
        regular {
            applicationId "com.example"
        }
        stub {
            applicationId "com.example.stub"
        }
    }
}

dependencies {
    ...
    regularCompile ('com.customer:superhypelib:1.0.0')
    stubCompile project(':stub')
}

, . , :

gradlew :app:assembleRegular

, ! , - .

- , , , ?

!

+4

All Articles