blob: ce62eae910bb3c4d82f1a4e00839843182973d34 [file] [log] [blame]
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +01001# Packaging
2
Philipp Wollermann4c558982017-07-27 18:01:12 +02003load(":embedded_tools.bzl", "srcsfile")
4
Lukacs Berkic4e74d12015-11-10 15:28:00 +00005md5_cmd = "set -e -o pipefail && cat $(SRCS) | sort | %s | awk '{ print $$1; }' > $@"
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +01006
7# TODO(bazel-team): find a better way to handle dylib extensions.
8filegroup(
9 name = "libunix",
10 srcs = select({
11 ":darwin": ["//src/main/native:libunix.dylib"],
Chris Parsons5d96a282015-10-29 17:14:20 +000012 ":darwin_x86_64": ["//src/main/native:libunix.dylib"],
Laszlo Csomor94091092017-07-04 05:45:40 -040013 ":windows": ["//src/main/native/windows:windows_jni.dll"],
14 ":windows_msys": ["//src/main/native/windows:windows_jni.dll"],
15 ":windows_msvc": ["//src/main/native/windows:windows_jni.dll"],
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010016 "//conditions:default": ["//src/main/native:libunix.so"],
17 }),
Kristina Chodorow38358932015-06-26 14:31:50 +000018 visibility = [
Kristina Chodorow38358932015-06-26 14:31:50 +000019 "//src/test/java:__pkg__",
Alpha Lama1a79cb2016-05-15 19:13:52 +000020 "//src/tools/remote_worker:__subpackages__",
Kristina Chodorow38358932015-06-26 14:31:50 +000021 ],
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010022)
23
Lukacs Berkieb851fe2015-10-19 10:52:31 +000024[genrule(
25 name = "install_base_key-file" + suffix,
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010026 srcs = [
Han-Wen Nienhuys27760a62015-11-30 17:27:34 +000027 "//src/main/java/com/google/devtools/build/lib:bazel/BazelServer_deploy.jar",
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010028 "//src/main/cpp:client",
29 ":libunix",
30 "//src/main/tools:build-runfiles",
31 "//src/main/tools:process-wrapper",
Philipp Wollermann278814b2016-07-15 14:41:54 +000032 "//src/main/tools:linux-sandbox",
Chris Parsons5eb86fe2016-07-21 15:24:55 +000033 "//tools/osx:xcode-locator",
Philipp Wollermann4c558982017-07-27 18:01:12 +020034 ] + embedded_tools_target,
Lukacs Berkieb851fe2015-10-19 10:52:31 +000035 outs = ["install_base_key" + suffix],
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010036 cmd = select({
37 ":darwin": md5_cmd % "/sbin/md5",
Chris Parsons5d96a282015-10-29 17:14:20 +000038 ":darwin_x86_64": md5_cmd % "/sbin/md5",
Googlerbdbf75f2015-11-17 12:50:44 +000039 ":freebsd": md5_cmd % "/sbin/md5",
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010040 "//conditions:default": md5_cmd % "md5sum",
41 }),
Philipp Wollermann4c558982017-07-27 18:01:12 +020042) for suffix, embedded_tools_target in {
Lukacs Berkieb851fe2015-10-19 10:52:31 +000043 "": [":embedded_tools"],
Philipp Wollermann95048272017-03-17 15:11:58 +000044 "_with_jdk": [":embedded_tools_with_jdk"],
Lukacs Berkieb851fe2015-10-19 10:52:31 +000045 "_notools": [],
46}.items()]
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010047
Damien Martin-Guillerezb6afdbd2015-05-27 18:29:18 +000048# Try to grab the java version from the java_toolchain.
Damien Martin-Guillerez4bf2c1a2015-10-02 09:19:18 +000049# Unfortunately, we don't have access to the javac options
50# so we cannot get it from the command-line options.
Damien Martin-Guillerezb6afdbd2015-05-27 18:29:18 +000051genquery(
52 name = "java_toolchain_content",
53 expression = "kind(java_toolchain, deps(//tools/defaults:java_toolchain))",
54 opts = ["--output=xml"],
55 scope = ["//tools/defaults:java_toolchain"],
56)
57
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010058genrule(
59 name = "java-version",
Damien Martin-Guillerezb6afdbd2015-05-27 18:29:18 +000060 srcs = [":java_toolchain_content"],
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010061 outs = ["java.version"],
Damien Martin-Guillerezb6afdbd2015-05-27 18:29:18 +000062 cmd = """
63 VERSION_LINE=$$(cat $< | grep target_version);
Dmitry Lomovcbbbf2e2016-02-17 19:31:28 +000064 JAVA_VERSION=$$(echo $${VERSION_LINE} | sed 's/.*value=\\"\\([^\\"]\\)\\".*/\\1/');
Damien Martin-Guillerezb6afdbd2015-05-27 18:29:18 +000065 if [ -z "$${JAVA_VERSION}" ]; then
Damien Martin-Guillerez9c5deb62015-09-15 07:38:26 +000066 echo "1.8" >$@ # Java 8 is the default
Damien Martin-Guillerezb6afdbd2015-05-27 18:29:18 +000067 elif [[ "$${JAVA_VERSION}" =~ ^[0-9]+$$ ]]; then
68 echo "1.$${JAVA_VERSION}" >$@ # Add 1. before 7 or 8
69 else
70 echo "$${JAVA_VERSION}" >$@
71 fi
72 """,
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010073)
74
Damien Martin-Guillereza3bad0c2016-05-03 20:47:51 +000075# Create dummy tools so we can do select to prevent building iOS target on
76# Linux.
77OSX_DUMMY_TARGETS = [
78 "src/tools/xcode/actoolwrapper/actoolwrapper",
79 "src/tools/xcode/ibtoolwrapper/ibtoolwrapper",
80 "src/tools/xcode/momcwrapper/momcwrapper",
81 "src/tools/xcode/swiftstdlibtoolwrapper/swiftstdlibtoolwrapper",
82 "src/tools/xcode/environment/environment_plist",
Damien Martin-Guillereza3bad0c2016-05-03 20:47:51 +000083 "src/objc_tools/bundlemerge/bundlemerge_deploy.jar",
84 "src/objc_tools/plmerge/plmerge_deploy.jar",
Damien Martin-Guillereza3bad0c2016-05-03 20:47:51 +000085 "src/tools/xcode/realpath/realpath",
86 "src/tools/xcode/stdredirect/StdRedirect.dylib",
87]
88
89[
90 genrule(
91 name = "dummy_darwin_tool_" + name.replace("/", "_"),
92 srcs = [],
93 outs = ["dummy_darwin_tools/" + name],
94 cmd = "touch $@",
95 )
96 for name in OSX_DUMMY_TARGETS
97]
98
Damien Martin-Guillerez3d796fe2016-01-11 10:07:57 +000099filegroup(
100 name = "darwin_tools",
101 srcs = [
102 "//src/tools/xcode/actoolwrapper:actoolwrapper",
103 "//src/tools/xcode/ibtoolwrapper:ibtoolwrapper",
104 "//src/tools/xcode/momcwrapper:momcwrapper",
Dmitry Shevchenko97ac76a2017-03-23 21:12:23 +0000105 "//src/tools/xcode/swiftstdlibtoolwrapper:swiftstdlibtoolwrapper",
Damien Martin-Guillerez3d796fe2016-01-11 10:07:57 +0000106 "//src/tools/xcode/environment:environment_plist",
Damien Martin-Guillerez3d796fe2016-01-11 10:07:57 +0000107 "//src/objc_tools/bundlemerge:bundlemerge_deploy.jar",
108 "//src/objc_tools/plmerge:plmerge_deploy.jar",
Damien Martin-Guillerez3d796fe2016-01-11 10:07:57 +0000109 "//src/tools/xcode/realpath:realpath",
Chris Parsons5eb86fe2016-07-21 15:24:55 +0000110 "//tools/osx:xcode_locator.m",
Damien Martin-Guillerez3d796fe2016-01-11 10:07:57 +0000111 ] + select({
112 ":iphonesdk": ["//src/tools/xcode/stdredirect:StdRedirect.dylib"],
Damien Martin-Guillereza3bad0c2016-05-03 20:47:51 +0000113 "//conditions:default": [":dummy_darwin_tool_src_tools_xcode_stdredirect_StdRedirect.dylib"],
Damien Martin-Guillerez3d796fe2016-01-11 10:07:57 +0000114 }),
115)
116
Damien Martin-Guillereza3bad0c2016-05-03 20:47:51 +0000117filegroup(
118 name = "dummy_darwin_tools",
119 srcs = [
120 "dummy_darwin_tool_" + name.replace("/", "_")
121 for name in OSX_DUMMY_TARGETS
122 ],
123)
124
László Csomor5f99fda2017-08-11 09:28:12 +0200125py_library(
126 name = "create_embedded_tools_lib",
127 srcs = ["create_embedded_tools_lib.py"],
László Csomor0783b9e2017-08-11 10:28:36 +0200128 visibility = ["//:__pkg__"],
László Csomor5f99fda2017-08-11 09:28:12 +0200129)
130
Philipp Wollermann4c558982017-07-27 18:01:12 +0200131py_binary(
132 name = "create_embedded_tools",
133 srcs = ["create_embedded_tools.py"],
László Csomor5f99fda2017-08-11 09:28:12 +0200134 deps = [":create_embedded_tools_lib"],
Philipp Wollermann4c558982017-07-27 18:01:12 +0200135)
136
137# TODO(philwo): Clean this up, once a Bazel that can run py_binary and sh_binary
138# in Skylark rules on Windows has been released.
139[filegroup(
140 name = "embedded_tools" + suffix + "_srcs",
Damien Martin-Guillerez12997672015-09-03 21:54:08 +0000141 srcs = [
Xin Gao33d05f62017-06-21 17:13:23 +0200142 "BUILD.tools",
Damien Martin-Guillerez04d46ab2016-04-13 19:27:56 +0000143 "//tools:embedded_tools_srcs",
Damien Martin-Guillerez068a6612016-06-29 10:25:38 +0000144 "//third_party:gpl-srcs",
Googler22ad69d2017-05-30 22:21:19 +0200145 "//third_party/java/j2objc:embedded_tools_srcs",
lberkide48d7d2017-04-20 12:38:16 +0200146 "//third_party/java/jarjar:embedded_tools_srcs",
Liam Miller-Cushon38949b82017-05-08 10:18:38 -0400147 "//third_party/java/jdk/langtools:test-srcs",
Ulf Adamsd91d0472016-05-23 07:33:22 +0000148 "//third_party/py/concurrent:srcs",
149 "//third_party/py/gflags:srcs",
Joe Finneyf1843df2017-07-19 15:27:15 +0200150 "//third_party/py/six:srcs",
Alex Humesky6d004682015-10-02 22:57:09 +0000151 "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper:srcs",
Lukacs Berki6eaaf942015-10-27 13:04:58 +0000152 "//src/tools/android/java/com/google/devtools/build/android:embedded_tools",
153 "//src/tools/android/java/com/google/devtools/build/android/idlclass:embedded_tools",
Adam Michael0b9ebfe2016-12-14 22:58:39 +0000154 "//src/tools/android/java/com/google/devtools/build/android/dexer:embedded_tools",
Lukacs Berki6eaaf942015-10-27 13:04:58 +0000155 "//src/tools/android/java/com/google/devtools/build/android/ziputils:embedded_tools",
Yun Pengc2c938a2017-07-28 10:22:57 +0200156 "//src/tools/launcher:srcs",
Xin Gao33d05f62017-06-21 17:13:23 +0200157 "//src/tools/singlejar:embedded_tools",
158 "//src/main/cpp/util:embedded_tools",
159 "//src/main/native:embedded_tools",
Damien Martin-Guillerez04d46ab2016-04-13 19:27:56 +0000160 "//src/main/protobuf:srcs",
Damien Martin-Guillerez0ad9f5e2016-04-20 13:58:08 +0000161 "//src/java_tools/buildjar:JavaBuilderDeploy",
xingao8df71b52017-04-03 15:25:18 +0000162 "//src/java_tools/buildjar:VanillaJavaBuilder_deploy.jar",
Damien Martin-Guillerez04d46ab2016-04-13 19:27:56 +0000163 "//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass:GenClass_deploy.jar",
164 "//src/java_tools/junitrunner/java/com/google/testing/junit/runner:Runner_deploy.jar",
Kush Chakraborty4baedc72017-03-08 15:30:59 +0000165 "//src/java_tools/junitrunner/java/com/google/testing/junit/runner:ExperimentalRunner_deploy.jar",
Yue Ganaf3c4122016-12-05 14:36:02 +0000166 "//src/java_tools/junitrunner/java/com/google/testing/coverage:embedded_tools",
Lukacs Berki9b1e3a22015-11-18 09:55:46 +0000167 "//third_party/ijar",
Xin Gao33d05f62017-06-21 17:13:23 +0200168 "//third_party/ijar:embedded_tools",
Yue Ganaf3c4122016-12-05 14:36:02 +0000169 "//third_party/java/jacoco:srcs",
Xin Gao33d05f62017-06-21 17:13:23 +0200170 "//third_party/zlib:embedded_tools",
Damien Martin-Guillerez3d796fe2016-01-11 10:07:57 +0000171 ] + select({
Damien Martin-Guillerez1bab6b12016-02-17 15:27:32 +0000172 ":darwin": [
173 ":darwin_tools",
174 "//third_party/ijar:zipper",
175 ],
176 ":darwin_x86_64": [
177 ":darwin_tools",
178 "//third_party/ijar:zipper",
179 ],
Damien Martin-Guillereza3bad0c2016-05-03 20:47:51 +0000180 "//conditions:default": [
181 ":dummy_darwin_tools",
182 "//third_party/ijar:zipper",
183 ],
Damien Martin-Guillerez3437d2f2016-08-03 15:40:45 +0000184 }) + select({
xingao202d5912017-06-01 19:23:29 +0200185 # TODO(bazel-team): Once https://github.com/bazelbuild/bazel/issues/2241
186 # is resolved, use cc implementation of singlejar on windows
187 ":windows": [
188 "//src/java_tools/singlejar:SingleJar_deploy.jar",
Yun Pengc2c938a2017-07-28 10:22:57 +0200189 "//src/tools/launcher:launcher",
xingao202d5912017-06-01 19:23:29 +0200190 ],
191 ":windows_msys": [
192 "//src/java_tools/singlejar:SingleJar_deploy.jar",
Yun Pengc2c938a2017-07-28 10:22:57 +0200193 "//src/tools/launcher:launcher",
xingao202d5912017-06-01 19:23:29 +0200194 ],
195 ":windows_msvc": [
196 "//src/java_tools/singlejar:SingleJar_deploy.jar",
Yun Pengc2c938a2017-07-28 10:22:57 +0200197 "//src/tools/launcher:launcher",
xingao202d5912017-06-01 19:23:29 +0200198 ],
Alois Klink69e35142017-07-24 14:37:18 +0200199 ":arm": [
200 "//src/java_tools/singlejar:SingleJar_deploy.jar",
201 ],
xingao202d5912017-06-01 19:23:29 +0200202 "//conditions:default": [
203 "//src/tools/singlejar:singlejar",
204 ],
205 }) + select({
Damien Martin-Guillerez3437d2f2016-08-03 15:40:45 +0000206 "//tools/jdk:jdk7": [],
207 "//conditions:default": [
208 "//src/java_tools/buildjar/java/com/google/devtools/build/java/turbine:turbine_deploy.jar",
209 ],
Philipp Wollermann95048272017-03-17 15:11:58 +0000210 }) + (select({
211 ":darwin": [
212 "@openjdk_macos//file",
213 ],
214 ":darwin_x86_64": [
215 "@openjdk_macos//file",
216 ],
dslomov62480282017-05-16 00:37:35 +0200217 ":windows_msys": [
Philipp Wollermann95048272017-03-17 15:11:58 +0000218 "@openjdk_win//file",
219 ],
220 ":windows_msvc": [
221 "@openjdk_win//file",
222 ],
pcloudy05c20aa2017-06-29 11:38:30 +0200223 ":windows": [
224 "@openjdk_win//file",
225 ],
Philipp Wollermann95048272017-03-17 15:11:58 +0000226 "//conditions:default": [
227 "@openjdk_linux//file",
228 ],
229 }) if (suffix == "_with_jdk") else []),
Philipp Wollermann95048272017-03-17 15:11:58 +0000230) for suffix in [
231 "",
232 "_with_jdk",
233]]
Damien Martin-Guillerez12997672015-09-03 21:54:08 +0000234
Philipp Wollermann4c558982017-07-27 18:01:12 +0200235[srcsfile(
236 name = "embedded_tools" + suffix + "_params",
237 srcs = [":embedded_tools" + suffix + "_srcs"],
238 out = "embedded_tools" + suffix + ".params",
239) for suffix in [
240 "",
241 "_with_jdk",
242]]
243
244genrule(
245 name = "embedded_tools",
246 srcs = [
247 ":embedded_tools_params",
248 ":embedded_tools_srcs",
249 ],
250 outs = ["embedded_tools.zip"],
251 cmd = "$(location :create_embedded_tools) \"$@\" $(location :embedded_tools_params)",
252 tools = [":create_embedded_tools"],
253)
254
255genrule(
256 name = "embedded_tools_with_jdk",
257 srcs = [
258 ":embedded_tools_with_jdk_params",
259 ":embedded_tools_with_jdk_srcs",
260 ],
261 outs = ["embedded_tools_with_jdk.zip"],
262 cmd = "$(location :create_embedded_tools) \"$@\" $(location :embedded_tools_with_jdk_params)",
263 tools = [":create_embedded_tools"],
264)
265
Lukacs Berkieb851fe2015-10-19 10:52:31 +0000266[genrule(
267 name = "package-zip" + suffix,
Philipp Wollermann95048272017-03-17 15:11:58 +0000268 srcs = ([":embedded_tools" + suffix + ".zip"] if embed else []) + [
Lukacs Berkieb851fe2015-10-19 10:52:31 +0000269 # The script assumes that the embedded tools zip (if exists) is the
270 # first item here, the deploy jar the second and install base key is the
271 # third
Han-Wen Nienhuys27760a62015-11-30 17:27:34 +0000272 "//src/main/java/com/google/devtools/build/lib:bazel/BazelServer_deploy.jar",
Lukacs Berkieb851fe2015-10-19 10:52:31 +0000273 "install_base_key" + suffix,
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100274 "//src/main/cpp:client",
275 ":libunix",
276 "//src/main/tools:build-runfiles",
277 "//src/main/tools:process-wrapper",
Kristina Chodorowb5ecdab2015-03-16 17:55:04 +0000278 "//src/main/tools:jdk-support",
Philipp Wollermann278814b2016-07-15 14:41:54 +0000279 "//src/main/tools:linux-sandbox",
Chris Parsons5eb86fe2016-07-21 15:24:55 +0000280 "//tools/osx:xcode-locator",
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100281 ":java-version",
282 ],
Lukacs Berkieb851fe2015-10-19 10:52:31 +0000283 outs = ["package" + suffix + ".zip"],
284 cmd = "$(location :package-bazel.sh) $@ " + ("" if embed else "''") + " $(SRCS)",
285 tools = ["package-bazel.sh"],
286) for suffix, embed in [
Damien Martin-Guillerez04d46ab2016-04-13 19:27:56 +0000287 ("", True),
288 ("_notools", False),
Philipp Wollermann95048272017-03-17 15:11:58 +0000289 ("_with_jdk", True),
Lukacs Berkieb851fe2015-10-19 10:52:31 +0000290]]
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100291
Lukacs Berkieb851fe2015-10-19 10:52:31 +0000292[genrule(
293 name = "bazel-bin" + suffix,
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100294 srcs = [
295 "//src/main/cpp:client",
Lukacs Berkieb851fe2015-10-19 10:52:31 +0000296 "package-zip" + suffix,
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100297 ],
Lukacs Berkieb851fe2015-10-19 10:52:31 +0000298 outs = ["bazel" + suffix],
Yun Peng6ffb8e42016-04-14 16:55:02 +0000299 # In msys, a file path without .exe suffix(say foo), refers to a file with .exe
300 # suffix(say foo.exe), if foo.exe exists and foo doesn't. So, on windows, we
301 # need to remove bazel.exe first, so that cat to bazel won't fail.
302 cmd = "rm -f $@; cat $(location //src/main/cpp:client) $(location :package-zip" + suffix + ") > $@ && zip -qA $@",
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100303 executable = 1,
304 output_to_bindir = 1,
Damien Martin-Guillerez5f9c6ba2015-04-09 21:10:33 +0000305 visibility = [
306 "//scripts:__pkg__", # For bash completion generation
Damien Martin-Guillerezab13f682015-07-28 08:19:32 +0000307 "//scripts/packages:__pkg__", # For installer generation
Ulf Adams9e24ebd2016-06-23 09:24:57 +0000308 "//src/java:__subpackages__", # For command line reference generation
Damien Martin-Guillerez5f9c6ba2015-04-09 21:10:33 +0000309 "//src/test:__subpackages__", # For integration tests
310 ],
Lukacs Berkieb851fe2015-10-19 10:52:31 +0000311) for suffix in [
312 "",
313 "_notools",
Philipp Wollermann95048272017-03-17 15:11:58 +0000314 "_with_jdk",
Lukacs Berkieb851fe2015-10-19 10:52:31 +0000315]]
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100316
Dmitry Lomov9d40a602016-02-15 16:15:03 +0000317# Build an executable named `bazel.exe`.
318# Works on all platforms but only makes sense on Windows.
319# Workaround for non-configurability of genrule's `outs` attribute.
320[genrule(
321 name = "bazel-bin" + suffix + ".exe",
322 srcs = [":bazel-bin" + suffix],
323 outs = ["bazel" + suffix + ".exe"],
324 cmd = "cp $(location :bazel-bin" + suffix + ") $@",
325 executable = 1,
326 output_to_bindir = 1,
327 visibility = [
328 "//scripts:__pkg__", # For bash completion generation
329 "//scripts/packages:__pkg__", # For installer generation
330 "//src/test:__subpackages__", # For integration tests
331 ],
332) for suffix in [
333 "",
334 "_notools",
Philipp Wollermann95048272017-03-17 15:11:58 +0000335 "_with_jdk",
Dmitry Lomov9d40a602016-02-15 16:15:03 +0000336]]
337
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100338config_setting(
Thiago Farina2ff5afc2017-05-12 17:16:26 +0200339 name = "linux_x86_64",
340 values = {"cpu": "k8"},
341 visibility = ["//visibility:public"],
342)
343
344config_setting(
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +0100345 name = "darwin",
346 values = {"cpu": "darwin"},
347 visibility = ["//visibility:public"],
348)
Doug Rabson709bc612015-08-25 14:12:00 +0000349
350config_setting(
Chris Parsons5d96a282015-10-29 17:14:20 +0000351 name = "darwin_x86_64",
352 values = {"cpu": "darwin_x86_64"},
353 visibility = ["//visibility:public"],
354)
355
356config_setting(
Damien Martin-Guillerez3d796fe2016-01-11 10:07:57 +0000357 name = "iphonesdk",
358 values = {"define": "IPHONE_SDK=1"},
359 visibility = ["//visibility:public"],
360)
361
362config_setting(
Doug Rabson709bc612015-08-25 14:12:00 +0000363 name = "freebsd",
364 values = {"cpu": "freebsd"},
365 visibility = ["//visibility:public"],
366)
Dmitry Lomov197fd6a2015-12-06 21:53:16 +0000367
368config_setting(
369 name = "windows",
Dmitry Lomov458ccd02016-02-02 20:30:32 +0000370 values = {"cpu": "x64_windows"},
Dmitry Lomov197fd6a2015-12-06 21:53:16 +0000371 visibility = ["//visibility:public"],
372)
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +0000373
Laszlo Csomor8896dad2016-09-28 15:02:13 +0000374config_setting(
375 name = "windows_msvc",
376 values = {"cpu": "x64_windows_msvc"},
377 visibility = ["//visibility:public"],
378)
379
Yun Pengcb8a5e22017-03-08 14:30:49 +0000380config_setting(
381 name = "windows_msys",
382 values = {"cpu": "x64_windows_msys"},
383 visibility = ["//visibility:public"],
384)
385
Alois Klink69e35142017-07-24 14:37:18 +0200386config_setting(
387 name = "arm",
388 values = {"cpu": "arm"},
389 visibility = ["//visibility:public"],
390)
391
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +0000392filegroup(
393 name = "srcs",
394 srcs = glob(["**"]) + [
395 "//src/java_tools/buildjar:srcs",
Yue Ganaf3c4122016-12-05 14:36:02 +0000396 "//src/java_tools/junitrunner/java/com/google/testing/coverage:srcs",
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +0000397 "//src/java_tools/junitrunner/java/com/google/testing/junit/junit4:srcs",
398 "//src/java_tools/junitrunner/java/com/google/testing/junit/runner:srcs",
399 "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/internal:srcs",
400 "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/junit4:srcs",
401 "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/model:srcs",
402 "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding:srcs",
403 "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/api:srcs",
404 "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/sharding/testing:srcs",
405 "//src/java_tools/junitrunner/java/com/google/testing/junit/runner/util:srcs",
Kush Chakraborty6fdef7b2017-02-10 16:46:12 +0000406 "//src/java_tools/junitrunner/javatests/com/google/testing/junit/runner:srcs",
407 "//src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed:srcs",
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +0000408 "//src/java_tools/singlejar:srcs",
409 "//src/main/cpp:srcs",
410 "//src/main/java/com/google/devtools/build/docgen:srcs",
411 "//src/main/java/com/google/devtools/build/lib:srcs",
Klaus Aehligd1f4a162016-10-25 14:51:55 +0000412 "//src/main/java/com/google/devtools/build/lib/causes:srcs",
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +0000413 "//src/main/java/com/google/devtools/build/skyframe:srcs",
414 "//src/main/java/com/google/devtools/common/options:srcs",
Damien Martin-Guillerez6aa2c272016-10-07 17:19:42 +0000415 "//src/main/java/com/google/devtools/skylark:srcs",
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +0000416 "//src/main/native:srcs",
417 "//src/main/protobuf:srcs",
418 "//src/main/tools:srcs",
419 "//src/objc_tools/bundlemerge:srcs",
420 "//src/objc_tools/plmerge:srcs",
Damien Martin-Guillerez7d265e02016-07-01 13:33:48 +0000421 "//src/test/cpp:srcs",
dmarting0010cc92017-06-27 14:57:21 +0200422 "//src/test/docker:srcs",
Googler3e830922017-03-17 17:39:00 +0000423 "//src/test/gen:srcs",
Laszlo Csomor73e971c2017-01-18 13:30:35 +0000424 "//src/test/native:srcs",
Damien Martin-Guillerez7d265e02016-07-01 13:33:48 +0000425 "//src/test/java/com/google/devtools/build/android:srcs",
426 "//src/test/java/com/google/devtools/build/docgen:srcs",
427 "//src/test/java/com/google/devtools/build/lib:srcs",
428 "//src/test/java/com/google/devtools/build/skyframe:srcs",
429 "//src/test/java/com/google/devtools/common/options:srcs",
Laszlo Csomore78ad832017-06-09 10:45:27 -0400430 "//src/test/py/bazel:srcs",
Damien Martin-Guillerez7d265e02016-07-01 13:33:48 +0000431 "//src/test/shell:srcs",
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +0000432 "//src/tools/android/java/com/google/devtools/build/android:srcs",
Yue Gan81ea54e2017-01-25 10:14:52 +0000433 "//src/tools/benchmark:srcs",
Yun Peng09dd8c02017-07-21 15:57:05 +0200434 "//src/tools/launcher:srcs",
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +0000435 "//src/tools/xcode/actoolwrapper:srcs",
436 "//src/tools/xcode/environment:srcs",
437 "//src/tools/xcode/ibtoolwrapper:srcs",
438 "//src/tools/xcode/momcwrapper:srcs",
439 "//src/tools/xcode/realpath:srcs",
Sasha Smundak06a12e52016-07-15 17:35:51 +0000440 "//src/tools/singlejar:srcs",
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +0000441 "//src/tools/xcode/stdredirect:srcs",
442 "//src/tools/xcode/swiftstdlibtoolwrapper:srcs",
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +0000443 "//src/tools/xcode-common:srcs",
Damien Martin-Guillerez7d265e02016-07-01 13:33:48 +0000444 "//src/tools/remote_worker:srcs",
Chris Parsons5eb86fe2016-07-21 15:24:55 +0000445 "//tools/osx:srcs",
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +0000446 ],
447 visibility = ["//:__pkg__"],
448)
Klaus Aehlig4ca79d42016-10-22 07:59:41 +0000449
450genrule(
451 name = "derived_java_srcs",
452 srcs = [
453 "//src/main/protobuf:dist_jars",
454 "//src/main/java/com/google/devtools/build/lib/buildeventstream/proto:dist_jars",
Jakob Buchgraber55c5a602017-06-08 23:11:21 +0200455 "@googleapis//:dist_jars",
Klaus Aehlig4ca79d42016-10-22 07:59:41 +0000456 ],
457 outs = ["derived_java_srcs.zip"],
Klaus Aehlig86c9d942017-06-30 13:41:19 +0200458 cmd = "$(location :combine_derived_java_srcs.sh) $(JAVABASE) $@ $(SRCS)",
Klaus Aehlig4ca79d42016-10-22 07:59:41 +0000459 tools = ["combine_derived_java_srcs.sh"],
460 visibility = ["//:__pkg__"],
461)