blob: caec40a5522afa80886eaa85a868ced64a023ec6 [file] [log] [blame]
Ulf Adams3e87c622017-06-13 10:53:13 +02001# Bazel - Google's Build System
2
Damien Martin-Guillerezd019eea2015-07-24 12:40:48 +00003package(default_visibility = ["//scripts/release:__pkg__"])
4
Philipp Wollermann02401d92017-03-17 13:51:14 +00005exports_files(["LICENSE"])
6
Damien Martin-Guillerezd019eea2015-07-24 12:40:48 +00007filegroup(
Ulf Adams3e87c622017-06-13 10:53:13 +02008 name = "srcs",
9 srcs = glob(
10 ["*"],
11 exclude = [
12 "bazel-*", # convenience symlinks
13 "out", # IntelliJ with setup-intellij.sh
14 "output", # output of compile.sh
15 ".*", # mainly .git* files
16 ],
17 ) + [
18 "//examples:srcs",
19 "//scripts:srcs",
20 "//site:srcs",
21 "//src:srcs",
22 "//tools:srcs",
23 "//third_party:srcs",
Jakob Buchgraber1d182e92018-03-22 03:53:03 -070024 ] + glob([".bazelci/*"]),
Damien Martin-Guillerez0baff0f2017-08-22 17:40:37 +020025 visibility = ["//src/test/shell/bazel:__pkg__"],
Ulf Adams3e87c622017-06-13 10:53:13 +020026)
27
28filegroup(
Damien Martin-Guillerezd019eea2015-07-24 12:40:48 +000029 name = "git",
Andreas Bergmeier062da5c2017-12-01 07:30:35 -080030 srcs = glob(
31 [".git/**"],
32 exclude = [".git/**/*[*"], # gitk creates temp files with []
33 ),
Damien Martin-Guillerezd019eea2015-07-24 12:40:48 +000034)
Lukacs Berki678ba232015-09-03 13:28:55 +000035
36filegroup(
37 name = "dummy",
38 visibility = ["//visibility:public"],
39)
Han-Wen Nienhuys47182322015-10-09 17:56:52 +000040
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +000041filegroup(
Damien Martin-Guillerez9b889202016-03-03 00:35:13 +000042 name = "workspace-file",
cushonb6646232018-09-07 01:44:10 -070043 srcs = [
44 ":WORKSPACE",
45 ":distdir.bzl",
46 ],
Cal Peyser2152bc12016-04-22 17:08:59 +000047 visibility = [
John Cater214a7ae2017-08-09 17:24:53 +020048 "//src/test/shell/bazel:__subpackages__",
Cal Peyser2152bc12016-04-22 17:08:59 +000049 ],
Damien Martin-Guillerez9b889202016-03-03 00:35:13 +000050)
51
52filegroup(
Yun Penga50635d2016-07-26 13:29:03 +000053 name = "changelog-file",
54 srcs = [":CHANGELOG.md"],
55 visibility = [
John Caterb0308d42017-01-30 17:49:26 +000056 "//scripts/packages:__subpackages__",
Yun Penga50635d2016-07-26 13:29:03 +000057 ],
58)
59
60filegroup(
Jakob Buchgraber6073f1d2017-06-06 11:58:26 -040061 name = "bootstrap-derived-java-srcs",
62 srcs = glob(["derived/**/*.java"]),
63 visibility = ["//:__subpackages__"],
64)
65
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +000066load("//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
67
68pkg_tar(
69 name = "bazel-srcs",
John Cater214a7ae2017-08-09 17:24:53 +020070 srcs = [":srcs"],
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +000071 strip_prefix = ".",
72 # Public but bazel-only visibility.
73 visibility = ["//:__subpackages__"],
74)
Klaus Aehlig4ca79d42016-10-22 07:59:41 +000075
László Csomor0783b9e2017-08-11 10:28:36 +020076py_binary(
77 name = "combine_distfiles",
78 srcs = ["combine_distfiles.py"],
79 visibility = ["//visibility:private"],
80 deps = ["//src:create_embedded_tools_lib"],
81)
82
Klaus Aehlig4ca79d42016-10-22 07:59:41 +000083genrule(
84 name = "bazel-distfile",
85 srcs = [
86 ":bazel-srcs",
87 "//src:derived_java_srcs",
Shahan Yang1a4f7912017-12-19 14:50:53 -080088 "//src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec:bootstrap_autocodec.tar",
Klaus Aehlig3c9cd822018-05-24 03:35:42 -070089 "@additional_distfiles//:archives.tar",
Klaus Aehlig4ca79d42016-10-22 07:59:41 +000090 ],
91 outs = ["bazel-distfile.zip"],
László Csomor0783b9e2017-08-11 10:28:36 +020092 cmd = "$(location :combine_distfiles) $@ $(SRCS)",
93 tools = [":combine_distfiles"],
Klaus Aehlig279a0612016-11-11 09:51:44 +000094 # Public but bazel-only visibility.
95 visibility = ["//:__subpackages__"],
Klaus Aehlig4ca79d42016-10-22 07:59:41 +000096)
Klaus Aehlig52b03d12016-11-24 15:16:01 +000097
98genrule(
99 name = "bazel-distfile-tar",
100 srcs = [
101 ":bazel-srcs",
102 "//src:derived_java_srcs",
Shahan Yang1a4f7912017-12-19 14:50:53 -0800103 "//src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec:bootstrap_autocodec.tar",
Klaus Aehlig3c9cd822018-05-24 03:35:42 -0700104 "@additional_distfiles//:archives.tar",
Klaus Aehlig52b03d12016-11-24 15:16:01 +0000105 ],
106 outs = ["bazel-distfile.tar"],
László Csomor0783b9e2017-08-11 10:28:36 +0200107 cmd = "$(location :combine_distfiles_to_tar.sh) $@ $(SRCS)",
108 tools = ["combine_distfiles_to_tar.sh"],
Klaus Aehlig52b03d12016-11-24 15:16:01 +0000109 # Public but bazel-only visibility.
110 visibility = ["//:__subpackages__"],
111)
Googlercc858622017-07-25 21:03:05 +0200112
113# This is a workaround for fetching Bazel toolchains, for remote execution.
114# See https://github.com/bazelbuild/bazel/issues/3246.
115# Will be removed once toolchain fetching is supported.
116filegroup(
117 name = "dummy_toolchain_reference",
xingaobea67122018-01-16 08:29:59 -0800118 srcs = ["@bazel_toolchains//configs/debian8_clang/0.2.0/bazel_0.9.0:empty"],
Googlercc858622017-07-25 21:03:05 +0200119 visibility = ["//visibility:public"],
120)