Skip to content

support multiple base packages in Android modules #372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RBusarow opened this issue Jan 29, 2022 · 0 comments · Fixed by #411
Closed

support multiple base packages in Android modules #372

RBusarow opened this issue Jan 29, 2022 · 0 comments · Fixed by #411
Labels
bug Something isn't working

Comments

@RBusarow
Copy link
Member

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).

@RBusarow RBusarow added the bug Something isn't working label Jan 29, 2022
RBusarow added a commit that referenced this issue Feb 24, 2022
RBusarow added a commit that referenced this issue Feb 24, 2022
@kodiakhq kodiakhq bot closed this as completed in #411 Feb 24, 2022
kodiakhq bot pushed a commit that referenced this issue Feb 24, 2022
RBusarow added a commit that referenced this issue Feb 26, 2022
* main:
  support multiple android base packages fixes #372 fixes #402

# Conflicts:
#	modulecheck-core/src/main/kotlin/modulecheck/core/rule/DisableViewBindingRule.kt
#	modulecheck-core/src/main/kotlin/modulecheck/core/rule/InheritedDependencyRule.kt
#	modulecheck-parsing/gradle/src/main/kotlin/modulecheck/parsing/gradle/SourceSet.kt
RBusarow added a commit that referenced this issue Feb 26, 2022
* main:
  support multiple android base packages fixes #372 fixes #402

# Conflicts:
#	modulecheck-core/src/main/kotlin/modulecheck/core/rule/DisableViewBindingRule.kt
#	modulecheck-core/src/main/kotlin/modulecheck/core/rule/InheritedDependencyRule.kt
#	modulecheck-parsing/gradle/src/main/kotlin/modulecheck/parsing/gradle/SourceSet.kt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant