-
Notifications
You must be signed in to change notification settings - Fork 69
Read version from resource instead of hard-coding it #220
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
Conversation
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.
Thanks for doing this
cli/BUILD
Outdated
kt_jvm_library( | ||
name = "cli-lib", | ||
srcs = glob(["src/main/kotlin/**/*.kt"]), | ||
resources = ["//:.bazelversion"], |
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.
This looks good. We need to use a different version file then this one since this one controls the version of Bazel that is running, not the version of bazel-diff
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.
Oh oops, currently when the binary is published, how is the version passed in? I see that since it follows semvar, it seems like it might be provided from the pipeline itself?
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.
ah looks like it picks it up from tags.
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.
@tinder-maxwellelliott correct my assumption above, updated the PR to utilize bazel stamping to embed the version tag and read it directly from the binary resources instead.
class VersionProvider : IVersionProvider { | ||
override fun getVersion(): Array<String> { | ||
return arrayOf("7.0.0") | ||
val classLoader = this::class.java.classLoader |
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.
Does it make more sense to simply make a bazel rule that can accept the stable-status path and code gen this entire file? Seems like there are a couple steps here that could be collapsed into one?
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.
Thanks for doing this
Uh oh!
There was an error while loading. Please reload this page.