aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-05-03 20:47:51 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-05-03 21:35:19 +0000
commita3bad0cd5c68fcc0f41ce3ea0aad0d8f685096fa (patch)
treeb24bb8d1718a9f2a35a5ecc5868beb2762b1bac1
parentb3a86241367a4ff0f00651ae2d89979195ba1ae5 (diff)
Add dummy objc tools to Bazel for non-OSX target
As select statement requires to have all dependencies resolved, we need to have all tooling of objc target when doing a select if such targets are in the non selected condition. This will enable to build conditionally iOS targets only if we are on OS X. This will permit to remove one of our hack from the build.sh script of the tutorial. -- MOS_MIGRATED_REVID=121411892
-rw-r--r--src/BUILD44
1 files changed, 41 insertions, 3 deletions
diff --git a/src/BUILD b/src/BUILD
index c4fa2a7457..b31b50ab9d 100644
--- a/src/BUILD
+++ b/src/BUILD
@@ -68,6 +68,32 @@ genrule(
""",
)
+# Create dummy tools so we can do select to prevent building iOS target on
+# Linux.
+OSX_DUMMY_TARGETS = [
+ "src/tools/xcode/actoolwrapper/actoolwrapper",
+ "src/tools/xcode/ibtoolwrapper/ibtoolwrapper",
+ "src/tools/xcode/momcwrapper/momcwrapper",
+ "src/tools/xcode/swiftstdlibtoolwrapper/swiftstdlibtoolwrapper",
+ "src/tools/xcode/environment/environment_plist",
+ "src/tools/xcode/xcrunwrapper/xcrunwrapper",
+ "src/objc_tools/bundlemerge/bundlemerge_deploy.jar",
+ "src/objc_tools/plmerge/plmerge_deploy.jar",
+ "src/objc_tools/xcodegen/xcodegen_deploy.jar",
+ "src/tools/xcode/realpath/realpath",
+ "src/tools/xcode/stdredirect/StdRedirect.dylib",
+]
+
+[
+ genrule(
+ name = "dummy_darwin_tool_" + name.replace("/", "_"),
+ srcs = [],
+ outs = ["dummy_darwin_tools/" + name],
+ cmd = "touch $@",
+ )
+ for name in OSX_DUMMY_TARGETS
+]
+
filegroup(
name = "darwin_tools",
srcs = [
@@ -83,10 +109,18 @@ filegroup(
"//src/tools/xcode/realpath:realpath",
] + select({
":iphonesdk": ["//src/tools/xcode/stdredirect:StdRedirect.dylib"],
- "//conditions:default": [],
+ "//conditions:default": [":dummy_darwin_tool_src_tools_xcode_stdredirect_StdRedirect.dylib"],
}),
)
+filegroup(
+ name = "dummy_darwin_tools",
+ srcs = [
+ "dummy_darwin_tool_" + name.replace("/", "_")
+ for name in OSX_DUMMY_TARGETS
+ ],
+)
+
genrule(
name = "embedded_tools",
srcs = [
@@ -115,8 +149,12 @@ genrule(
":darwin_tools",
"//third_party/ijar:zipper",
],
- ":windows": [], # Windows specifically exclude zipper for now.
- "//conditions:default": ["//third_party/ijar:zipper"],
+ # Windows specifically exclude zipper for now.
+ ":windows": [":dummy_darwin_tools"],
+ "//conditions:default": [
+ ":dummy_darwin_tools",
+ "//third_party/ijar:zipper",
+ ],
}),
outs = ["embedded_tools.zip"],
cmd = "$(location :create_embedded_tools.sh) $@ $(SRCS)",