Merge branch 'stable-2.16' into stable-3.0

* stable-2.16:
  lib: check that nongoogle.bzl doesn't grow new dependencies
  tools/nongoogle.bzl: separate out dependencies exempt from library compliance

Change-Id: Idd5113d6ecc312a67f5390541abe5de715ec2e9b
This commit is contained in:
David Pursehouse
2019-05-12 08:38:20 +02:00
5 changed files with 43 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_LOCAL", "maven_jar")
load("//plugins:external_plugin_deps.bzl", "external_plugin_deps")
load("//tools:nongoogle.bzl", "declare_nongoogle_deps")
http_archive(
name = "bazel_skylib",
@@ -596,12 +597,7 @@ maven_jar(
sha1 = "c3dad10377f0e2242c9a4b88e9704eaf79103679",
)
# Transitive dependency of commons-compress
maven_jar(
name = "tukaani-xz",
artifact = "org.tukaani:xz:1.6",
sha1 = "05b6f921f1810bdf90e25471968f741f87168b64",
)
declare_nongoogle_deps()
LUCENE_VERS = "6.6.5"

View File

@@ -459,3 +459,9 @@ java_library(
visibility = ["//visibility:public"],
exports = ["@icu4j//jar"],
)
sh_test(
name = "nongoogle_test",
srcs = ["nongoogle_test.sh"],
data = ["//tools:nongoogle.bzl"],
)

17
lib/nongoogle_test.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
# This test ensures that new dependencies in nongoogle.bzl go through LC review.
set -eux
bzl=$(pwd)/tools/nongoogle.bzl
TMP=$(mktemp -d || mktemp -d -t /tmp/tmp.XXXXXX)
grep 'name = "[^"]*"' ${bzl} | sed 's|^[^"]*"||g;s|".*$||g' | sort > $TMP/names
cat << EOF > $TMP/want
tukaani-xz
EOF
diff -u $TMP/names $TMP/want

View File

@@ -4,6 +4,8 @@ load(
"default_java_toolchain",
)
exports_files(["nongoogle.bzl"])
py_binary(
name = "merge_jars",
srcs = ["merge_jars.py"],

16
tools/nongoogle.bzl Normal file
View File

@@ -0,0 +1,16 @@
load("//tools/bzl:maven_jar.bzl", "maven_jar")
def declare_nongoogle_deps():
"""loads dependencies that are not used at Google.
Changes to versions are exempt from library compliance review. New
dependencies must pass through library compliance review. This is
enforced by //lib:nongoogle_test.
"""
# Transitive dependency of commons-compress
maven_jar(
name = "tukaani-xz",
artifact = "org.tukaani:xz:1.6",
sha1 = "05b6f921f1810bdf90e25471968f741f87168b64",
)