Search in sources :

Example 1 with CopyResourcesStep

use of com.facebook.buck.jvm.java.CopyResourcesStep in project buck by facebook.

the class GwtModule method getBuildSteps.

@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
    ImmutableList.Builder<Step> steps = ImmutableList.builder();
    Path workingDirectory = outputFile.getParent();
    steps.add(new MakeCleanDirectoryStep(getProjectFilesystem(), workingDirectory));
    // A CopyResourcesStep is needed so that a file that is at java/com/example/resource.txt in the
    // repository will be added as com/example/resource.txt in the resulting JAR (assuming that
    // "/java/" is listed under src_roots in .buckconfig).
    Path tempJarFolder = workingDirectory.resolve("tmp");
    steps.add(new CopyResourcesStep(getProjectFilesystem(), context.getSourcePathResolver(), ruleFinder, getBuildTarget(), filesForGwtModule, tempJarFolder, context.getJavaPackageFinder()));
    steps.add(new JarDirectoryStep(getProjectFilesystem(), outputFile, /* entriesToJar */
    ImmutableSortedSet.of(tempJarFolder), /* mainClass */
    null, /* manifestFile */
    null));
    buildableContext.recordArtifact(outputFile);
    return steps.build();
}
Also used : ExplicitBuildTargetSourcePath(com.facebook.buck.rules.ExplicitBuildTargetSourcePath) SourcePath(com.facebook.buck.rules.SourcePath) Path(java.nio.file.Path) ImmutableList(com.google.common.collect.ImmutableList) JarDirectoryStep(com.facebook.buck.jvm.java.JarDirectoryStep) CopyResourcesStep(com.facebook.buck.jvm.java.CopyResourcesStep) MakeCleanDirectoryStep(com.facebook.buck.step.fs.MakeCleanDirectoryStep) Step(com.facebook.buck.step.Step) MakeCleanDirectoryStep(com.facebook.buck.step.fs.MakeCleanDirectoryStep) JarDirectoryStep(com.facebook.buck.jvm.java.JarDirectoryStep) CopyResourcesStep(com.facebook.buck.jvm.java.CopyResourcesStep)

Aggregations

CopyResourcesStep (com.facebook.buck.jvm.java.CopyResourcesStep)1 JarDirectoryStep (com.facebook.buck.jvm.java.JarDirectoryStep)1 ExplicitBuildTargetSourcePath (com.facebook.buck.rules.ExplicitBuildTargetSourcePath)1 SourcePath (com.facebook.buck.rules.SourcePath)1 Step (com.facebook.buck.step.Step)1 MakeCleanDirectoryStep (com.facebook.buck.step.fs.MakeCleanDirectoryStep)1 ImmutableList (com.google.common.collect.ImmutableList)1 Path (java.nio.file.Path)1