use of com.facebook.buck.apple.xcode.xcodeproj.CopyFilePhaseDestinationSpec 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();
}
Aggregations