Skip to content
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

Deal with name clashes between project names and source set names #72

Open
jjohannes opened this issue Nov 28, 2023 · 0 comments
Open
Labels
a:enhancement New feature or request

Comments

@jjohannes
Copy link
Member

Consider the following setup:

settings.gradle

include("module-a") // applies 'java-test-fixtures' plugin
include("module-a-test")
include("module-b")

module-info.java of module-b

module org.example.module.b {
  requires org.example.module.a.test.fixtures;
}

In such a scenario, org.example.module.a.test.fixtures can point at two things:

  1. project: module-a source set: test-fixtures
  2. project: module-a-test source set: fixtures

Currently, the plugin chooses (2) as the longer project name is considered the better match. In this scenario (1) would be the right choice, but that's only the case here. In theory (2) could be the right choice in other setups.

The way to tell for sure would be to test if the chosen project has an outgoing variant with the capability that corresponds to the source set, to determine if the source set actually exists (in the example, fixtures does not exist in module-a-test). This can maybe be done by doing a "small" detached dependency resolution.

If this is difficult to solve automatically, the plugin can give a warning, that two solutions exist and prompt the user to define an explicit mapping for the right solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant