Update buck to the latest version
This version includes a lot of new features and improvements, including: * Switched to top-down-building, which should generally make builds faster. The old behavior can be bypassed by passing --deep on the command line [1] * New query command was added (inspired by Bazel) [2] * Performance improvement in file globbing Extend tools/eclipse/project.py to pass the --deep option to ask Buck to execute bottom-up build when generating the Eclipse project. This is needed otherwise after using the buck clean command only the gerrit.war file would be fetched from the cache and the buck-out/gen/lib folder would remain empty. With [3] genrule output is now namespaced with the genrule name. Adapt documentation and references in the code to the new location of Buck artifacts. Because of this change, `buck clean` must be issued after Buck upgrade, otherwise the build would fail. The same prolem exists when switching between branches: `buck clean` must be issued, otherwise the build would fail. Test plan: * buck build release * buck build api_install * buck test * install and verify new gerrit site * upgrade and verify existing gerrit site * reindex existing gerrit site * verify that tools/eclipse/project.py produces sane Eclipse project * verify that unit test execution from Eclipse works * verify that daemon started from Eclipse works * verify that GWT SDM debug session started from Eclipe works [1]217cec33bc
[2] https://buckbuild.com/command/query.html [3]c92ef212b5
Change-Id: Ib3f22e70b7cb9eb9349618f2bcc018bf799c40f8
This commit is contained in:
@@ -1 +1 @@
|
||||
8204fddf60b25a3c2090f3ef0742fca5d466d562
|
||||
d1be554f51fb9b2f090a85fcdbcef3b4dbbef8d7
|
||||
|
@@ -106,7 +106,7 @@ To build the Gerrit web application:
|
||||
The output executable WAR will be placed in:
|
||||
|
||||
----
|
||||
buck-out/gen/gerrit.war
|
||||
buck-out/gen/gerrit/gerrit.war
|
||||
----
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ To build Gerrit in headless mode, i.e. without the GWT Web UI:
|
||||
The output executable WAR will be placed in:
|
||||
|
||||
----
|
||||
buck-out/gen/headless.war
|
||||
buck-out/gen/headless/headless.war
|
||||
----
|
||||
|
||||
=== Extension and Plugin API JAR Files
|
||||
@@ -137,8 +137,8 @@ project directories in `buck-out/gen`, here as example for plugin API:
|
||||
|
||||
----
|
||||
buck-out/gen/gerrit-plugin-api/plugin-api.jar
|
||||
buck-out/gen/gerrit-plugin-api/plugin-api-javadoc/plugin-api-javadoc.jar
|
||||
buck-out/gen/gerrit-plugin-api/plugin-api-src.jar
|
||||
buck-out/gen/gerrit-plugin-api/plugin-api-javadoc.jar
|
||||
----
|
||||
|
||||
Install {extension,plugin,gwt}-api to the local maven repository:
|
||||
@@ -170,7 +170,7 @@ The output JAR files for individual plugins will be placed in:
|
||||
The JAR files will also be packaged in:
|
||||
|
||||
----
|
||||
buck-out/gen/plugins/core.zip
|
||||
buck-out/gen/plugins/core/core.zip
|
||||
----
|
||||
|
||||
To build a specific plugin:
|
||||
@@ -224,7 +224,7 @@ placed in:
|
||||
The html files will also be bundled into `searchfree.zip` in this location:
|
||||
|
||||
----
|
||||
buck-out/gen/Documentation/searchfree.zip
|
||||
buck-out/gen/Documentation/searchfree/searchfree.zip
|
||||
----
|
||||
|
||||
To build the executable WAR with the documentation included:
|
||||
@@ -236,7 +236,7 @@ To build the executable WAR with the documentation included:
|
||||
The WAR file will be placed in:
|
||||
|
||||
----
|
||||
buck-out/gen/withdocs.war
|
||||
buck-out/gen/withdocs/withdocs.war
|
||||
----
|
||||
|
||||
[[soyc]]
|
||||
@@ -272,7 +272,7 @@ all core plugins:
|
||||
The output release WAR will be placed in:
|
||||
|
||||
----
|
||||
buck-out/gen/release.war
|
||||
buck-out/gen/release/release.war
|
||||
----
|
||||
|
||||
[[all]]
|
||||
|
@@ -87,7 +87,7 @@ After compiling (above), run Gerrit's 'init' command to create a
|
||||
testing site for development use:
|
||||
|
||||
----
|
||||
java -jar buck-out/gen/gerrit.war init -d ../gerrit_testsite
|
||||
java -jar buck-out/gen/gerrit/gerrit.war init -d ../gerrit_testsite
|
||||
----
|
||||
|
||||
Accept defaults by pressing Enter until 'init' completes, or add
|
||||
@@ -130,7 +130,7 @@ The daemon can be directly launched from the build area, without
|
||||
copying to the test site:
|
||||
|
||||
----
|
||||
java -jar buck-out/gen/gerrit.war daemon -d ../gerrit_testsite
|
||||
java -jar buck-out/gen/gerrit/gerrit.war daemon -d ../gerrit_testsite
|
||||
----
|
||||
|
||||
=== Running the Daemon with Gerrit Inspector
|
||||
@@ -149,7 +149,7 @@ Gerrit Inspect can be started by adding '-s' option to the
|
||||
command used to launch the daemon:
|
||||
|
||||
----
|
||||
java -jar buck-out/gen/gerrit.war daemon -d ../gerrit_testsite -s
|
||||
java -jar buck-out/gen/gerrit/gerrit.war daemon -d ../gerrit_testsite -s
|
||||
----
|
||||
|
||||
Gerrit Inspector examines Java libraries first, then loads
|
||||
@@ -176,7 +176,7 @@ The embedded H2 database can be queried and updated from the
|
||||
command line. If the daemon is not currently running:
|
||||
|
||||
----
|
||||
java -jar buck-out/gen/gerrit.war gsql -d ../gerrit_testsite
|
||||
java -jar buck-out/gen/gerrit/gerrit.war gsql -d ../gerrit_testsite
|
||||
----
|
||||
|
||||
Or, if it is running and the database is in use, connect over SSH
|
||||
|
@@ -189,7 +189,7 @@ public abstract class PluginDaemonTest extends AbstractDaemonTest {
|
||||
|
||||
private Properties loadBuckProperties() throws IOException {
|
||||
Properties properties = new Properties();
|
||||
Path propertiesPath = gen.resolve("tools").resolve("buck.properties");
|
||||
Path propertiesPath = gen.resolve(Paths.get("tools/buck/buck.properties"));
|
||||
if (Files.exists(propertiesPath)) {
|
||||
try (InputStream in = Files.newInputStream(propertiesPath)) {
|
||||
properties.load(in);
|
||||
|
@@ -682,7 +682,7 @@ public class JettyServer {
|
||||
throws FileNotFoundException, IOException {
|
||||
Properties properties = new Properties();
|
||||
try (InputStream in = new FileInputStream(
|
||||
gen.resolve(Paths.get("tools/buck.properties")).toFile())) {
|
||||
gen.resolve(Paths.get("tools/buck/buck.properties")).toFile())) {
|
||||
properties.load(in);
|
||||
}
|
||||
return properties;
|
||||
|
@@ -42,7 +42,7 @@ def os_path():
|
||||
return environ.get('PATH')
|
||||
|
||||
genrule(
|
||||
name = 'buck.properties',
|
||||
name = 'buck',
|
||||
cmd = 'echo buck=`which buck`>$OUT;' +
|
||||
("echo PATH=\''%s'\' >>$OUT;" % shquote(os_path())),
|
||||
deps = [],
|
||||
|
@@ -224,8 +224,8 @@ try:
|
||||
gen_factorypath()
|
||||
|
||||
try:
|
||||
targets = ['//tools:buck.properties'] + MAIN + GWT
|
||||
check_call(['buck', 'build'] + targets)
|
||||
targets = ['//tools:buck'] + MAIN + GWT
|
||||
check_call(['buck', 'build', '--deep'] + targets)
|
||||
except CalledProcessError as err:
|
||||
exit(1)
|
||||
except KeyboardInterrupt:
|
||||
|
Reference in New Issue
Block a user