Skip to content

Commit

Permalink
Singlejar: Windows-aware jar tool path
Browse files Browse the repository at this point in the history
See #2107

--
PiperOrigin-RevId: 149626394
MOS_MIGRATED_REVID=149626394
  • Loading branch information
laszlocsomor authored and vladmos committed Mar 9, 2017
1 parent 7a5a236 commit 561e449
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/tools/singlejar/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
# singlejar C++ implementation.
package(default_visibility = ["//src:__subpackages__"])

JAR_TOOL_PATH_COPT_TPL = "-DJAR_TOOL_PATH=\\\"external/local_jdk/bin/jar%s\\\""

JAR_TOOL_PATH_COPTS = select({
"//src:windows": [JAR_TOOL_PATH_COPT_TPL % ".exe"],
"//src:windows_msvc": [JAR_TOOL_PATH_COPT_TPL % ".exe"],
"//src:windows_msys": [JAR_TOOL_PATH_COPT_TPL % ".exe"],
"//conditions:default": [JAR_TOOL_PATH_COPT_TPL % ""],
})

filegroup(
name = "srcs",
srcs = glob(["**"]),
Expand Down Expand Up @@ -76,7 +85,7 @@ cc_test(
"input_jar_scan_entries_test.h",
"input_jar_scan_jartool_test.cc",
],
copts = ["-DJAR_TOOL_PATH=\\\"external/local_jdk/bin/jar\\\""],
copts = JAR_TOOL_PATH_COPTS,
data = [
"@local_jdk//:jar",
"@local_jdk//:jdk",
Expand Down Expand Up @@ -151,7 +160,7 @@ cc_test(
srcs = [
"output_jar_simple_test.cc",
],
copts = ["-DJAR_TOOL_PATH=\\\"external/local_jdk/bin/jar\\\""],
copts = JAR_TOOL_PATH_COPTS,
data = [
":data1",
":data2",
Expand Down

0 comments on commit 561e449

Please sign in to comment.