Expected Behavior
AGP and KMP are able to define their variants without also needing to define a second -published version.
Current Behavior (optional)
No response
Context
AGP and KMP define separate configurations for local dependency management and external publishing. Their local configurations are consumable, and their external configurations (which correspond to each local variant) are non-consumable.
Effectively, this means that each variant has two sources of truth. This breaks assumptions made in the dependency mapping feature, which assumes that each variant has a single definition.
KMP:
"-published" configurations are defined here:
Android:
"ApiPublication" and "RuntimePublication" variants are defined here
Slack Context
Some reasons we have been told this is necessary is that the attributes between local and external variants are different. We should determine how they are different by using a test project to see what attributes are being published and what are on the local variants.
Then, we should determine if this difference in attributes is necessary and continue from there.
Additionally, Android has stated that they also have a requirement to not publish secondary variants. Our solution must consider this constraint. By default, Gradle publishes secondary variants.
Acceptance Criteria:
- Determine why AGP and KMP need separate variants for local and external publishing
- Propose a solution for allowing these plugins to combine their duplicate variants into a single source of truth
- The proposed solution must be compatible with dependency mapping
Expected Behavior
AGP and KMP are able to define their variants without also needing to define a second
-publishedversion.Current Behavior (optional)
No response
Context
AGP and KMP define separate configurations for local dependency management and external publishing. Their local configurations are consumable, and their external configurations (which correspond to each local variant) are non-consumable.
Effectively, this means that each variant has two sources of truth. This breaks assumptions made in the dependency mapping feature, which assumes that each variant has a single definition.
KMP:
"-published" configurations are defined here:
Android:
"ApiPublication" and "RuntimePublication" variants are defined here
Slack Context
Some reasons we have been told this is necessary is that the attributes between local and external variants are different. We should determine how they are different by using a test project to see what attributes are being published and what are on the local variants.
Then, we should determine if this difference in attributes is necessary and continue from there.
Additionally, Android has stated that they also have a requirement to not publish secondary variants. Our solution must consider this constraint. By default, Gradle publishes secondary variants.
Acceptance Criteria: