tylervz
03/27/2024, 2:23 PM<http://grails.build.info|grails.build.info>) file: https://objectcomputing.com/news/2017/04/02/add-build-info-your-project
We get the following error when running any Gradle task with our Grails 6 app now. Does anyone have a method they recommend for storing build metadata such as Git commit revision, build date, build number for a Grails 6 application?
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/tylervanzanten/src/hypercision/rollcall/backend/rollcall/build.gradle' line: 140
* What went wrong:
A problem occurred evaluating root project 'rollcall'.
> Could not get unknown property 'buildProperties' for root project 'rollcall' of type org.gradle.api.Project.tylervz
03/27/2024, 2:44 PMbuildProperties Gradle task, but I'm not sure how to modify my build.gradle file to use it properly.
https://github.com/grails/grails-gradle-plugin/blob/dadb63307a397abe73d1d548f9dede4050229722/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy#L137-L139
https://github.com/grails/grails-gradle-plugin/blob/dadb63307a397abe73d1d548f9dede4050229722/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy#L214
For reference, here's the relevant code of the Grails Gradle Plugin version 5.3.x :
https://github.com/grails/grails-gradle-plugin/blob/2dfd3033ec341a9f6b8ad26192c721a964aaad2c/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy#L138
https://github.com/grails/grails-gradle-plugin/blob/2dfd3033ec341a9f6b8ad26192c721a964aaad2c/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy#L206tylervz
03/27/2024, 5:10 PMproject.gradle.projectsEvaluated closure like so:
project.gradle.projectsEvaluated {
buildProperties.doLast {
...
}
}