This message was deleted.
# community-support
s
This message was deleted.
a
Try taking a look at my answer here: https://stackoverflow.com/a/75957228/4161471
👀 1
❤️ 2
the difference being that in the 'provider' Configuration in the root project you can add
extendsFrom(configurations.implementation.get())
👍 1
t
I am struggling to get expected result when "configurations" belong to different Gradle's sub-projects
You shouldn't reach to other projects' configurations directly. See https://docs.gradle.org/current/userguide/cross_project_publications.html (as you probably want those projects' output too, but variants should work even without output I believe)
➕ 1
👀 1
❤️ 1
a
instead of using a separate subproject for your test code, you could also consider using the JVM Test Suite Plugin https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html It would probably be simpler to set up, and you'd still end up with an independent source set. But it depends why you want a separate subproject (which I agree, is sometimes useful)
k
Thank you so much guys! Now I see why simple single "configuration" referencing other
project()
is not enough (and not recommended) here and that the only right way to do it is through "variants". @Adam your long SO post additionally helped me to finally wrap my head around "variants" concept. Thank you! Btw I am aware of "test suites", but here I indeed need a different sub-project, because those tests are another deployment unit. Finally, to solve my problem it was enough to just follow the "Simple sharing of artifacts between projects" section of Gradle docs. I just created a pair of configurations on provider and consumer side, where I just
extendFrom
what I need on provider side. That gave me a safe and idiomatic exchange between sub-projects. Cool!
👍 1