Add build targets for constructing the Bazel.io Jekyll tree.
This patch adds pkg_tar build targets to site/, which can be used to combine
the Jekyll files under site/ with static Bootstrap and Font Awesome resources
under third_party.
Combining the site files with the generated Build Encyclopedia and Skylark
Library documentation will be done in a future change.
--
MOS_MIGRATED_REVID=121654239
diff --git a/site/BUILD b/site/BUILD
index 3683386..2cc9736 100644
--- a/site/BUILD
+++ b/site/BUILD
@@ -1,3 +1,5 @@
+load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
+
exports_files(
["docs/bazel-user-manual.html"],
)
@@ -7,3 +9,68 @@
srcs = glob(["**"]),
visibility = ["//:__pkg__"],
)
+
+filegroup(
+ name = "jekyll-srcs",
+ srcs = glob(
+ ["**/*"],
+ exclude = [
+ "BUILD",
+ "jekyll-tree.sh",
+ "*.swp",
+ ],
+ ),
+)
+
+pkg_tar(
+ name = "jekyll-files",
+ files = [":jekyll-srcs"],
+ strip_prefix = ".",
+)
+
+pkg_tar(
+ name = "bootstrap-css",
+ files = ["//third_party/css/bootstrap:bootstrap_css"],
+ package_dir = "assets",
+ strip_prefix = "/third_party/css/bootstrap",
+)
+
+pkg_tar(
+ name = "bootstrap-images",
+ files = ["//third_party/css/bootstrap:bootstrap_images"],
+ package_dir = "assets",
+ strip_prefix = "/third_party/css/bootstrap",
+)
+
+pkg_tar(
+ name = "font-awesome-css",
+ files = ["//third_party/css/font_awesome:font_awesome_css"],
+ package_dir = "assets",
+ strip_prefix = "/third_party/css/font_awesome",
+)
+
+pkg_tar(
+ name = "font-awesome-font",
+ files = ["//third_party/css/font_awesome:font_awesome_font"],
+ package_dir = "assets",
+ strip_prefix = "/third_party/css/font_awesome",
+)
+
+pkg_tar(
+ name = "bootstrap-js",
+ files = ["//third_party/javascript/bootstrap:bootstrap_js"],
+ package_dir = "assets",
+ strip_prefix = "/third_party/javascript/bootstrap",
+)
+
+pkg_tar(
+ name = "jekyll-tree",
+ deps = [
+ ":bootstrap-css",
+ ":bootstrap-images",
+ ":bootstrap-js",
+ ":font-awesome-css",
+ ":font-awesome-font",
+ ":jekyll-files",
+ ],
+)
diff --git a/third_party/css/bootstrap/BUILD b/third_party/css/bootstrap/BUILD
index 18fc491..42c7a9d 100644
--- a/third_party/css/bootstrap/BUILD
+++ b/third_party/css/bootstrap/BUILD
@@ -9,14 +9,16 @@
filegroup(
name = "bootstrap_css",
srcs = [
- "css/boostrap.css",
- "css/boostrap.css.map",
+ "css/bootstrap.css",
+ "css/bootstrap.css.map",
"css/bootstrap.min.css",
"css/bootstrap.min.css.map",
],
+ visibility = ["//site:__pkg__"],
)
filegroup(
name = "bootstrap_images",
- srcs = glob(["glyphicons-halflings-regular.*"]),
+ srcs = glob(["fonts/glyphicons-halflings-regular.*"]),
+ visibility = ["//site:__pkg__"],
)
diff --git a/third_party/css/font_awesome/BUILD b/third_party/css/font_awesome/BUILD
index 129178c..a58e75e 100644
--- a/third_party/css/font_awesome/BUILD
+++ b/third_party/css/font_awesome/BUILD
@@ -12,9 +12,11 @@
"css/font-awesome.css",
"css/font-awesome.min.css",
],
+ visibility = ["//site:__pkg__"],
)
filegroup(
name = "font_awesome_font",
srcs = glob(["fonts/fontawesome-webfont.*"]),
+ visibility = ["//site:__pkg__"],
)
diff --git a/third_party/javascript/bootstrap/BUILD b/third_party/javascript/bootstrap/BUILD
index 7253a6f..3b2f781 100644
--- a/third_party/javascript/bootstrap/BUILD
+++ b/third_party/javascript/bootstrap/BUILD
@@ -12,4 +12,5 @@
"js/bootstrap.js",
"js/bootstrap.min.js",
],
+ visibility = ["//site:__pkg__"],
)