Adding dependencies inside withDependencies regression in 1.12.1
dansanduleac opened this issue · 3 comments
What happened?
A change in 1.12.0 made it so that GCV would lazily add BOM dependencies to runtimeElements
in a withDependencies
block, but this would fail if called too late, for instance if a build graph resolution already included this runtimeElements
, such as would happen when resolving the dependencies of another project, which depends on the affected project.
In the case below, a task resolved the graph of :foo-test:testRuntimeClasspath
which in turn resolved the graph of :foo:runtimeElements
, before the latter got a change to have dependencies added to it by GCV.
* What went wrong:
Could not determine the dependencies of task ':foo-test:dockerTest'.
> Could not resolve all dependencies for configuration ':foo-test:testRuntimeClasspath'.
> Cannot change dependencies of configuration ':foo:runtimeElements' after it has been included in dependency resolution.
There seems to be another 1.12.1 regression which I'm unsure if it's the same as this.
We depend on the Gradle ANTLR plugin, and apply it in dependencies like so:
dependencies {
antlr 'org.antlr:antlr4'
}
With the 1.12.1 upgrade, I had to modify this to:
dependencies {
antlr 'org.antlr:antlr4:4.7.2'
}
Or else I got:
* What went wrong:
Execution failed for task ':project-function:formula-function-grammar:generateGrammarSource'.
> Could not resolve all files for configuration ':project-function:formula-function-grammar:antlr'.
> Could not find org.antlr:antlr4:.
Required by:
project :project-function:formula-function-grammar
@mglazer working on the top issue, but I think what you mention in your comment is different. Would you mind filing a separate issue for that?