diff --git a/src/BUILD b/src/BUILD index e7e40a2979aa42..845dee1b7269bd 100644 --- a/src/BUILD +++ b/src/BUILD @@ -246,17 +246,32 @@ sh_binary( srcs = ["minimize_jdk.sh"], ) -genrule( +filegroup( name = "embedded_jdk_minimal", + srcs = select({ + "//src/conditions:windows": [ + ":embedded_jdk_minimal.zip", + ], + "//conditions:default": [ + ":embedded_jdk_minimal.tar.gz", + ], + }), +) + +[genrule( + name = "embedded_jdk_minimal" + suffix, srcs = [ ":embedded_jdk_vanilla", ":minimize_jdk.sh", ":jdeps_modules.golden", ], - outs = ["minimal_jdk"], + outs = ["minimal_jdk" + suffix], cmd = "$(location :minimize_jdk.sh) $(location :embedded_jdk_vanilla) $(location :jdeps_modules.golden) $(OUTS)", visibility = ["//src/test/shell/bazel:__pkg__"], -) +) for suffix in [ + ".zip", + ".tar.gz", +]] [srcsfile( name = "embedded_tools" + suffix + "_params", diff --git a/src/create_embedded_tools.py b/src/create_embedded_tools.py index 4fd049ee6fa854..1c47724e4746e5 100644 --- a/src/create_embedded_tools.py +++ b/src/create_embedded_tools.py @@ -66,6 +66,8 @@ lambda x: 'tools/objc/' + os.path.basename(x) + '.sh'), ('*external/openjdk_*/file/*.tar.gz', lambda x: 'jdk.tar.gz'), ('*external/openjdk_*/file/*.zip', lambda x: 'jdk.zip'), + ('*src/minimal_jdk.tar.gz', lambda x: 'jdk.tar.gz'), + ('*src/minimal_jdk.zip', lambda x: 'jdk.zip'), ('*', lambda x: re.sub(r'^.*bazel-out/[^/]*/bin/', '', x, count=1)), ] diff --git a/src/test/shell/integration/minimal_jdk_test.sh b/src/test/shell/integration/minimal_jdk_test.sh index 057eb013ccdcbb..93da84d4a5264e 100755 --- a/src/test/shell/integration/minimal_jdk_test.sh +++ b/src/test/shell/integration/minimal_jdk_test.sh @@ -42,13 +42,13 @@ export BAZEL_SUFFIX="_jdk_minimal" source "$(rlocation "io_bazel/src/test/shell/integration_test_setup.sh")" \ || { echo "integration_test_setup.sh not found!" >&2; exit 1; } -# Bazel's install base is < 200MB with minimal JDK and > 300MB with an all +# Bazel's install base is < 250MB with minimal JDK and > 300MB with an all # modules JDK. -function test_size_less_than_200MB() { +function test_size_less_than_250MB() { bazel info ib=$(bazel info install_base) size=$(du -s "$ib" | cut -d\ -f1) - maxsize=$((1024*200)) + maxsize=$((1024*250)) if [ $size -gt $maxsize ]; then fail "Size of install_base is $size kB, expected it to be less than $maxsize kB." fi