use of com.facebook.buck.step.fs.SymCopyStep in project buck by facebook.
the class CxxInferAnalyze method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
buildableContext.recordArtifact(specsDir);
buildableContext.recordArtifact(context.getSourcePathResolver().getRelativePath(getSourcePathToOutput()));
return ImmutableList.<Step>builder().add(new MkdirStep(getProjectFilesystem(), specsDir)).add(new SymCopyStep(getProjectFilesystem(), captureAndAnalyzeRules.captureRules.stream().map(CxxInferCapture::getSourcePathToOutput).map(context.getSourcePathResolver()::getRelativePath).collect(MoreCollectors.toImmutableList()), resultsDir)).add(new AbstractExecutionStep("write_specs_path_list") {
@Override
public StepExecutionResult execute(ExecutionContext executionContext) throws IOException {
try {
ImmutableList<String> specsDirsWithAbsolutePath = getSpecsOfAllDeps().stream().map(input -> context.getSourcePathResolver().getAbsolutePath(input).toString()).collect(MoreCollectors.toImmutableList());
getProjectFilesystem().writeLinesToPath(specsDirsWithAbsolutePath, specsPathList);
} catch (IOException e) {
executionContext.logError(e, "Error while writing specs path list file for the analyzer");
return StepExecutionResult.ERROR;
}
return StepExecutionResult.SUCCESS;
}
}).add(new DefaultShellStep(getProjectFilesystem().getRootPath(), getAnalyzeCommand(), ImmutableMap.of())).build();
}
Aggregations