Skip to content

Commit

Permalink
Fix name of the minimal JDK in the embedded_tools.
Browse files Browse the repository at this point in the history
One more step of #6314

RELNOTES: None
PiperOrigin-RevId: 226320059
  • Loading branch information
meisterT authored and Copybara-Service committed Dec 20, 2018
1 parent 060441f commit 683922c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
21 changes: 18 additions & 3 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/create_embedded_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
]

Expand Down
6 changes: 3 additions & 3 deletions src/test/shell/integration/minimal_jdk_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 683922c

Please sign in to comment.