/** * Adds any files to the given nested set builder that should be built if this application is the * top level target in a blaze invocation. * * @return this application support * @throws InterruptedException */ ReleaseBundlingSupport addFilesToBuild(NestedSetBuilder<Artifact> filesToBuild) throws InterruptedException { NestedSetBuilder<Artifact> debugSymbolBuilder = NestedSetBuilder.<Artifact>stableOrder() .addTransitive(objcProvider.get(ObjcProvider.DEBUG_SYMBOLS)); for (Artifact breakpadFile : getBreakpadFiles().values()) { filesToBuild.add(breakpadFile); } if (linkedBinary == LinkedBinary.LOCAL_AND_DEPENDENCIES && ObjcRuleClasses.objcConfiguration(ruleContext).generateDebugSymbols()) { IntermediateArtifacts intermediateArtifacts = ObjcRuleClasses.intermediateArtifacts(ruleContext); debugSymbolBuilder .add(intermediateArtifacts.dsymPlist()) .add(intermediateArtifacts.dsymSymbol()) .add(intermediateArtifacts.breakpadSym()); } filesToBuild .add(ruleContext.getImplicitOutputArtifact(ReleaseBundlingSupport.IPA)) // TODO(bazel-team): Fat binaries may require some merging of these file rather than just // making them available. .addTransitive(debugSymbolBuilder.build()); return this; }
NestedSet<? extends Artifact> dependentLinkedBinaries() { if (ruleContext.attributes().getAttributeDefinition("binary") == null) { return NestedSetBuilder.emptySet(Order.STABLE_ORDER); } NestedSetBuilder<Artifact> linkedBinaries = NestedSetBuilder.stableOrder(); for (ObjcProvider provider : ruleContext.getPrerequisites("binary", Mode.DONT_CHECK, ObjcProvider.class)) { linkedBinaries.addTransitive(provider.get(ObjcProvider.LINKED_BINARY)); } return linkedBinaries.build(); }
ImmutableMap<String, Artifact> cpuSpecificBreakpadFiles() { ImmutableMap.Builder<String, Artifact> results = ImmutableMap.builder(); if (ruleContext.attributes().has("binary", BuildType.LABEL)) { for (TransitiveInfoCollection prerequisite : ruleContext.getPrerequisites("binary", Mode.DONT_CHECK)) { ObjcProvider prerequisiteProvider = prerequisite.getProvider(ObjcProvider.class); if (prerequisiteProvider != null) { Artifact sourceBreakpad = Iterables.getOnlyElement( prerequisiteProvider.get(ObjcProvider.BREAKPAD_FILE), null); if (sourceBreakpad != null) { String cpu = prerequisite.getConfiguration().getFragment(ObjcConfiguration.class).getIosCpu(); results.put(cpu, sourceBreakpad); } } } } return results.build(); }