If I add `foo=bar` to my root project `gradle.prop...
# community-support
m
If I add
foo=bar
to my root project
gradle.properties
, how is this working if this same root project becomes an included build? 1. The main build value is used 2. The included build value is used 3. It depends If 3., how can I tell?
v
4. Obiwan Kenobi
😅 1
t
looks like included build uses its own properties. same for root.
Copy code
> Configure project :plugins
IncludedBuild foo=included

> Configure project :
RootBuild foo=rootProject
and if not set in included builds props it doesn't pick up from root.
Copy code
> Configure project :plugins
IncludedBuild foo=null
but if passed via
-P
it goes to both
Copy code
> Configure project :plugins
IncludedBuild foo=cli-arg

> Configure project :
RootBuild foo=cli-arg
m
I mean for some of them it makes almost no sense I think? There can be only one
org.gradle.jvmargs
for an example
But for CC and project isolation, it already becomes more of a question
Then there's the question that properties might be passed down but just not observed I guess
t
in my project I usually just put a sane default in each gradle.properties, then in CI when I need to have them updated I just calculate the value once into a bash var and pass it via -P for subsequent builds. Typically only do this for version value when publishing to jfrog. The usecase I had in that thread was for the most part made moot by using a shared toml file across all the builds in our main repo.
m
Thanks! I think I will just continue duplicating my gradle.properties for now.
y
> I think I will just continue duplicating my gradle.properties for now. Best approach > I mean for some of them it makes almost no sense I think? There can be only one
org.gradle.jvmargs
for an example This is related to the fact that the included build is built using the same JVM & Gradle as the starting root project. This might change in future, but it is state thing at present.
👍 1