This message was deleted.
# dependency-management
s
This message was deleted.
v
I'm not sure I fully understood your setup, but as long as there are no real cycles, I think it should work. If e. g.
library:a
depends on
sandbox:b
and
sandbox:b
depends on
library:c
(where
library:c
does not anyhow depend on
library:a
of course)
l
You got the idea. The cycle is only there depending on the granularity from which you look at it. The two projects reside in separate builds that cyclically include each other. However, there is no cycle in the configurations. I'll go ahead and file an issue.
n
Does gradle really support that? I assumed it always built the included build first and only applied substitutions in the "parent" project 🤔
v
Afair it should only build the part of the included build that is actually used. If you for example
includeBuild
a build, but don't have a dependency, nothing of the included build is built. If you include a build with 5 projects and only depend on one of them, only that one should be built. So I think it should work just fine.
l
Filed https://github.com/gradle/gradle/issues/23980 with an MCVE to report the issue and ask for clarification. There is room for improvement here regardless of what is the intended behavior.
👌 1
v
Btw. if you eliminate the need for dependency substitutions (always preferable imho) by properly configuring your projects with its coordinates, it works perfectly fine.
Just set the
group = com.example
on both projects and remove the substitution blocks
Copy code
> Task :library:build

BUILD SUCCESSFUL in 3s
Copy code
testRuntimeClasspath - Runtime classpath of source set 'test'.
\--- com.example:sandbox:0.1.0 -> project :sandbox
     \--- com.example:library:0.1.0 -> project :library (*)
Or if you alternatively add
Copy code
configurations.configureEach {
    resolutionStrategy.dependencySubstitution {
        substitute(module("com.example:library")).using(project(":library"))
    }
}
in your
library/build.gradle.kts
it also works. The
library
build just don't know about the substitution you configured in the
sandbox
build.