use of org.apache.beam.vendor.calcite.v1_28_0.com.google.common.collect.ImmutableList in project buck by facebook.
the class GwtBinary method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
// Create a clean directory where the .zip file will be written.
Path workingDirectory = context.getSourcePathResolver().getRelativePath(getSourcePathToOutput()).getParent();
ProjectFilesystem projectFilesystem = getProjectFilesystem();
steps.add(new MakeCleanDirectoryStep(projectFilesystem, workingDirectory));
// Write the deploy files into a separate directory so that the generated .zip is smaller.
final Path deployDirectory = workingDirectory.resolve("deploy");
steps.add(new MkdirStep(projectFilesystem, deployDirectory));
Step javaStep = new ShellStep(projectFilesystem.getRootPath()) {
@Override
public String getShortName() {
return "gwt-compile";
}
@Override
protected ImmutableList<String> getShellCommandInternal(ExecutionContext executionContext) {
ImmutableList.Builder<String> javaArgsBuilder = ImmutableList.builder();
javaArgsBuilder.add(javaRuntimeLauncher.getCommand());
javaArgsBuilder.add("-Dgwt.normalizeTimestamps=true");
javaArgsBuilder.addAll(vmArgs);
javaArgsBuilder.add("-classpath", Joiner.on(File.pathSeparator).join(Iterables.transform(getClasspathEntries(context.getSourcePathResolver()), getProjectFilesystem()::resolve)), GWT_COMPILER_CLASS, "-war", context.getSourcePathResolver().getAbsolutePath(getSourcePathToOutput()).toString(), "-style", style.name(), "-optimize", String.valueOf(optimize), "-localWorkers", String.valueOf(localWorkers), "-deploy", getProjectFilesystem().resolve(deployDirectory).toString());
if (draftCompile) {
javaArgsBuilder.add("-draftCompile");
}
if (strict) {
javaArgsBuilder.add("-strict");
}
javaArgsBuilder.addAll(experimentalArgs);
javaArgsBuilder.addAll(modules);
final ImmutableList<String> javaArgs = javaArgsBuilder.build();
return javaArgs;
}
};
steps.add(javaStep);
buildableContext.recordArtifact(context.getSourcePathResolver().getRelativePath(getSourcePathToOutput()));
return steps.build();
}
use of org.apache.beam.vendor.calcite.v1_28_0.com.google.common.collect.ImmutableList in project buck by facebook.
the class HalideCompile method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
Path outputDir = context.getSourcePathResolver().getRelativePath(getSourcePathToOutput());
buildableContext.recordArtifact(objectOutputPath(getBuildTarget(), getProjectFilesystem(), functionNameOverride));
buildableContext.recordArtifact(headerOutputPath(getBuildTarget(), getProjectFilesystem(), functionNameOverride));
ImmutableList.Builder<Step> commands = ImmutableList.builder();
ProjectFilesystem projectFilesystem = getProjectFilesystem();
commands.add(new MakeCleanDirectoryStep(projectFilesystem, outputDir));
commands.add(new HalideCompilerStep(projectFilesystem.getRootPath(), halideCompiler.getEnvironment(context.getSourcePathResolver()), halideCompiler.getCommandPrefix(context.getSourcePathResolver()), outputDir, fileOutputName(getBuildTarget(), functionNameOverride), targetPlatform, compilerInvocationFlags));
return commands.build();
}
use of org.apache.beam.vendor.calcite.v1_28_0.com.google.common.collect.ImmutableList in project buck by facebook.
the class HalideLibraryDescription method createHalideCompiler.
private CxxBinary createHalideCompiler(BuildRuleParams params, BuildRuleResolver ruleResolver, SourcePathResolver pathResolver, SourcePathRuleFinder ruleFinder, CxxPlatform cxxPlatform, ImmutableSortedSet<SourceWithFlags> halideSources, ImmutableList<String> compilerFlags, PatternMatchedCollection<ImmutableList<String>> platformCompilerFlags, ImmutableMap<CxxSource.Type, ImmutableList<String>> langCompilerFlags, ImmutableList<StringWithMacros> linkerFlags, PatternMatchedCollection<ImmutableList<StringWithMacros>> platformLinkerFlags, ImmutableList<String> includeDirs) throws NoSuchBuildTargetException {
Optional<StripStyle> flavoredStripStyle = StripStyle.FLAVOR_DOMAIN.getValue(params.getBuildTarget());
Optional<LinkerMapMode> flavoredLinkerMapMode = LinkerMapMode.FLAVOR_DOMAIN.getValue(params.getBuildTarget());
params = CxxStrip.removeStripStyleFlavorInParams(params, flavoredStripStyle);
params = LinkerMapMode.removeLinkerMapModeFlavorInParams(params, flavoredLinkerMapMode);
ImmutableMap<String, CxxSource> srcs = CxxDescriptionEnhancer.parseCxxSources(params.getBuildTarget(), ruleResolver, ruleFinder, pathResolver, cxxPlatform, halideSources, PatternMatchedCollection.of());
ImmutableList<String> preprocessorFlags = ImmutableList.of();
PatternMatchedCollection<ImmutableList<String>> platformPreprocessorFlags = PatternMatchedCollection.of();
ImmutableMap<CxxSource.Type, ImmutableList<String>> langPreprocessorFlags = ImmutableMap.of();
ImmutableSortedSet<FrameworkPath> frameworks = ImmutableSortedSet.of();
ImmutableSortedSet<FrameworkPath> libraries = ImmutableSortedSet.of();
Optional<SourcePath> prefixHeader = Optional.empty();
Optional<SourcePath> precompiledHeader = Optional.empty();
Optional<Linker.CxxRuntimeType> cxxRuntimeType = Optional.empty();
CxxLinkAndCompileRules cxxLinkAndCompileRules = CxxDescriptionEnhancer.createBuildRulesForCxxBinary(params, ruleResolver, cxxBuckConfig, cxxPlatform, srcs, /* headers */
ImmutableMap.of(), params.getDeps(), flavoredStripStyle, flavoredLinkerMapMode, Linker.LinkableDepType.STATIC, preprocessorFlags, platformPreprocessorFlags, langPreprocessorFlags, frameworks, libraries, compilerFlags, langCompilerFlags, platformCompilerFlags, prefixHeader, precompiledHeader, linkerFlags, platformLinkerFlags, cxxRuntimeType, includeDirs, Optional.empty());
params = CxxStrip.restoreStripStyleFlavorInParams(params, flavoredStripStyle);
params = LinkerMapMode.restoreLinkerMapModeFlavorInParams(params, flavoredLinkerMapMode);
CxxBinary cxxBinary = new CxxBinary(params.copyAppendingExtraDeps(cxxLinkAndCompileRules.executable.getDeps(ruleFinder)), ruleResolver, ruleFinder, cxxLinkAndCompileRules.getBinaryRule(), cxxLinkAndCompileRules.executable, ImmutableSortedSet.of(), ImmutableSortedSet.of(), params.getBuildTarget().withoutFlavors(cxxPlatforms.getFlavors()));
ruleResolver.addToIndex(cxxBinary);
return cxxBinary;
}
use of org.apache.beam.vendor.calcite.v1_28_0.com.google.common.collect.ImmutableList in project buck by facebook.
the class SuperConsoleEventBusListener method testRunFinished.
@Subscribe
public void testRunFinished(TestRunEvent.Finished finished) {
boolean set = testRunFinished.compareAndSet(null, finished);
Preconditions.checkState(set, "Test run should not finish after test run already finished");
ImmutableList.Builder<String> builder = ImmutableList.builder();
for (TestResults results : finished.getResults()) {
testFormatter.reportResult(builder, results);
}
ImmutableList<TestStatusMessage> testStatusMessages;
synchronized (testStatusMessageBuilder) {
testStatusMessages = testStatusMessageBuilder.build();
}
testFormatter.runComplete(builder, finished.getResults(), testStatusMessages);
String testOutput;
synchronized (testReportBuilder) {
testReportBuilder.addAll(builder.build());
testOutput = Joiner.on('\n').join(testReportBuilder.build());
}
// We're about to write to stdout, so make sure we render the final frame before we do.
render();
synchronized (console.getStdOut()) {
console.getStdOut().println(testOutput);
}
}
use of org.apache.beam.vendor.calcite.v1_28_0.com.google.common.collect.ImmutableList in project buck by facebook.
the class RemoteFile method getBuildSteps.
@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
ImmutableList.Builder<Step> steps = ImmutableList.builder();
Path tempFile = BuildTargets.getScratchPath(getProjectFilesystem(), getBuildTarget(), "%s/" + output.getFileName());
steps.add(new MakeCleanDirectoryStep(getProjectFilesystem(), tempFile.getParent()));
steps.add(new DownloadStep(getProjectFilesystem(), downloader, uri, sha1, tempFile));
steps.add(new MakeCleanDirectoryStep(getProjectFilesystem(), output.getParent()));
if (type == Type.EXPLODED_ZIP) {
steps.add(new MakeCleanDirectoryStep(getProjectFilesystem(), output));
steps.add(new UnzipStep(getProjectFilesystem(), tempFile, output));
} else {
steps.add(CopyStep.forFile(getProjectFilesystem(), tempFile, output));
}
if (type == Type.EXECUTABLE) {
steps.add(new MakeExecutableStep(getProjectFilesystem(), output));
}
buildableContext.recordArtifact(output);
return steps.build();
}
Aggregations