Slackbot
09/12/2023, 6:22 AMmelix
09/12/2023, 7:11 AMcompileJava). Or, you can have plugins which reason on the version to configure things differently (e.g if SNAPSHOT is used, etc...). It is unfortunate that there's no Provider<String> for version and group yet, which would be a better fit for your use case, but in general, you simply cannot know.Christoph Hermann
09/12/2023, 7:47 AMChristoph Hermann
09/12/2023, 7:48 AMmelix
09/12/2023, 7:50 AMmelix
09/12/2023, 7:52 AMassemble. I call tasks I need for a particular job. e.g test, jar or even sometimes just compileJava.Thomas Broyer
09/12/2023, 8:45 AMproject.version is an Object, so you can actually make it compute (and memoize) its toString() dynamically.
Not saying you should do it that way, but it works (or at least, it worked!)
https://github.com/tbroyer/gradle-incap-helper/blob/21afe339d6281ee040db5547cbded7ff21b59ae8/build-logic/src/main/kotlin/VersionFromGit.kt
https://github.com/tbroyer/gradle-incap-helper/blob/21afe339d6281ee040db5547cbded7ff21b59ae8/build.gradle.ktsmelix
09/12/2023, 8:46 AMProvider 😄melix
09/12/2023, 8:46 AMversion is a String thoughChristoph Hermann
09/12/2023, 9:33 AMChristoph Hermann
09/12/2023, 9:33 AMChristoph Hermann
09/12/2023, 9:34 AMmelix
09/12/2023, 9:45 AM