use of com.facebook.buck.apple.xcode.xcodeproj.PBXBuildPhase in project buck by facebook.
the class ProjectGenerator method getCopyFilesBuildPhases.
private ImmutableList<PBXBuildPhase> getCopyFilesBuildPhases(Iterable<TargetNode<?, ?>> copiedNodes) {
// Bucket build rules into bins by their destinations
ImmutableSetMultimap.Builder<CopyFilePhaseDestinationSpec, TargetNode<?, ?>> ruleByDestinationSpecBuilder = ImmutableSetMultimap.builder();
for (TargetNode<?, ?> copiedNode : copiedNodes) {
Optional<CopyFilePhaseDestinationSpec> optionalDestinationSpec = getDestinationSpec(copiedNode);
if (optionalDestinationSpec.isPresent()) {
ruleByDestinationSpecBuilder.put(optionalDestinationSpec.get(), copiedNode);
}
}
ImmutableList.Builder<PBXBuildPhase> phases = ImmutableList.builder();
ImmutableSetMultimap<CopyFilePhaseDestinationSpec, TargetNode<?, ?>> ruleByDestinationSpec = ruleByDestinationSpecBuilder.build();
// Emit a copy files phase for each destination.
for (CopyFilePhaseDestinationSpec destinationSpec : ruleByDestinationSpec.keySet()) {
Iterable<TargetNode<?, ?>> targetNodes = ruleByDestinationSpec.get(destinationSpec);
phases.add(getSingleCopyFilesBuildPhase(destinationSpec, targetNodes));
}
return phases.build();
}
use of com.facebook.buck.apple.xcode.xcodeproj.PBXBuildPhase in project buck by facebook.
the class NewNativeTargetProjectMutator method addResourcesBuildPhase.
private PBXBuildPhase addResourcesBuildPhase(PBXNativeTarget target, PBXGroup targetGroup) {
ImmutableSet.Builder<Path> resourceFiles = ImmutableSet.builder();
ImmutableSet.Builder<Path> resourceDirs = ImmutableSet.builder();
ImmutableSet.Builder<Path> variantResourceFiles = ImmutableSet.builder();
collectResourcePathsFromConstructorArgs(recursiveResources, recursiveAssetCatalogs, wrapperResources, resourceFiles, resourceDirs, variantResourceFiles);
final PBXBuildPhase phase = new PBXResourcesBuildPhase();
addResourcesFileReference(targetGroup, resourceFiles.build(), resourceDirs.build(), variantResourceFiles.build(), input -> {
PBXBuildFile buildFile = new PBXBuildFile(input);
phase.getFiles().add(buildFile);
}, input -> {
PBXBuildFile buildFile = new PBXBuildFile(input);
phase.getFiles().add(buildFile);
});
if (!phase.getFiles().isEmpty()) {
target.getBuildPhases().add(phase);
LOG.debug("Added resources build phase %s", phase);
}
return phase;
}
Aggregations