Alex Beggs
06/28/2025, 1:28 PM./gradlew -Pproperty1=helloworld :a:assemble
and C
will get configured with the property1
value being passed into the configuration. We use a version
file that contains some information that is used by C
but could be different based on the calling outer project A
or some other project. What would be the best practice to be able to read the version
file and pass it down to project C
?
Ideally I would be able to set the properties from the outer project A
before the configuration gets called for C
but that doesn't seem to be possible since A
happens after C
Is there something that can be done in the settings.gradle.kts?
I know this can be done via the root projects gradle.properties
or the command line -P
option, but it is unclear to me how it can be done outside of those options.
Is there a way to load a set of properties in the root project and pass those properties into the composite build?Alex Beggs
06/28/2025, 1:36 PMversion
) files.Alex Beggs
06/28/2025, 2:08 PMephemient
06/28/2025, 10:54 PMAlex Beggs
06/29/2025, 3:49 AMgradle.beforeProject
but that didn't do anything
The only thing I found that could modify the properties prior to the configuration outside of the specific build.gradle.kts file was the init scripts. But the problem with that is that has to be configured for specific user Home or Gradle installations or specified on the command line which isn't something we can do.