From 49f1dc61d66045d07b61538b8d1c8cc538a039d6 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Sun, 8 Sep 2019 15:01:20 +0900 Subject: [PATCH 1/5] dev-contributing: Update recommended version of buildifier to 0.28.0 Change-Id: I1571616479811eb263b7e1a299e91feed8b54a83 --- Documentation/dev-contributing.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/dev-contributing.txt b/Documentation/dev-contributing.txt index 0913879fca..85fbcabd2e 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.7), and to format Bazel BUILD, WORKSPACE and .bzl files the link:https://github.com/bazelbuild/buildtools/tree/master/buildifier[`buildifier`] -tool (version 0.26.0). +tool (version 0.28.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. From 4f89f03dca29ad6b3c6be9018a7d8e1381b1263a Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Fri, 6 Sep 2019 19:31:40 +0200 Subject: [PATCH 2/5] Bazel: Avoid using tools in action inputs Bazel version 0.29 flipped the bit for this option: --incompatible_no_support_tools_in_action_inputs to ensure, that tools are not used in input, but instead passed as new parameter tools: [1]. Change I744ae1b28a already fixed some places, but missed the place fixed in this change. The problem shows up when debugging of GWT code with Bazel 0.27 and later. Test Plan: $ bazel build //gerrit-gwtui:ui_safari [1] https://github.com/bazelbuild/bazel/issues/5826 Change-Id: I491d70361444e4fb41a1dc2b7dbe422969c090ff --- tools/bzl/gwt.bzl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/bzl/gwt.bzl b/tools/bzl/gwt.bzl index e5dc4b66e6..4cfc99e614 100644 --- a/tools/bzl/gwt.bzl +++ b/tools/bzl/gwt.bzl @@ -132,8 +132,9 @@ def _gwt_user_agent_module(ctx): "$p/%s cC $p/%s $(find . | sed 's|^./||')" % (ctx.executable._zip.path, gwt_user_agent_zip.path), ]) ctx.actions.run_shell( - inputs = [gwt_user_agent_xml] + ctx.files._zip, + inputs = [gwt_user_agent_xml], outputs = [gwt_user_agent_zip], + tools = ctx.files._zip, command = cmd, mnemonic = "GenerateUserAgentGWTModule", ) From 9c3b07fea0e3cbc20dae9aebe93a938c43a4cc79 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Sat, 7 Sep 2019 10:26:45 +0200 Subject: [PATCH 3/5] junit.bzl: Fix name conventions warning flagged by buldifier Running recent buildifier version in warn mode reports this warning: ./tools/bzl/junit.bzl:60: name-conventions: Variable name "_GenSuite" should be lower_snake_case (for variables), UPPER_SNAKE_CASE (for constants), or UpperCamelCase ending with 'Info' (for providers). https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#name-convention Change-Id: I2fd8490e95a1b103a9ece9c68f2d09c5e4f3fbb0 --- tools/bzl/junit.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/bzl/junit.bzl b/tools/bzl/junit.bzl index ba31ffd8f5..5e28b8a0df 100644 --- a/tools/bzl/junit.bzl +++ b/tools/bzl/junit.bzl @@ -57,7 +57,7 @@ def _impl(ctx): ctx.attr.outname, )) -_GenSuite = rule( +_gen_suite = rule( attrs = { "srcs": attr.label_list(allow_files = True), "outname": attr.string(), @@ -68,7 +68,7 @@ _GenSuite = rule( def junit_tests(name, srcs, **kwargs): s_name = name.replace("-", "_") + "TestSuite" - _GenSuite( + _gen_suite( name = s_name, srcs = srcs, outname = s_name, From b80867d747f756281af91055dec285dd43cb7751 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Sun, 8 Sep 2019 22:31:37 +0900 Subject: [PATCH 4/5] Format BUILD files with buildifier Using buildifier from master branch and the command: $ buildifier -r -lint fix -warnings all . Change-Id: Ib0dbc38ba370edaa3bda999d49ee378917ae32c4 --- gerrit-extension-api/BUILD | 2 +- tools/BUILD | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gerrit-extension-api/BUILD b/gerrit-extension-api/BUILD index 2f764a9dc3..f71e2ee327 100644 --- a/gerrit-extension-api/BUILD +++ b/gerrit-extension-api/BUILD @@ -1,6 +1,6 @@ load("@rules_java//java:defs.bzl", "java_binary", "java_library") -load("//lib/jgit:jgit.bzl", "JGIT_DOC_URL") load("//lib:guava.bzl", "GUAVA_DOC_URL") +load("//lib/jgit:jgit.bzl", "JGIT_DOC_URL") load("//tools/bzl:gwt.bzl", "gwt_module") load("//tools/bzl:javadoc.bzl", "java_doc") load("//tools/bzl:junit.bzl", "junit_tests") diff --git a/tools/BUILD b/tools/BUILD index 70d3774234..1696d2bdb3 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -1,10 +1,10 @@ -load("@rules_python//python:defs.bzl", "py_binary") -load("@rules_java//java:defs.bzl", "java_package_configuration") load( "@bazel_tools//tools/jdk:default_java_toolchain.bzl", "JDK9_JVM_OPTS", "default_java_toolchain", ) +load("@rules_java//java:defs.bzl", "java_package_configuration") +load("@rules_python//python:defs.bzl", "py_binary") py_binary( name = "merge_jars", From 7ed7cbdccb7e6114b193a1bfd0c82311bb022611 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Sun, 8 Sep 2019 22:51:29 +0900 Subject: [PATCH 5/5] Format BUILD files with buildifier Using buildifier from master branch and the command: $ buildifier -r -lint fix -warnings all . Change-Id: I5560593b8d4b34f0ad3003af312ca167b2a68a50 --- gerrit-gwtui/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerrit-gwtui/BUILD b/gerrit-gwtui/BUILD index 3e68cf91fa..47a59c63b9 100644 --- a/gerrit-gwtui/BUILD +++ b/gerrit-gwtui/BUILD @@ -4,9 +4,9 @@ load( "gwt_genrule", "gwt_user_agent_permutations", ) +load("//tools/bzl:java.bzl", "java_library2") load("//tools/bzl:junit.bzl", "junit_tests") load("//tools/bzl:license.bzl", "license_test") -load("//tools/bzl:java.bzl", "java_library2") gwt_genrule()