Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: fix ijar compilation from ext.repo #8742

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/test/shell/bazel/bazel_java_tools_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,36 @@ function test_java_tools_has_proguard() {
expect_path_in_java_tools "java_tools/third_party/java/proguard/GPL.html"
}

function test_java_tools_singlejar_builds() {
local java_tools_rlocation=$(rlocation io_bazel/src/java_tools_${JAVA_TOOLS_JAVA_VERSION}.zip)
local java_tools_zip_file_url="file://${java_tools_rlocation}"
if "$is_windows"; then
java_tools_zip_file_url="file:///${java_tools_rlocation}"
fi
cat >WORKSPACE <<EOF
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "local_java_tools",
urls = ["${java_tools_zip_file_url}"],
)
EOF
bazel build @local_java_tools//:singlejar_cc_bin || fail "singlejar failed to build"
}

function test_java_tools_ijar_builds() {
local java_tools_rlocation=$(rlocation io_bazel/src/java_tools_${JAVA_TOOLS_JAVA_VERSION}.zip)
local java_tools_zip_file_url="file://${java_tools_rlocation}"
if "$is_windows"; then
java_tools_zip_file_url="file:///${java_tools_rlocation}"
fi
cat >WORKSPACE <<EOF
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "local_java_tools",
urls = ["${java_tools_zip_file_url}"],
)
EOF
bazel build @local_java_tools//:ijar_cc_binary || fail "ijar failed to build"
}

run_suite "Java tools archive tests"
23 changes: 12 additions & 11 deletions tools/jdk/BUILD.java_tools
Original file line number Diff line number Diff line change
Expand Up @@ -473,16 +473,14 @@ cc_library(

cc_library(
name = "lib-file",
srcs = ["java_tools/src/main/native/windows/file.cc"],
hdrs = ["java_tools/src/main/native/windows/file.h"],
strip_include_prefix = "java_tools",
deps = [":lib-util"],
)

cc_library(
name = "lib-util",
srcs = ["java_tools/src/main/native/windows/util.cc"],
hdrs = ["java_tools/src/main/native/windows/util.h"],
srcs = [
"java_tools/src/main/native/windows/file.cc",
"java_tools/src/main/native/windows/util.cc",
],
hdrs = [
"java_tools/src/main/native/windows/file.h",
"java_tools/src/main/native/windows/util.h",
],
strip_include_prefix = "java_tools",
)

Expand Down Expand Up @@ -712,7 +710,10 @@ cc_library(
name = "token_stream",
hdrs = ["java_tools/src/tools/singlejar/token_stream.h"],
strip_include_prefix = "java_tools",
deps = [":diag"],
deps = [
":diag",
":filesystem",
],
)

filegroup(
Expand Down