diff options
author | 2016-10-10 20:06:40 +0000 | |
---|---|---|
committer | 2016-10-11 08:45:04 +0000 | |
commit | 55ac95198d0441c2c13e415cc3b89e0ddc653cb1 (patch) | |
tree | d47f9965d03193f341f2bff6a09f98bde5f9d1c0 /src | |
parent | 441bc414ba664689eb549dcc4fde0a571e07a712 (diff) |
Propagate swift_library defines attribute to parents.
* This mimics the behavior of cc_ and objc_ library rules.
--
MOS_MIGRATED_REVID=135710506
Diffstat (limited to 'src')
-rwxr-xr-x | src/test/shell/bazel/apple/bazel_apple_test.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/test/shell/bazel/apple/bazel_apple_test.sh b/src/test/shell/bazel/apple/bazel_apple_test.sh index 26342f269b..abf199bdcb 100755 --- a/src/test/shell/bazel/apple/bazel_apple_test.sh +++ b/src/test/shell/bazel/apple/bazel_apple_test.sh @@ -491,6 +491,7 @@ EOF function test_swift_defines() { rm -rf ios mkdir -p ios + touch ios/dummy.swift cat >ios/main.swift <<EOF import Foundation @@ -500,6 +501,10 @@ public class SwiftClass { #if !FLAG let x: String = 1 // Invalid statement, should throw compiler error when FLAG is not set #endif + + #if !DEP_FLAG + let x: String = 2 // Invalid statement, should throw compiler error when DEP_FLAG is not set + #endif } } EOF @@ -507,9 +512,14 @@ EOF cat >ios/BUILD <<EOF load("//tools/build_defs/apple:swift.bzl", "swift_library") +swift_library(name = "dep_lib", + srcs = ["dummy.swift"], + defines = ["DEP_FLAG"]) + swift_library(name = "swift_lib", srcs = ["main.swift"], - defines = ["FLAG"]) + defines = ["FLAG"], + deps = [":dep_lib"]) EOF bazel build --verbose_failures --ios_sdk_version=$IOS_SDK_VERSION \ |