Skip to content

Commit

Permalink
Add src/main/native/windows files required by ijar on Windows in the …
Browse files Browse the repository at this point in the history
…Java tools archive

Progress on #6316.

Closes #7696.

PiperOrigin-RevId: 238018531
  • Loading branch information
iirina authored and copybara-github committed Mar 12, 2019
1 parent af76859 commit 0e0ad29
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/main/cpp/util/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package_group(
],
)

load("//tools/build_defs/pkg:pkg.bzl", "pkg_tar")

cc_library(
name = "util",
hdrs = [
Expand Down Expand Up @@ -187,10 +189,30 @@ filegroup(
visibility = ["//visibility:public"],
)

# These files are embedded into the remote Java tools
# because they are needed by ijar.
# TODO(#7696): Remove this target after third_party/ changes are merged.
filegroup(
name = "embed_into_java_tools",
srcs = glob(["*.cc"]) + glob(["*.h"]),
visibility = ["//visibility:public"],
)

pkg_tar(
name = "cpp_util_with_deps_archive",
extension = "tar.gz",
mode = "755",
visibility = ["//third_party/ijar:__pkg__"],
deps = [
":cpp_util_archive",
"//src/main/native/windows:src_main_native_windows",
],
)

pkg_tar(
name = "cpp_util_archive",
srcs = glob(["*.cc"]) + glob(["*.h"]),
extension = "tar.gz",
mode = "755",
# Create a pkg_tar to preserve the directory structure src/main/cpp/util.
package_dir = "src/main/cpp/util",
visibility = ["//visibility:private"],
)
17 changes: 17 additions & 0 deletions src/main/native/windows/BUILD
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
package(default_visibility = ["//visibility:private"])

load("//tools/build_defs/pkg:pkg.bzl", "pkg_tar")

filegroup(
name = "srcs",
srcs = glob(["**"]),
visibility = ["//src/main/native:__pkg__"],
)

pkg_tar(
name = "src_main_native_windows",
srcs = [
"file.cc",
"file.h",
"util.cc",
"util.h",
],
extension = "tar.gz",
mode = "755",
# Create a pkg_tar to preserve the directory structure src/main/native/windows.
package_dir = "src/main/native/windows",
visibility = ["//src/main/cpp/util:__pkg__"],
)

filegroup(
name = "embedded_tools",
srcs = glob([
Expand Down
28 changes: 28 additions & 0 deletions third_party/ijar/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package(

licenses(["notice"]) # Apache 2.0

load("//tools/build_defs/pkg:pkg.bzl", "pkg_tar")

cc_library(
name = "zip",
srcs = [
Expand Down Expand Up @@ -98,6 +100,7 @@ filegroup(
visibility = ["//visibility:public"],
)

# TODO(#7696): Remove this target after third_party/ changes are merged.
filegroup(
name = "embed_into_java_tools",
srcs = glob(
Expand All @@ -106,3 +109,28 @@ filegroup(
),
visibility = ["//visibility:public"],
)

pkg_tar(
name = "ijar_with_deps_archive",
extension = "tar.gz",
mode = "755",
visibility = ["//third_party:__pkg__"],
deps = [
":ijar_archive",
"//src/main/cpp/util:cpp_util_with_deps_archive",
],
)

pkg_tar(
name = "ijar_archive",
srcs = glob(["**"]) + [
# Also archive the binaries.
":ijar",
":zipper",
],
extension = "tar.gz",
mode = "755",
# Create a new pkg_tar to preserve the directory structure (ijar/).
package_dir = "ijar",
visibility = ["//visibility:private"],
)

0 comments on commit 0e0ad29

Please sign in to comment.