use of com.google.devtools.build.lib.rules.objc.BundleSupport.ExtraActoolArgs in project bazel by bazelbuild.
the class ObjcBundleLibrary method create.
@Override
public ConfiguredTarget create(RuleContext ruleContext) throws InterruptedException, RuleErrorException {
ObjcCommon common = common(ruleContext);
Bundling bundling = bundling(ruleContext, common);
XcodeProvider.Builder xcodeProviderBuilder = new XcodeProvider.Builder();
NestedSetBuilder<Artifact> filesToBuild = NestedSetBuilder.stableOrder();
new ResourceSupport(ruleContext).validateAttributes().addXcodeSettings(xcodeProviderBuilder);
if (ruleContext.hasErrors()) {
return null;
}
AppleConfiguration appleConfiguration = ruleContext.getFragment(AppleConfiguration.class);
// Platform is purposefully not validated on this BundleSupport. Multi-arch validation and
// resource de-duplication should only take place at the level of the bundling rule.
new BundleSupport(ruleContext, appleConfiguration, appleConfiguration.getMultiArchPlatform(PlatformType.IOS), bundling, new ExtraActoolArgs()).validateResources(common.getObjcProvider()).registerActions(common.getObjcProvider()).addXcodeSettings(xcodeProviderBuilder);
if (ruleContext.hasErrors()) {
return null;
}
new XcodeSupport(ruleContext).addFilesToBuild(filesToBuild).addXcodeSettings(xcodeProviderBuilder, common.getObjcProvider(), BUNDLE).addDependencies(xcodeProviderBuilder, new Attribute("bundles", Mode.TARGET)).registerActions(xcodeProviderBuilder.build());
ObjcProvider nestedBundleProvider = new ObjcProvider.Builder().add(NESTED_BUNDLE, bundling).build();
return ObjcRuleClasses.ruleConfiguredTarget(ruleContext, filesToBuild.build()).addProvider(XcodeProvider.class, xcodeProviderBuilder.build()).addProvider(ObjcProvider.class, nestedBundleProvider).build();
}
Aggregations