aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar cparsons <cparsons@google.com>2018-01-04 11:33:25 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-01-04 11:35:16 -0800
commit260756dcd176ce1e9a90454458eddf20ce4e664f (patch)
tree3b225ffc4739c8604a73fe47bf09c443c188fad4 /src/main/java/com/google/devtools
parenteb6d2a1ef2dc15931b238db52397ab04df9a4fe3 (diff)
Propagate deps' objc providers with AppleLoadableBundle
This change allows turndown of top-level ObjcProvider propagation by apple_binary via --noexperimental_objc_provider_from_linked. ios test bundle rules depend on loadable bundle apple_binary, and require the binary's deps' objc providers -- thus this is the only mechanism to propagate these providers. RELNOTES: None. PiperOrigin-RevId: 180824037
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/AppleBinary.java2
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/AppleLoadableBundleBinaryProvider.java18
2 files changed, 16 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleBinary.java b/src/main/java/com/google/devtools/build/lib/rules/objc/AppleBinary.java
index cc535addd7..cf2fc9109d 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleBinary.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/AppleBinary.java
@@ -180,7 +180,7 @@ public class AppleBinary implements RuleConfiguredTargetFactory {
break;
case LOADABLE_BUNDLE:
targetBuilder.addNativeDeclaredProvider(
- new AppleLoadableBundleBinaryProvider(outputArtifact));
+ new AppleLoadableBundleBinaryProvider(outputArtifact, objcProvider));
break;
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleLoadableBundleBinaryProvider.java b/src/main/java/com/google/devtools/build/lib/rules/objc/AppleLoadableBundleBinaryProvider.java
index c8da97c496..b48bca8f1a 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleLoadableBundleBinaryProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/AppleLoadableBundleBinaryProvider.java
@@ -38,15 +38,19 @@ public final class AppleLoadableBundleBinaryProvider extends NativeInfo {
AppleLoadableBundleBinaryProvider.class, SKYLARK_NAME) {};
private final Artifact appleLoadableBundleBinary;
+ private final ObjcProvider depsObjcProvider;
/**
* Creates a new AppleLoadableBundleBinaryProvider provider that propagates the given apple_binary
* configured as a loadable bundle binary.
*/
- public AppleLoadableBundleBinaryProvider(Artifact appleLoadableBundleBinary) {
- super(SKYLARK_CONSTRUCTOR,
- ImmutableMap.<String, Object>of("binary", appleLoadableBundleBinary));
+ public AppleLoadableBundleBinaryProvider(Artifact appleLoadableBundleBinary,
+ ObjcProvider depsObjcProvider) {
+ super(SKYLARK_CONSTRUCTOR, ImmutableMap.<String, Object>of(
+ "binary", appleLoadableBundleBinary,
+ "objc", depsObjcProvider));
this.appleLoadableBundleBinary = appleLoadableBundleBinary;
+ this.depsObjcProvider = depsObjcProvider;
}
/**
@@ -55,4 +59,12 @@ public final class AppleLoadableBundleBinaryProvider extends NativeInfo {
public Artifact getAppleLoadableBundleBinary() {
return appleLoadableBundleBinary;
}
+
+ /**
+ * Returns the {@link ObjcProvider} which contains information about the transitive dependencies
+ * linked into the dylib.
+ */
+ public ObjcProvider getDepsObjcProvider() {
+ return depsObjcProvider;
+ }
}