Jesse Wilson
12/09/2024, 7:22 PMincludeBuild()
and set a property on the included build, as if I were invoking it with -Dfoo=bar
. The best I can come up with is to write some code that edits the included build’s gradle.properties
before I include it. Got a better way?Jesse Wilson
12/09/2024, 7:24 PMJendrik Johannes
12/09/2024, 8:04 PMincludes
are evaluated) is not really possible as far as I know.
So I think you need to do it via file system, as with your gradle.properties
idea.
If you want to have it more hidden, you can configure the second build to read information/properties from some other file of your choice (for example one you put inside build
or .gradle
).Jendrik Johannes
12/09/2024, 8:05 PM-D
...
....maybe you can use Java System pProperties as all this code runs in the same Daemon JVM. It may be possible to do System.setProperty("foo", "bar")
in the first build and later retrieve it in the second build. Don't know if it works, and if it would be smart. Changing the state of the daemon is not recommended as it will also affect the follow up builds running on it. If it works, you should reset the property after reading it.Jesse Wilson
12/09/2024, 8:06 PMJesse Wilson
12/09/2024, 8:07 PMgradle.properties
is bad, and the other options are not betterJesse Wilson
12/09/2024, 8:28 PMVampire
12/09/2024, 10:31 PMsystemProp...
via the gradle.properties
of the including build?