Skip to content

support multiple base packages in Android modules #372

@RBusarow

Description

@RBusarow

Some Android projects choose to have different base packages for different source sets -- especially androidTest. For instance, they might follow a pattern like:

source set base package
androidTest com.example.app.test
debug com.example.app.debug
main com.example.app

This is done by adding a small manifest file with just the custom package to the inheriting source set. It will override any upstream (inherited) package definition.

For the sake of simplicity, ModuleCheck currently only supports a single base package per module -- throwing an exception if it finds more. I never intended for that to be the final policy, but some other infrastructure was missing so a more rigorous solution would have been difficult.

Instead of just having a single androidPackage property per project, they should be keyed by SourceSet. For lookups, if a base package is undefined for a specific source set, like debug, then look to its upstream source set(s) (like main).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions