-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Cannot target a project variant with dependency substitution #1553
Comments
Any update on this issue? Is it being planned, or do you want help from the community? https://groups.google.com/forum/#!searchin/gradle-dev/dependency$20substitution$20with$20project$20configuration|sort:date/gradle-dev/CuzXSQ7gyUQ/WW3ICQe4HgAJ |
We are working hard on this:
However there's quite a long road between the current work and solving the common composite-builds use case. In the end we want to be able to:
If you're interested in helping out, you might want to start by exploring |
Hello. |
This is something I am interested in helping out on. I've looked at SoftwareComponent (a few times) but was not really able to understand just what would be required to make a new instance that works sanely (w.r.t. publishing and consuming different variants of a given project). I'm building a set of tools for publishing sets of archives (jar, sourceJar, api, spi, etc) for multiple platforms (main, gwt, j2cl, android, etc) from sets of projects using multiple sourcesets. I have a pretty good grip on getting these sourcesets wired up to behave within a build, but once composite are in play, things get ...unhappy. While I have the interests of my own use case at heart, I'd be happy to inherit some scope to build TheRightThing as a path to getting what I need... especially if there was a checklist of ThingsThatShouldBeDone and ThingsThatMustNotBeDone to guide me (or any other pointers to consider when tackling this). For example: would this hurt less if I was publishing to an ivy repo? Sorry, I know this isn't something you can't just frivolously answer; I look forward to being a productive guinea pig :-) If there was some documentation / recommended reading regarding variants, and associated best practices, I'd love to read it :-) |
Now that variant aware selection is established as the Gradle reference for such problems, renaming this to indicate that it is not possible to select the specific variant of a project or dependency through substitution rules. |
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution. |
This issue has been automatically closed due to inactivity. If you can reproduce this on a recent version of Gradle or if you have a good use case for this feature, please feel free to reopen the issue with steps to reproduce, a quick explanation of your use case or a high-quality pull request. |
It is possible to target a particular project configuration in a dependency declaration (
project(path: ':groovy', configuration: 'indy')
), but this isn't possibly inside adependencySubstitution
block. This is a much requested feature and blocks many users from using dependency substitution. I'm confident it will become much more requested as people start to use composite builds.The use of project configurations is problematic, since a configuration can be used to model different variants of the same component (fat jar, classes directory, etc) and can also be used to model a multiple different components within the same project (library, test-fixtures, etc). These should be treated differently from a dependency resolution standpoint, but this difference is lost when modelled as a
configuration
.We have a couple options:
configuration
with better modelling of variants and components, and promote the use of these improved concepts.Either way, we should address this as fairly major limitation to composite builds as they stand.
The text was updated successfully, but these errors were encountered: