Hi all, I am wondering why this does not cause a c...
# dependency-management
k
Hi all, I am wondering why this does not cause a cyclic dependency error. This is the build.gradle for project `web`:
Copy code
dependencies {
    testImplementation project(':test')
}
This is the build.gradle for project `test`:
Copy code
dependencies {
    api project(':web')
}
I assume it is because
test
is only called during runtime in
web
and at that point
test
has everything it needs from
web
to work?
ł
first, main sources of
web
are built, as they have no dependencies then, main source of
test
are built, because
:web
dependency can be already satsified then, `web`’s test sources are built, because
:test
is now built too
👍 1
d
Even though it is one project, you can have multiple sourcesets (
main
and
test
) which each have their separate classpaths: web.main: web.main test.main: test.main + web.main web.test: web.test + test.main + web.main Thus technically you have no circular dependency, although I personally have a check to prevent these kind of dependencies.
👍 1
k
Thank you for your explanations!