diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibrary.java | 14 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibraryRule.java | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibrary.java index f4e8652fe4..a5aef38a14 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibrary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibrary.java @@ -14,6 +14,8 @@ package com.google.devtools.build.lib.rules.objc; +import static com.google.devtools.build.lib.rules.objc.XcodeProductType.LIBRARY_STATIC; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; @@ -203,8 +205,20 @@ public class ExperimentalObjcLibrary implements RuleConfiguredTargetFactory { NestedSetBuilder<Artifact> filesToBuild = NestedSetBuilder.<Artifact>stableOrder().addAll(common.getCompiledArchive().asSet()); + XcodeProvider.Builder xcodeProviderBuilder = new XcodeProvider.Builder(); + compilationSupport.addXcodeSettings(xcodeProviderBuilder, common); + new XcodeSupport(ruleContext) + .addFilesToBuild(filesToBuild) + .addXcodeSettings(xcodeProviderBuilder, common.getObjcProvider(), LIBRARY_STATIC) + .addDependencies(xcodeProviderBuilder, new Attribute("bundles", Mode.TARGET)) + .addDependencies(xcodeProviderBuilder, new Attribute("deps", Mode.TARGET)) + .addNonPropagatedDependencies( + xcodeProviderBuilder, new Attribute("non_propagated_deps", Mode.TARGET)) + .registerActions(xcodeProviderBuilder.build()); + return ObjcRuleClasses.ruleConfiguredTarget(ruleContext, filesToBuild.build()) .addProviders(info.getProviders()) + .addProvider(XcodeProvider.class, xcodeProviderBuilder.build()) .build(); } diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibraryRule.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibraryRule.java index 9f4ae215f8..42959fc43e 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibraryRule.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ExperimentalObjcLibraryRule.java @@ -17,6 +17,7 @@ package com.google.devtools.build.lib.rules.objc; import com.google.devtools.build.lib.analysis.BaseRuleClasses; import com.google.devtools.build.lib.analysis.RuleDefinition; import com.google.devtools.build.lib.analysis.RuleDefinitionEnvironment; +import com.google.devtools.build.lib.packages.ImplicitOutputsFunction; import com.google.devtools.build.lib.packages.RuleClass; import com.google.devtools.build.lib.packages.RuleClass.Builder; import com.google.devtools.build.lib.rules.apple.AppleConfiguration; @@ -31,6 +32,7 @@ public class ExperimentalObjcLibraryRule implements RuleDefinition { return builder .requiresConfigurationFragments( ObjcConfiguration.class, AppleConfiguration.class, CppConfiguration.class) + .setImplicitOutputsFunction(ImplicitOutputsFunction.fromFunctions(XcodeSupport.PBXPROJ)) .build(); } @@ -43,6 +45,7 @@ public class ExperimentalObjcLibraryRule implements RuleDefinition { BaseRuleClasses.BaseRule.class, ObjcRuleClasses.LinkingRule.class, ObjcRuleClasses.AlwaysLinkRule.class, + ObjcRuleClasses.XcodegenRule.class, ObjcRuleClasses.CrosstoolRule.class) .build(); } |