This message was deleted.
# community-support
s
This message was deleted.
c
If the included builds are via
include("some-other-module")
then only the root gradle.properties is used.
๐Ÿ‘€ 1
m
It's more like
includeBuild("some-other-project")
c
ah yea. unsure on how composite builds process gradle.properties.
for all our projects thereโ€™s a core convention plugin that, among other things, standardizes certain settings in gradle.properties.
m
Can this be even done in a plugin ? ๐Ÿค”
Like
jvmArgs
needs to be read before the dameon starts
c
it can be done in a plugin, but changes only take effect on the next run.
m
Super curious how that works. Do you have any documentation on this?
c
nothing fancy. simple custom task that takes a gradle.properties template as input, has gradle.properties as output, will only run if the template has changed. really no different than manually editing it, but baked into the builds so things stay consistent at scale.
m
oh I see
c
sorry to disappoint. iโ€™m often hoping to learn of some super-secret-awesome-api that saves the day ๐Ÿ˜‰
๐Ÿ˜… 1
Copy code
@CacheableTask
internal abstract class WriteGradleProperties : DefaultTask() {
    @get:OutputFile
    abstract val gradlePropertiesFile: RegularFileProperty

    @get:Input
    abstract val defaultProperties: MapProperty<String, String>

    @TaskAction
    fun taskAction() {
// merge logic here
}
}
๐Ÿ™ 1
l
As far as I know composite builds don't get gradle.properties passed along: https://github.com/gradle/gradle/issues/2534
๐Ÿ‘€ 1
w
The build cache configuration is for the whole build and will be passed down to included builds. Whether the build cache is on or off is also a build wide setting and canโ€™t be changed on a per included build level.
๐Ÿ™ 1
m
Thanks! Looks like "it depends" then? For a given Gradle property, can I know if it's going to be passed down or not, besides trying it?
w
I am pretty sure all the Gradle properties will be used from the root build and affect all included builds as well: https://docs.gradle.org/release-candidate/userguide/build_environment.html#sec:gradle_configuration_properties
thank you 1
๐Ÿ‘ 1