as we use blade before , which offer some utilities to setup binary version for all cc_binary targets. So for all binaries , wo can use "--version" to see binary version info, (build time, build host name, build user, svn or git version info, debug or release etc... )
will it be supported in bazel in the near future? Or is it possible to implement this feature in an extension? If Yes, what should i do then?
thanks
Shunping Ye
genrule( name = "gen_my_binary_version", outs = ["my_binary_version.txt"], cmd = "echo $(my_binary_version) > $@")
*_binary(
name = "my_binary",
...
data = [":my_binary_version.txt"])
bazel build :my_binary --define my_binary_version=1.2.3.4
cat > $@ <<EOF package my.binary.package; public class BuildInfo { public static final String VERSION = "$(my_binary_version)"; }EOF""")
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/78e489e5-9323-435f-92eb-9dd650e1d573%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAAvaYB%3D-064aBFPRtqFDASATmm%3DcVz1kqOovKQvU7ZQdgL8vWA%40mail.gmail.com.