-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added version flag #27
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
subinclude("//build_defs:version") | ||
|
||
go_binary( | ||
name = "wollemi", | ||
srcs = ["main.go"], | ||
visibility = ["PUBLIC"], | ||
definitions = { | ||
"github.com/tcncloud/wollemi/ports/wollemi.WollemiVersion": VERSION, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could also just avoid the genrule and build_defs and just hard code the version here ? |
||
}, | ||
deps = [ | ||
"//adapters/bazel", | ||
"//adapters/cobra", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
genrule( | ||
name = "version", | ||
srcs = ["VERSION"], | ||
outs = ["version.build_defs"], | ||
cmd = "echo \"VERSION = '`cat $SRCS`'\" > \"$OUT\"", | ||
visibility = ["PUBLIC"], | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.7.2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally we would have this |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package wollemi | ||
|
||
// WollemiVersion is the current version of wollemi. | ||
// Note that non-bootstrap builds replace this interim version with a real one. | ||
var WollemiVersion = "dev-0.0.9999" |
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.
Keeping the
VERSION
file in the root of the repo and defining afilegroup
for it causes a circular dependency because//build_defs:version
requires thatfilegroup
, and thego_binary
requires//build_defs:version
.I see two possibilities: