Build Version as part of common, and add tests

Previously, the Version resource used by Version.java was compiled
directly into the war, rather than being included in the java_library
alongside the class that used it. The intended effect was to produce a
version of "(dev)" when running from Eclipse, and an accurate version
when running from the war. However, it made the build graph a little
confusing, and moreover made it impossible to write a test that tests
the actual format of the "git describe" output.

Rearrange the build rules to include Version in the common:server
library. This actually still results in "(dev)" when run from Eclipse,
because there is no jar for this library in the Eclipse classpath, so
looking up the resource will still fail as expected.

Change-Id: I26e38a8c37aef9e1872faed1ab40d003e6dea946
This commit is contained in:
Dave Borowitz
2017-11-03 09:13:15 -04:00
parent af5696a32d
commit 62f2d09aea
6 changed files with 106 additions and 24 deletions

View File

@@ -17,7 +17,6 @@
jar_filetype = FileType([".jar"])
LIBS = [
"//java/com/google/gerrit/common:version",
"//java/com/google/gerrit/httpd/init",
"//lib:postgresql",
"//lib/bouncycastle:bcpkix",