Skip to content
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

Merged
merged 4 commits into from
Nov 16, 2023

Conversation

ThomasVitale
Copy link
Contributor

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

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") {
Copy link
Contributor Author

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>
@glefloch
Copy link
Member

glefloch commented Nov 6, 2023

Thanks @ThomasVitale I wonder if we could just remove the plugin.properties file from git and simply run the task each time. Thus, we won't have to commit the new version as it will be generated for each build

@ThomasVitale
Copy link
Contributor Author

@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>
@glefloch glefloch merged commit f5f746e into CycloneDX:master Nov 16, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugin version 1.8.0 referencing version 1.7.4 in output
2 participants