Bazel: Don't ship version information in common:server artifact

Since I26e38a8c3 generated version information is included into
common:server artifact. This means that every time the generated
version is changed (the outcome of git describe command) the above
artifact is changed. As the consequence, almost all tests are
re-executed.

To rectify, isolate Version file in its own artifact and supply it
to tests and WAR packaging machinery. Don't bother to isolate the
version test in its own test rule, as there are only auto value
tests in addition to version tests. These two tests require 0.4 sec.
on my laptop. With this approach, every time, the new gerrit version
is generated, only common:server_tests rule is re-executed.

Bug: Issue 7737
Change-Id: Ib769c97ae651bdb347f5817ccc42e8dc52b5b975
This commit is contained in:
David Ostrovsky
2017-11-11 05:38:03 +01:00
committed by David Ostrovsky
parent 7d35ff3fbe
commit 7d65712adc
3 changed files with 11 additions and 1 deletions

View File

@@ -24,6 +24,7 @@ junit_tests(
srcs = SERVER_TEST_SRCS,
deps = [
"//java/com/google/gerrit/common:server",
"//java/com/google/gerrit/common:version",
"//java/com/google/gerrit/launcher",
"//lib:guava",
"//lib:truth",