Closed codex70 closed 1 year ago
Despite the name of the plugin, e.g. groovy-gradle-plugin
, it's a Gradle core plugin. The plugins offered by this project is dev.gradleplugins.groovy-gradle-plugin
(under the namespace dev.gradleplugins
). I would recommend using the Gradle user forum for such questions. In short, you want to use a gradle.properties
file. You can't pass properties to included builds which is my assumption around your usage of build-logic
.
I'm new to writing plugins for gradle and am following the examples here:
https://docs.gradle.org/current/userguide/structuring_software_products.html
Under "build-logic/commons/src/main/groovy" there are gradle files which I want to pass a value to for when the file is compiled and a value for when the plugin is being run. How do you do this?
So here is the sample code:
The idea is to specify the value ${build_version} when the "groovy-gradle-plugin" is being run (so the value is compiled into the plugin) and allow the ${run_version} to be specified when the generated plugin is run.
It's not clear to me how to set either of these values (even after lots of searching). Also, as a note, if I hard code values in, the generated plugin works as expected.