Merge branch 'stable-2.15' into stable-2.16

* stable-2.15:
  Format BUILD files with buildifier
  Format BUILD files with buildifier
  junit.bzl: Fix name conventions warning flagged by buldifier
  Bazel: Avoid using tools in action inputs
  dev-contributing: Update recommended version of buildifier to 0.28.0

Change-Id: I20579e30a97b640d23df38e2bf129fea0003c548
This commit is contained in:
David Pursehouse
2019-09-09 08:22:58 +09:00
6 changed files with 9 additions and 8 deletions

View File

@@ -171,7 +171,7 @@ To format Java source code, Gerrit uses the
link:https://github.com/google/google-java-format[`google-java-format`] 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 tool (version 1.7), and to format Bazel BUILD, WORKSPACE and .bzl files the
link:https://github.com/bazelbuild/buildtools/tree/master/buildifier[`buildifier`] 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 These tools automatically apply format according to the style guides; this
streamlines code review by reducing the need for time-consuming, tedious, streamlines code review by reducing the need for time-consuming, tedious,
and contentious discussions about trivial issues like whitespace. and contentious discussions about trivial issues like whitespace.

View File

@@ -4,9 +4,9 @@ load(
"gwt_genrule", "gwt_genrule",
"gwt_user_agent_permutations", "gwt_user_agent_permutations",
) )
load("//tools/bzl:java.bzl", "java_library2")
load("//tools/bzl:junit.bzl", "junit_tests") load("//tools/bzl:junit.bzl", "junit_tests")
load("//tools/bzl:license.bzl", "license_test") load("//tools/bzl:license.bzl", "license_test")
load("//tools/bzl:java.bzl", "java_library2")
gwt_genrule() gwt_genrule()

View File

@@ -1,6 +1,6 @@
load("@rules_java//java:defs.bzl", "java_binary", "java_library") 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:guava.bzl", "GUAVA_DOC_URL")
load("//lib/jgit:jgit.bzl", "JGIT_DOC_URL")
load("//tools/bzl:gwt.bzl", "gwt_module") load("//tools/bzl:gwt.bzl", "gwt_module")
load("//tools/bzl:javadoc.bzl", "java_doc") load("//tools/bzl:javadoc.bzl", "java_doc")

View File

@@ -1,10 +1,10 @@
load("@rules_python//python:defs.bzl", "py_binary")
load("@rules_java//java:defs.bzl", "java_package_configuration")
load( load(
"@bazel_tools//tools/jdk:default_java_toolchain.bzl", "@bazel_tools//tools/jdk:default_java_toolchain.bzl",
"JDK9_JVM_OPTS", "JDK9_JVM_OPTS",
"default_java_toolchain", "default_java_toolchain",
) )
load("@rules_java//java:defs.bzl", "java_package_configuration")
load("@rules_python//python:defs.bzl", "py_binary")
exports_files(["nongoogle.bzl"]) exports_files(["nongoogle.bzl"])

View File

@@ -130,8 +130,9 @@ def _gwt_user_agent_module(ctx):
"$p/%s cC $p/%s $(find . | sed 's|^./||')" % (ctx.executable._zip.path, gwt_user_agent_zip.path), "$p/%s cC $p/%s $(find . | sed 's|^./||')" % (ctx.executable._zip.path, gwt_user_agent_zip.path),
]) ])
ctx.actions.run_shell( ctx.actions.run_shell(
inputs = [gwt_user_agent_xml] + ctx.files._zip, inputs = [gwt_user_agent_xml],
outputs = [gwt_user_agent_zip], outputs = [gwt_user_agent_zip],
tools = ctx.files._zip,
command = cmd, command = cmd,
mnemonic = "GenerateUserAgentGWTModule", mnemonic = "GenerateUserAgentGWTModule",
) )

View File

@@ -57,7 +57,7 @@ def _impl(ctx):
ctx.attr.outname, ctx.attr.outname,
)) ))
_GenSuite = rule( _gen_suite = rule(
attrs = { attrs = {
"srcs": attr.label_list(allow_files = True), "srcs": attr.label_list(allow_files = True),
"outname": attr.string(), "outname": attr.string(),
@@ -75,7 +75,7 @@ POST_JDK8_OPTS = [
def junit_tests(name, srcs, **kwargs): def junit_tests(name, srcs, **kwargs):
s_name = name.replace("-", "_") + "TestSuite" s_name = name.replace("-", "_") + "TestSuite"
_GenSuite( _gen_suite(
name = s_name, name = s_name,
srcs = srcs, srcs = srcs,
outname = s_name, outname = s_name,