From fe0735cfaa0fa65008ebffbbde9c22eba4c9d4e8 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 13 Jun 2018 19:57:24 +0900 Subject: [PATCH 1/3] Move commons-io from lib/BUILD to lib/commons/BUILD All the commons-* libraries are defined in lib/commons/BUILD with the exception of commons-io which is in lib/BUILD. Move it to lib/commons/BUILD to make it consistent. Change-Id: If2541eba2a4a9e9b5e7a777940bfce923478808b --- lib/BUILD | 7 ------- lib/commons/BUILD | 7 +++++++ plugins/replication | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/BUILD b/lib/BUILD index 5218424bc2..cddc3cf568 100644 --- a/lib/BUILD +++ b/lib/BUILD @@ -300,10 +300,3 @@ java_library( visibility = ["//visibility:public"], exports = ["@postgresql//jar"], ) - -java_library( - name = "commons-io", - data = ["//lib:LICENSE-Apache2.0"], - visibility = ["//visibility:public"], - exports = ["@commons-io//jar"], -) diff --git a/lib/commons/BUILD b/lib/commons/BUILD index 55c6b4e6ec..ddb11e3d97 100644 --- a/lib/commons/BUILD +++ b/lib/commons/BUILD @@ -21,6 +21,13 @@ java_library( exports = ["@commons-compress//jar"], ) +java_library( + name = "io", + data = ["//lib:LICENSE-Apache2.0"], + visibility = ["//visibility:public"], + exports = ["@commons-io//jar"], +) + java_library( name = "lang", data = ["//lib:LICENSE-Apache2.0"], diff --git a/plugins/replication b/plugins/replication index da3980a431..4a1755eb46 160000 --- a/plugins/replication +++ b/plugins/replication @@ -1 +1 @@ -Subproject commit da3980a431ba9138c9af91b6c3d9eaed4f4bc781 +Subproject commit 4a1755eb46f65a812c99a0c552095f4322fc08a3 From fd0fcb242237bfffe64ddc28094c32ad179c0954 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Thu, 14 Jun 2018 15:32:28 +0900 Subject: [PATCH 2/3] Format WORKSPACE and BUILD files with buildifier version 0.12.0 Change-Id: I6d5d4f34ba2317b82547f5dde5d0ef69d69cfce7 --- Documentation/dev-contributing.txt | 2 +- WORKSPACE | 6 +++--- gerrit-gwtui/BUILD | 2 +- polygerrit-ui/app/BUILD | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/dev-contributing.txt b/Documentation/dev-contributing.txt index 22e317405c..ffb9272054 100644 --- a/Documentation/dev-contributing.txt +++ b/Documentation/dev-contributing.txt @@ -155,7 +155,7 @@ To format Java source code, Gerrit uses the link:https://github.com/google/google-java-format[`google-java-format`] tool (version 1.5), and to format Bazel BUILD and WORKSPACE files the link:https://github.com/bazelbuild/buildtools/tree/master/buildifier[`buildifier`] -tool (version 0.11.1). +tool (version 0.12.0). These tools automatically apply format according to the style guides; this streamlines code review by reducing the need for time-consuming, tedious, and contentious discussions about trivial issues like whitespace. diff --git a/WORKSPACE b/WORKSPACE index b5e7d4cad2..3fa38cd385 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,7 +1,7 @@ workspace(name = "gerrit") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") -load("//tools/bzl:maven_jar.bzl", "maven_jar", "GERRIT", "MAVEN_LOCAL") +load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_LOCAL", "maven_jar") load("//lib/codemirror:cm.bzl", "CM_VERSION", "DIFF_MATCH_PATCH_VERSION") load("//plugins:external_plugin_deps.bzl", "external_plugin_deps") @@ -218,7 +218,7 @@ maven_jar( sha1 = "675642ac208e0b741bc9118dcbcae44c271b992a", ) -load("//lib:guava.bzl", "GUAVA_VERSION", "GUAVA_BIN_SHA1") +load("//lib:guava.bzl", "GUAVA_BIN_SHA1", "GUAVA_VERSION") maven_jar( name = "guava", @@ -929,7 +929,7 @@ maven_jar( sha1 = "65bd0cacc9c79a21c6ed8e9f588577cd3c2f85b9", ) -load("//tools/bzl:js.bzl", "npm_binary", "bower_archive") +load("//tools/bzl:js.bzl", "bower_archive", "npm_binary") npm_binary( name = "bower", diff --git a/gerrit-gwtui/BUILD b/gerrit-gwtui/BUILD index 721b64609e..982ac257d9 100644 --- a/gerrit-gwtui/BUILD +++ b/gerrit-gwtui/BUILD @@ -1,7 +1,7 @@ load( "//tools/bzl:gwt.bzl", - "gwt_genrule", "gen_ui_module", + "gwt_genrule", "gwt_user_agent_permutations", ) load("//tools/bzl:license.bzl", "license_test") diff --git a/polygerrit-ui/app/BUILD b/polygerrit-ui/app/BUILD index 0c4238ad23..6a668e0f5f 100644 --- a/polygerrit-ui/app/BUILD +++ b/polygerrit-ui/app/BUILD @@ -3,13 +3,13 @@ package( ) load("//tools/bzl:genrule2.bzl", "genrule2") -load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library", "closure_js_binary") +load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_binary", "closure_js_library") load( "//tools/bzl:js.bzl", - "bower_component_bundle", - "vulcanize", "bower_component", + "bower_component_bundle", "js_component", + "vulcanize", ) vulcanize( From 592c7eab0e35b368a45d99aca4230a920dfad52f Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Fri, 8 Jun 2018 10:51:01 -0400 Subject: [PATCH 3/3] Add optional dir_name argument to gerrit_plugin This allows the plugin to live in a directory name that doesn't exactly match the plugin name. Without this change, building such a plugin will fail since the STABLE_BUILD_*_LABEL var won't be found in the stamp info file. Same as https://gerrit-review.googlesource.com/c/bazlets/+/183670 but for in-tree plugin builds. Change-Id: I393a4e9b418ee3c91ca41794aeee22cfd718d494 (cherry picked from commit e7bf2e23aa9b8d0786a75b550dce21f427ea4073) --- tools/bzl/plugin.bzl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/bzl/plugin.bzl b/tools/bzl/plugin.bzl index 33f2e6ae89..8401a6bb6e 100644 --- a/tools/bzl/plugin.bzl +++ b/tools/bzl/plugin.bzl @@ -27,6 +27,7 @@ def gerrit_plugin( gwt_module = [], resources = [], manifest_entries = [], + dir_name = None, target_suffix = "", **kwargs): native.java_library( @@ -42,6 +43,9 @@ def gerrit_plugin( if gwt_module: static_jars = [':%s-static' % name] + if not dir_name: + dir_name = name + native.java_binary( name = '%s__non_stamped' % name, deploy_manifest_lines = manifest_entries + ["Gerrit-ApiType: plugin"], @@ -87,7 +91,7 @@ def gerrit_plugin( stamp = 1, srcs = ['%s__non_stamped_deploy.jar' % name], cmd = " && ".join([ - "GEN_VERSION=$$(cat bazel-out/stable-status.txt | grep -w STABLE_BUILD_%s_LABEL | cut -d ' ' -f 2)" % name.upper(), + "GEN_VERSION=$$(cat bazel-out/stable-status.txt | grep -w STABLE_BUILD_%s_LABEL | cut -d ' ' -f 2)" % dir_name.upper(), "cd $$TMP", "unzip -q $$ROOT/$<", "echo \"Implementation-Version: $$GEN_VERSION\n$$(cat META-INF/MANIFEST.MF)\" > META-INF/MANIFEST.MF",