-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update plugin version used in final BOM #363
Conversation
Add an automated Gradle task to update the plugin.properties file as part of the compilation step, only if there was any change to version, organization, or project name. Fixes gh-360 Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
build.gradle.kts
Outdated
dependsOn.add(processPluginPropertiesFile) | ||
} | ||
|
||
val processPluginPropertiesFile = tasks.register<DefaultTask>("processPluginPropertiesFile") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see that when moving from Groovy to Kotlin for the Gradle configuration, the code updating the plugin.properties file automatically has been removed: https://github.com/CycloneDX/cyclonedx-gradle-plugin/pull/305/files#diff-49a96e7eea8a94af862798a45174e6ac43eb4f8b4bd40759b5da63ba31ec3ef7L38
It would be nice to have it automatically updated. An option is to add the task back using the Kotlin syntax and make it part of the compilation step, but it would cause continuous changes to the properties file even if nothing changed (due to the autogenerated timestamp) resulting in a poor development experience. I have drafted this alternative solution to change the file only if there was any actual change.
This custom task could stay here or, if we want it defined in its own file, it could be moved to a buildSrc
folder within the project.
Signed-off-by: Guillaume Le Floch <glfloch@gmail.com>
Thanks @ThomasVitale I wonder if we could just remove the |
@glefloch I like that idea, much cleaner approach. I'll update the pull request. |
Generate plugin.properties at build time. Fixes gh-360 Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
Add an automated Gradle task to update the plugin.properties file as part of the compilation step, only if there was any change to version, organization, or project name.
Fixes gh-360