[FR]: Many unwanted build variants are created because of AndroidLibraryConventionPlugin
#746
Open
2 tasks done
Labels
enhancement
New feature or request
AndroidLibraryConventionPlugin
#746
Is there an existing issue for this?
Describe the problem
The convention plugin AndroidFeatureConventionPlugin currently creates many unwanted build variants, which definitely has a negative impact on total build time.
nowinandroid/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt
Line 43 in b91773d
This creates variants of libraries, where in fact, they are meaningless and detrimental because the code is always the same, and it forces consumers to be "variant-aware".
For example, the
:core:domain
module which should not have variants:Describe the solution
Remove the default "flavoring" of
AndroidLibraryConventionPlugin
, and centralize it in a dedicatedAndroidFlavorsConventionPlugin
.Additional context
This also brings the question of "where" should
@Module
be declared.For instance, in the
:core:analytics
module, we have the modules defined in the variants sourceSets (prod/demo). Even though the stub (for demo) and Firebase (for prod) is shipped in the main/default sourceSet which breaks the expectations of build variants to only contain the relevant code.Having this module publish its variants, forces other modules dependending on it to also be variant-ware...
Here are two solutions:
@Module
s to the:app
module, which is meant to be variant-aware.@Module
s to a:core:analytics:wiring
module, which only the:app
module will depend on.Code of Conduct
The text was updated successfully, but these errors were encountered: