Javi
05/03/2026, 1:34 PMimplementation(…) can be used but the APIs are internal).Javi
05/03/2026, 1:39 PMJavi
05/03/2026, 1:49 PMcustomProp that gets a version from env, gradle properties, local properties, or whatever.
format {
ktfmt {
version = customProp("ktfmtVersion")
}
}
Banning that behavior just to get "explicit" build will be just hiding under a rug (custom included build with custom implementation) the issue. Obviously customProp can be a good name to know what is indeed happening by just reading the name of the function.
So instead of seeing easily what is happening in the build, with no included build or no knowledge about the build itself, the DCL will be:
format {
ktfmt {
// ktfmt version is changed "magically" if you aren't the build author.
}
}
And the version is just wired in the included build, no way to see that easily in the DCL, if you know nothing about the included build, it is just magic.
I hope I am missing something and this is possible to be done.Philip W
05/03/2026, 1:49 PMPhilip W
05/03/2026, 1:50 PMPhilip W
05/03/2026, 1:51 PMJavi
05/03/2026, 1:51 PMmapVersion
semver {
tagPrefix.set("v")
mapVersion { gradleVersion: GradleVersion ->
val kotlinVersion: String = getKotlinPluginVersion()
"${gradleVersion.copy(metadata = kotlinVersion)}"
}
}
But I need a way to at least have simple functions like implementation.Javi
05/03/2026, 1:52 PMPhilip W
05/03/2026, 1:52 PMJavi
05/03/2026, 1:56 PMimplementation is a DependencyCollector and Gradle generates an invoke function for some parameters.Can I have my own "Collector" so Gradle generates the functions? I am checking the
StandardLibraryComponent and it is full of internal APIs, and I guess that the magic is done by:
• AnalysisSchemaComponent
• ObjectConversionComponent
Both are internalPhilip W
05/03/2026, 1:58 PMPhilip W
05/03/2026, 1:59 PMPhilip W
05/03/2026, 1:59 PMPhilip W
05/03/2026, 2:01 PMJavi
05/03/2026, 2:02 PM