aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/build_defs/apple/test
diff options
context:
space:
mode:
authorGravatar Dmitry Shevchenko <dmishe@google.com>2016-05-26 18:12:53 +0000
committerGravatar Yue Gan <yueg@google.com>2016-05-27 08:45:19 +0000
commita3dedfc47b884ead416e3d3c91b675333d45da8e (patch)
tree449e0b9d0e0f1ad3c5ce3b6ee6ac9d120c1cfe28 /tools/build_defs/apple/test
parentb11e23c710df111169333b1b2d89744af6d751cb (diff)
Add support for importing frameworks to swift_library.
* Adds a way to read FRAMEWORK_ keys from ObjcProvider and provide outputs as -F args to the compiler * Adds a sample dynamic framework for testing RELNOTES: swift_library is now able to import framework rules such as objc_framework. -- MOS_MIGRATED_REVID=123337139
Diffstat (limited to 'tools/build_defs/apple/test')
-rw-r--r--tools/build_defs/apple/test/BUILD5
-rw-r--r--tools/build_defs/apple/test/apple_rule_test.bzl36
-rw-r--r--tools/build_defs/apple/test/testdata/BlazeFramework.framework/BlazeFrameworkbin0 -> 159296 bytes
-rw-r--r--tools/build_defs/apple/test/testdata/BlazeFramework.framework/Headers/BlazeFramework.h23
-rw-r--r--tools/build_defs/apple/test/testdata/BlazeFramework.framework/Headers/Multiplier.h19
-rw-r--r--tools/build_defs/apple/test/testdata/BlazeFramework.framework/Info.plistbin0 -> 753 bytes
-rw-r--r--tools/build_defs/apple/test/testdata/BlazeFramework.framework/Modules/module.modulemap6
-rw-r--r--tools/build_defs/apple/test/testdata/BlazeFramework.framework/README.md7
8 files changed, 96 insertions, 0 deletions
diff --git a/tools/build_defs/apple/test/BUILD b/tools/build_defs/apple/test/BUILD
new file mode 100644
index 0000000000..dbc9098fb2
--- /dev/null
+++ b/tools/build_defs/apple/test/BUILD
@@ -0,0 +1,5 @@
+filegroup(
+ name = "srcs",
+ srcs = glob(["**"]),
+ visibility = ["//src/test/shell/bazel:__pkg__"],
+)
diff --git a/tools/build_defs/apple/test/apple_rule_test.bzl b/tools/build_defs/apple/test/apple_rule_test.bzl
new file mode 100644
index 0000000000..882bbfb2c5
--- /dev/null
+++ b/tools/build_defs/apple/test/apple_rule_test.bzl
@@ -0,0 +1,36 @@
+# Copyright 2016 The Bazel Authors. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Tests for apple rules."""
+
+load(
+ "//tools/build_defs/apple:apple.bzl",
+ "swift_library",
+)
+load(
+ "//tools/build_rules:test_rules.bzl",
+ "rule_test",
+)
+
+def apple_rule_test(package):
+ """Issue simple tests on apple rules."""
+ rule_test(
+ name ="swift_lib_test",
+ generates = ["swift_lib.a", "swift_lib.swiftmodule"],
+ provides = {
+ "swift": "",
+ "objc_export": ""
+ },
+ rule = package + ":swift_lib",
+ )
diff --git a/tools/build_defs/apple/test/testdata/BlazeFramework.framework/BlazeFramework b/tools/build_defs/apple/test/testdata/BlazeFramework.framework/BlazeFramework
new file mode 100644
index 0000000000..bcdce10406
--- /dev/null
+++ b/tools/build_defs/apple/test/testdata/BlazeFramework.framework/BlazeFramework
Binary files differ
diff --git a/tools/build_defs/apple/test/testdata/BlazeFramework.framework/Headers/BlazeFramework.h b/tools/build_defs/apple/test/testdata/BlazeFramework.framework/Headers/BlazeFramework.h
new file mode 100644
index 0000000000..184d7daf4f
--- /dev/null
+++ b/tools/build_defs/apple/test/testdata/BlazeFramework.framework/Headers/BlazeFramework.h
@@ -0,0 +1,23 @@
+// Copyright 2016 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#import <UIKit/UIKit.h>
+
+//! Project version number for BlazeFramework.
+FOUNDATION_EXPORT double BlazeFrameworkVersionNumber;
+
+//! Project version string for BlazeFramework.
+FOUNDATION_EXPORT const unsigned char BlazeFrameworkVersionString[];
+
+#import "Multiplier.h"
diff --git a/tools/build_defs/apple/test/testdata/BlazeFramework.framework/Headers/Multiplier.h b/tools/build_defs/apple/test/testdata/BlazeFramework.framework/Headers/Multiplier.h
new file mode 100644
index 0000000000..4034d7a33d
--- /dev/null
+++ b/tools/build_defs/apple/test/testdata/BlazeFramework.framework/Headers/Multiplier.h
@@ -0,0 +1,19 @@
+// Copyright 2016 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#import <Foundation/Foundation.h>
+
+@interface Multiplier : NSObject
+- (NSInteger)foo;
+@end
diff --git a/tools/build_defs/apple/test/testdata/BlazeFramework.framework/Info.plist b/tools/build_defs/apple/test/testdata/BlazeFramework.framework/Info.plist
new file mode 100644
index 0000000000..b0a8d7721b
--- /dev/null
+++ b/tools/build_defs/apple/test/testdata/BlazeFramework.framework/Info.plist
Binary files differ
diff --git a/tools/build_defs/apple/test/testdata/BlazeFramework.framework/Modules/module.modulemap b/tools/build_defs/apple/test/testdata/BlazeFramework.framework/Modules/module.modulemap
new file mode 100644
index 0000000000..4f884309a9
--- /dev/null
+++ b/tools/build_defs/apple/test/testdata/BlazeFramework.framework/Modules/module.modulemap
@@ -0,0 +1,6 @@
+framework module BlazeFramework {
+ umbrella header "BlazeFramework.h"
+
+ export *
+ module * { export * }
+}
diff --git a/tools/build_defs/apple/test/testdata/BlazeFramework.framework/README.md b/tools/build_defs/apple/test/testdata/BlazeFramework.framework/README.md
new file mode 100644
index 0000000000..7e512132d0
--- /dev/null
+++ b/tools/build_defs/apple/test/testdata/BlazeFramework.framework/README.md
@@ -0,0 +1,7 @@
+A simple dynamically linked iOS framework for testing purposes. The only
+available method, `[Multiplier foo]` returns the static long `4`.
+
+Currently built for architectures: `i386, x86_64, armv7, arm64`.
+
+<!-- TODO(dmishe): Provide instructions and sources for rebuilding this
+ framework. -->