use of com.facebook.buck.step.fs.MoveStep in project buck by facebook.
the class AppleBundle method appendDsymRenameStepToMatchBundleName.
private void appendDsymRenameStepToMatchBundleName(ImmutableList.Builder<Step> stepsBuilder, BuildableContext buildableContext, SourcePathResolver pathResolver) {
Preconditions.checkArgument(hasBinary && appleDsym.isPresent());
// rename dSYM bundle to match bundle name
Path dsymPath = pathResolver.getRelativePath(appleDsym.get().getSourcePathToOutput());
Path dsymSourcePath = bundleRoot.getParent().resolve(dsymPath.getFileName());
Path dsymDestinationPath = bundleRoot.getParent().resolve(bundleRoot.getFileName() + "." + AppleBundleExtension.DSYM.toFileExtension());
stepsBuilder.add(new RmStep(getProjectFilesystem(), dsymDestinationPath, RmStep.Mode.RECURSIVE));
stepsBuilder.add(new MoveStep(getProjectFilesystem(), dsymSourcePath, dsymDestinationPath));
String dwarfFilename = AppleDsym.getDwarfFilenameForDsymTarget(appleDsym.get().getBuildTarget());
// rename DWARF file inside dSYM bundle to match bundle name
Path dwarfFolder = dsymDestinationPath.resolve(AppleDsym.DSYM_DWARF_FILE_FOLDER);
Path dwarfSourcePath = dwarfFolder.resolve(dwarfFilename);
Path dwarfDestinationPath = dwarfFolder.resolve(MorePaths.getNameWithoutExtension(bundleRoot));
stepsBuilder.add(new MoveStep(getProjectFilesystem(), dwarfSourcePath, dwarfDestinationPath));
// record dSYM so we can fetch it from cache
buildableContext.recordArtifact(dsymDestinationPath);
}
use of com.facebook.buck.step.fs.MoveStep in project buck by facebook.
the class AppleDsym method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
buildableContext.recordArtifact(dsymOutputPath);
Path unstrippedBinaryPath = context.getSourcePathResolver().getAbsolutePath(unstrippedBinarySourcePath);
Path dwarfFileFolder = dsymOutputPath.resolve(DSYM_DWARF_FILE_FOLDER);
return ImmutableList.of(new RmStep(getProjectFilesystem(), dsymOutputPath, RmStep.Mode.RECURSIVE), new DsymStep(getProjectFilesystem(), dsymutil.getEnvironment(context.getSourcePathResolver()), dsymutil.getCommandPrefix(context.getSourcePathResolver()), unstrippedBinaryPath, dsymOutputPath), new MoveStep(getProjectFilesystem(), dwarfFileFolder.resolve(unstrippedBinaryPath.getFileName()), dwarfFileFolder.resolve(getDwarfFilenameForDsymTarget(getBuildTarget()))));
}
Aggregations