Search in sources :

Example 41 with Step

use of com.facebook.buck.step.Step in project buck by facebook.

the class Genrule method getBuildSteps.

@Override
@VisibleForTesting
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
    ImmutableList.Builder<Step> commands = ImmutableList.builder();
    // Make sure that the directory to contain the output file exists, deleting any pre-existing
    // ones. Rules get output to a directory named after the base path, so we don't want to nuke
    // the entire directory.
    commands.add(new MakeCleanDirectoryStep(getProjectFilesystem(), pathToOutDirectory));
    // Delete the old temp directory
    commands.add(new MakeCleanDirectoryStep(getProjectFilesystem(), pathToTmpDirectory));
    // Create a directory to hold all the source files.
    commands.add(new MakeCleanDirectoryStep(getProjectFilesystem(), pathToSrcDirectory));
    addSymlinkCommands(context, commands);
    // Create a shell command that corresponds to this.cmd.
    if (this.isWorkerGenrule) {
        commands.add(createWorkerShellStep(context));
    } else {
        commands.add(createGenruleStep(context));
    }
    if (MorePaths.getFileExtension(pathToOutFile).equals("zip")) {
        commands.add(new ZipScrubberStep(getProjectFilesystem(), pathToOutFile));
    }
    buildableContext.recordArtifact(pathToOutFile);
    return commands.build();
}
Also used : ImmutableList(com.google.common.collect.ImmutableList) MakeCleanDirectoryStep(com.facebook.buck.step.fs.MakeCleanDirectoryStep) Step(com.facebook.buck.step.Step) MkdirAndSymlinkFileStep(com.facebook.buck.step.fs.MkdirAndSymlinkFileStep) MakeCleanDirectoryStep(com.facebook.buck.step.fs.MakeCleanDirectoryStep) ZipScrubberStep(com.facebook.buck.zip.ZipScrubberStep) ZipScrubberStep(com.facebook.buck.zip.ZipScrubberStep) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 42 with Step

use of com.facebook.buck.step.Step in project buck by facebook.

the class WriteStringTemplateRule method getBuildSteps.

@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
    buildableContext.recordArtifact(output);
    ImmutableList.Builder<Step> steps = ImmutableList.builder();
    steps.add(new MkdirStep(getProjectFilesystem(), output.getParent()));
    steps.add(new StringTemplateStep(context.getSourcePathResolver().getAbsolutePath(template), getProjectFilesystem(), output, st -> {
        for (Map.Entry<String, String> ent : values.entrySet()) {
            st = st.add(ent.getKey(), ent.getValue());
        }
        return st;
    }));
    if (executable) {
        steps.add(new AbstractExecutionStep("chmod +x") {

            @Override
            public StepExecutionResult execute(ExecutionContext context) throws IOException {
                MoreFiles.makeExecutable(getProjectFilesystem().resolve(output));
                return StepExecutionResult.of(0, Optional.empty());
            }
        });
    }
    return steps.build();
}
Also used : ImmutableSortedSet(com.google.common.collect.ImmutableSortedSet) Step(com.facebook.buck.step.Step) ImmutableMap(com.google.common.collect.ImmutableMap) IOException(java.io.IOException) BuildTarget(com.facebook.buck.model.BuildTarget) MkdirStep(com.facebook.buck.step.fs.MkdirStep) StringTemplateStep(com.facebook.buck.step.fs.StringTemplateStep) AbstractExecutionStep(com.facebook.buck.step.AbstractExecutionStep) ExecutionContext(com.facebook.buck.step.ExecutionContext) ImmutableList(com.google.common.collect.ImmutableList) Map(java.util.Map) Suppliers(com.google.common.base.Suppliers) Optional(java.util.Optional) MoreFiles(com.facebook.buck.io.MoreFiles) StepExecutionResult(com.facebook.buck.step.StepExecutionResult) Path(java.nio.file.Path) ExecutionContext(com.facebook.buck.step.ExecutionContext) AbstractExecutionStep(com.facebook.buck.step.AbstractExecutionStep) StepExecutionResult(com.facebook.buck.step.StepExecutionResult) ImmutableList(com.google.common.collect.ImmutableList) MkdirStep(com.facebook.buck.step.fs.MkdirStep) Step(com.facebook.buck.step.Step) MkdirStep(com.facebook.buck.step.fs.MkdirStep) StringTemplateStep(com.facebook.buck.step.fs.StringTemplateStep) AbstractExecutionStep(com.facebook.buck.step.AbstractExecutionStep) IOException(java.io.IOException) StringTemplateStep(com.facebook.buck.step.fs.StringTemplateStep)

Example 43 with Step

use of com.facebook.buck.step.Step in project buck by facebook.

the class AppleBundle method getBuildSteps.

@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
    ImmutableList.Builder<Step> stepsBuilder = ImmutableList.builder();
    stepsBuilder.add(new MakeCleanDirectoryStep(getProjectFilesystem(), bundleRoot));
    Path resourcesDestinationPath = bundleRoot.resolve(this.destinations.getResourcesPath());
    if (assetCatalog.isPresent()) {
        stepsBuilder.add(new MkdirStep(getProjectFilesystem(), resourcesDestinationPath));
        Path bundleDir = assetCatalog.get().getOutputDir();
        stepsBuilder.add(CopyStep.forDirectory(getProjectFilesystem(), bundleDir, resourcesDestinationPath, CopyStep.DirectoryMode.CONTENTS_ONLY));
    }
    if (coreDataModel.isPresent()) {
        stepsBuilder.add(new MkdirStep(getProjectFilesystem(), resourcesDestinationPath));
        stepsBuilder.add(CopyStep.forDirectory(getProjectFilesystem(), context.getSourcePathResolver().getRelativePath(coreDataModel.get().getSourcePathToOutput()), resourcesDestinationPath, CopyStep.DirectoryMode.CONTENTS_ONLY));
    }
    if (sceneKitAssets.isPresent()) {
        stepsBuilder.add(new MkdirStep(getProjectFilesystem(), resourcesDestinationPath));
        stepsBuilder.add(CopyStep.forDirectory(getProjectFilesystem(), context.getSourcePathResolver().getRelativePath(sceneKitAssets.get().getSourcePathToOutput()), resourcesDestinationPath, CopyStep.DirectoryMode.CONTENTS_ONLY));
    }
    Path metadataPath = getMetadataPath();
    Path infoPlistInputPath = context.getSourcePathResolver().getAbsolutePath(infoPlist);
    Path infoPlistSubstitutionTempPath = BuildTargets.getScratchPath(getProjectFilesystem(), getBuildTarget(), "%s.plist");
    Path infoPlistOutputPath = metadataPath.resolve("Info.plist");
    stepsBuilder.add(new MkdirStep(getProjectFilesystem(), metadataPath), // TODO(bhamiltoncx): This is only appropriate for .app bundles.
    new WriteFileStep(getProjectFilesystem(), "APPLWRUN", metadataPath.resolve("PkgInfo"), /* executable */
    false), new MkdirStep(getProjectFilesystem(), infoPlistSubstitutionTempPath.getParent()), new FindAndReplaceStep(getProjectFilesystem(), infoPlistInputPath, infoPlistSubstitutionTempPath, InfoPlistSubstitution.createVariableExpansionFunction(withDefaults(infoPlistSubstitutions, ImmutableMap.of("EXECUTABLE_NAME", binaryName, "PRODUCT_NAME", binaryName)))), new PlistProcessStep(getProjectFilesystem(), infoPlistSubstitutionTempPath, assetCatalog.isPresent() ? Optional.of(assetCatalog.get().getOutputPlist()) : Optional.empty(), infoPlistOutputPath, getInfoPlistAdditionalKeys(), getInfoPlistOverrideKeys(), PlistProcessStep.OutputFormat.BINARY));
    if (hasBinary) {
        appendCopyBinarySteps(stepsBuilder, context.getSourcePathResolver());
        appendCopyDsymStep(stepsBuilder, buildableContext, context.getSourcePathResolver());
    }
    if (!Iterables.isEmpty(Iterables.concat(resources.getResourceDirs(), resources.getDirsContainingResourceDirs(), resources.getResourceFiles()))) {
        stepsBuilder.add(new MkdirStep(getProjectFilesystem(), resourcesDestinationPath));
        for (SourcePath dir : resources.getResourceDirs()) {
            stepsBuilder.add(CopyStep.forDirectory(getProjectFilesystem(), context.getSourcePathResolver().getAbsolutePath(dir), resourcesDestinationPath, CopyStep.DirectoryMode.DIRECTORY_AND_CONTENTS));
        }
        for (SourcePath dir : resources.getDirsContainingResourceDirs()) {
            stepsBuilder.add(CopyStep.forDirectory(getProjectFilesystem(), context.getSourcePathResolver().getAbsolutePath(dir), resourcesDestinationPath, CopyStep.DirectoryMode.CONTENTS_ONLY));
        }
        for (SourcePath file : resources.getResourceFiles()) {
            // TODO(shs96c): Check that this work cross-cell
            Path resolvedFilePath = context.getSourcePathResolver().getRelativePath(file);
            Path destinationPath = resourcesDestinationPath.resolve(resolvedFilePath.getFileName());
            addResourceProcessingSteps(context.getSourcePathResolver(), resolvedFilePath, destinationPath, stepsBuilder);
        }
    }
    ImmutableList.Builder<Path> codeSignOnCopyPathsBuilder = ImmutableList.builder();
    addStepsToCopyExtensionBundlesDependencies(context.getSourcePathResolver(), stepsBuilder, codeSignOnCopyPathsBuilder);
    for (SourcePath variantSourcePath : resources.getResourceVariantFiles()) {
        // TODO(shs96c): Ensure this works cross-cell, as relative path begins with "buck-out"
        Path variantFilePath = context.getSourcePathResolver().getRelativePath(variantSourcePath);
        Path variantDirectory = variantFilePath.getParent();
        if (variantDirectory == null || !variantDirectory.toString().endsWith(".lproj")) {
            throw new HumanReadableException("Variant files have to be in a directory with name ending in '.lproj', " + "but '%s' is not.", variantFilePath);
        }
        Path bundleVariantDestinationPath = resourcesDestinationPath.resolve(variantDirectory.getFileName());
        stepsBuilder.add(new MkdirStep(getProjectFilesystem(), bundleVariantDestinationPath));
        Path destinationPath = bundleVariantDestinationPath.resolve(variantFilePath.getFileName());
        addResourceProcessingSteps(context.getSourcePathResolver(), variantFilePath, destinationPath, stepsBuilder);
    }
    if (!frameworks.isEmpty()) {
        Path frameworksDestinationPath = bundleRoot.resolve(this.destinations.getFrameworksPath());
        stepsBuilder.add(new MkdirStep(getProjectFilesystem(), frameworksDestinationPath));
        for (SourcePath framework : frameworks) {
            Path srcPath = context.getSourcePathResolver().getAbsolutePath(framework);
            stepsBuilder.add(CopyStep.forDirectory(getProjectFilesystem(), srcPath, frameworksDestinationPath, CopyStep.DirectoryMode.DIRECTORY_AND_CONTENTS));
            codeSignOnCopyPathsBuilder.add(frameworksDestinationPath.resolve(srcPath.getFileName()));
        }
    }
    if (needCodeSign()) {
        Optional<Path> signingEntitlementsTempPath;
        Supplier<CodeSignIdentity> codeSignIdentitySupplier;
        if (adHocCodeSignIsSufficient()) {
            signingEntitlementsTempPath = Optional.empty();
            codeSignIdentitySupplier = () -> CodeSignIdentity.AD_HOC;
        } else {
            // Copy the .mobileprovision file if the platform requires it, and sign the executable.
            Optional<Path> entitlementsPlist = Optional.empty();
            final Path srcRoot = getProjectFilesystem().getRootPath().resolve(getBuildTarget().getBasePath());
            Optional<String> entitlementsPlistString = InfoPlistSubstitution.getVariableExpansionForPlatform(CODE_SIGN_ENTITLEMENTS, platform.getName(), withDefaults(infoPlistSubstitutions, ImmutableMap.of("SOURCE_ROOT", srcRoot.toString(), "SRCROOT", srcRoot.toString())));
            if (entitlementsPlistString.isPresent()) {
                entitlementsPlist = Optional.of(srcRoot.resolve(Paths.get(entitlementsPlistString.get())));
            }
            signingEntitlementsTempPath = Optional.of(BuildTargets.getScratchPath(getProjectFilesystem(), getBuildTarget(), "%s.xcent"));
            final Path dryRunResultPath = bundleRoot.resolve(PP_DRY_RUN_RESULT_FILE);
            final ProvisioningProfileCopyStep provisioningProfileCopyStep = new ProvisioningProfileCopyStep(getProjectFilesystem(), infoPlistOutputPath, platform, // Provisioning profile UUID -- find automatically.
            Optional.empty(), entitlementsPlist, provisioningProfileStore, resourcesDestinationPath.resolve("embedded.mobileprovision"), dryRunCodeSigning ? bundleRoot.resolve(CODE_SIGN_DRY_RUN_ENTITLEMENTS_FILE) : signingEntitlementsTempPath.get(), codeSignIdentityStore, dryRunCodeSigning ? Optional.of(dryRunResultPath) : Optional.empty());
            stepsBuilder.add(provisioningProfileCopyStep);
            codeSignIdentitySupplier = () -> {
                // Using getUnchecked here because the previous step should already throw if exception
                // occurred, and this supplier would never be evaluated.
                Optional<ProvisioningProfileMetadata> selectedProfile = Futures.getUnchecked(provisioningProfileCopyStep.getSelectedProvisioningProfileFuture());
                if (!selectedProfile.isPresent()) {
                    // This should only happen in dry-run codesign mode (since otherwise an exception
                    // would have been thrown already.)  Still, we need to return *something*.
                    Preconditions.checkState(dryRunCodeSigning);
                    return CodeSignIdentity.AD_HOC;
                }
                ImmutableSet<HashCode> fingerprints = selectedProfile.get().getDeveloperCertificateFingerprints();
                if (fingerprints.isEmpty()) {
                    // If no identities are available, use an ad-hoc identity.
                    return Iterables.getFirst(codeSignIdentityStore.getIdentities(), CodeSignIdentity.AD_HOC);
                }
                for (CodeSignIdentity identity : codeSignIdentityStore.getIdentities()) {
                    if (identity.getFingerprint().isPresent() && fingerprints.contains(identity.getFingerprint().get())) {
                        return identity;
                    }
                }
                throw new HumanReadableException("No code sign identity available for provisioning profile: %s\n" + "Profile requires an identity with one of the following SHA1 fingerprints " + "available in your keychain: \n  %s", selectedProfile.get().getProfilePath(), Joiner.on("\n  ").join(fingerprints));
            };
        }
        addSwiftStdlibStepIfNeeded(context.getSourcePathResolver(), bundleRoot.resolve(Paths.get("Frameworks")), dryRunCodeSigning ? Optional.<Supplier<CodeSignIdentity>>empty() : Optional.of(codeSignIdentitySupplier), stepsBuilder, false);
        for (Path codeSignOnCopyPath : codeSignOnCopyPathsBuilder.build()) {
            stepsBuilder.add(new CodeSignStep(getProjectFilesystem(), context.getSourcePathResolver(), codeSignOnCopyPath, Optional.empty(), codeSignIdentitySupplier, codesign, codesignAllocatePath, dryRunCodeSigning ? Optional.of(codeSignOnCopyPath.resolve(CODE_SIGN_DRY_RUN_ARGS_FILE)) : Optional.empty()));
        }
        stepsBuilder.add(new CodeSignStep(getProjectFilesystem(), context.getSourcePathResolver(), bundleRoot, signingEntitlementsTempPath, codeSignIdentitySupplier, codesign, codesignAllocatePath, dryRunCodeSigning ? Optional.of(bundleRoot.resolve(CODE_SIGN_DRY_RUN_ARGS_FILE)) : Optional.empty()));
    } else {
        addSwiftStdlibStepIfNeeded(context.getSourcePathResolver(), bundleRoot.resolve(Paths.get("Frameworks")), Optional.<Supplier<CodeSignIdentity>>empty(), stepsBuilder, false);
    }
    // Ensure the bundle directory is archived so we can fetch it later.
    buildableContext.recordArtifact(context.getSourcePathResolver().getRelativePath(getSourcePathToOutput()));
    return stepsBuilder.build();
}
Also used : Path(java.nio.file.Path) PathSourcePath(com.facebook.buck.rules.PathSourcePath) SourcePath(com.facebook.buck.rules.SourcePath) ExplicitBuildTargetSourcePath(com.facebook.buck.rules.ExplicitBuildTargetSourcePath) FindAndReplaceStep(com.facebook.buck.step.fs.FindAndReplaceStep) ImmutableList(com.google.common.collect.ImmutableList) MkdirStep(com.facebook.buck.step.fs.MkdirStep) RmStep(com.facebook.buck.step.fs.RmStep) CopyStep(com.facebook.buck.step.fs.CopyStep) MkdirStep(com.facebook.buck.step.fs.MkdirStep) WriteFileStep(com.facebook.buck.step.fs.WriteFileStep) Step(com.facebook.buck.step.Step) MakeCleanDirectoryStep(com.facebook.buck.step.fs.MakeCleanDirectoryStep) MoveStep(com.facebook.buck.step.fs.MoveStep) FindAndReplaceStep(com.facebook.buck.step.fs.FindAndReplaceStep) NSString(com.dd.plist.NSString) PathSourcePath(com.facebook.buck.rules.PathSourcePath) SourcePath(com.facebook.buck.rules.SourcePath) ExplicitBuildTargetSourcePath(com.facebook.buck.rules.ExplicitBuildTargetSourcePath) HashCode(com.google.common.hash.HashCode) HumanReadableException(com.facebook.buck.util.HumanReadableException) MakeCleanDirectoryStep(com.facebook.buck.step.fs.MakeCleanDirectoryStep) Supplier(com.google.common.base.Supplier) WriteFileStep(com.facebook.buck.step.fs.WriteFileStep)

Example 44 with Step

use of com.facebook.buck.step.Step in project buck by facebook.

the class PreDexMerge method getBuildSteps.

@Override
public ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext) {
    ImmutableList.Builder<Step> steps = ImmutableList.builder();
    steps.add(new MkdirStep(getProjectFilesystem(), primaryDexPath.getParent()));
    if (dexSplitMode.isShouldSplitDex()) {
        addStepsForSplitDex(steps, buildableContext);
    } else {
        addStepsForSingleDex(steps, buildableContext);
    }
    return steps.build();
}
Also used : ImmutableList(com.google.common.collect.ImmutableList) MkdirStep(com.facebook.buck.step.fs.MkdirStep) Step(com.facebook.buck.step.Step) MkdirStep(com.facebook.buck.step.fs.MkdirStep) AbstractExecutionStep(com.facebook.buck.step.AbstractExecutionStep) MakeCleanDirectoryStep(com.facebook.buck.step.fs.MakeCleanDirectoryStep) RecordFileSha1Step(com.facebook.buck.rules.RecordFileSha1Step)

Example 45 with Step

use of com.facebook.buck.step.Step in project buck by facebook.

the class PreDexMerge method addStepsForSplitDex.

private void addStepsForSplitDex(ImmutableList.Builder<Step> steps, BuildableContext buildableContext) {
    // Collect all of the DexWithClasses objects to use for merging.
    ImmutableMultimap.Builder<APKModule, DexWithClasses> dexFilesToMergeBuilder = ImmutableMultimap.builder();
    dexFilesToMergeBuilder.putAll(FluentIterable.from(preDexDeps.entries()).transform(input -> new AbstractMap.SimpleEntry<>(input.getKey(), DexWithClasses.TO_DEX_WITH_CLASSES.apply(input.getValue()))).filter(input -> input.getValue() != null).toSet());
    final SplitDexPaths paths = new SplitDexPaths();
    final ImmutableSet.Builder<Path> secondaryDexDirectories = ImmutableSet.builder();
    if (dexSplitMode.getDexStore() == DexStore.RAW) {
        // Raw classes*.dex files go in the top-level of the APK.
        secondaryDexDirectories.add(paths.jarfilesSubdir);
    } else {
        // Otherwise, we want to include the metadata and jars as assets.
        secondaryDexDirectories.add(paths.metadataDir);
        secondaryDexDirectories.add(paths.jarfilesDir);
    }
    //always add additional dex stores and metadata as assets
    secondaryDexDirectories.add(paths.additionalJarfilesDir);
    // Do not clear existing directory which might contain secondary dex files that are not
    // re-merged (since their contents did not change).
    steps.add(new MkdirStep(getProjectFilesystem(), paths.jarfilesSubdir));
    steps.add(new MkdirStep(getProjectFilesystem(), paths.additionalJarfilesSubdir));
    steps.add(new MkdirStep(getProjectFilesystem(), paths.successDir));
    steps.add(new MakeCleanDirectoryStep(getProjectFilesystem(), paths.metadataSubdir));
    steps.add(new MakeCleanDirectoryStep(getProjectFilesystem(), paths.scratchDir));
    buildableContext.addMetadata(SECONDARY_DEX_DIRECTORIES_KEY, secondaryDexDirectories.build().stream().map(Object::toString).collect(MoreCollectors.toImmutableList()));
    buildableContext.recordArtifact(primaryDexPath);
    buildableContext.recordArtifact(paths.jarfilesSubdir);
    buildableContext.recordArtifact(paths.metadataSubdir);
    buildableContext.recordArtifact(paths.successDir);
    buildableContext.recordArtifact(paths.additionalJarfilesSubdir);
    PreDexedFilesSorter preDexedFilesSorter = new PreDexedFilesSorter(Optional.ofNullable(DexWithClasses.TO_DEX_WITH_CLASSES.apply(dexForUberRDotJava)), dexFilesToMergeBuilder.build(), dexSplitMode.getPrimaryDexPatterns(), apkModuleGraph, paths.scratchDir, // to set the dex weight limit during pre-dex merging.
    dexSplitMode.getLinearAllocHardLimit(), dexSplitMode.getDexStore(), paths.jarfilesSubdir, paths.additionalJarfilesSubdir);
    final ImmutableMap<String, PreDexedFilesSorter.Result> sortResults = preDexedFilesSorter.sortIntoPrimaryAndSecondaryDexes(getProjectFilesystem(), steps);
    PreDexedFilesSorter.Result rootApkModuleResult = sortResults.get(APKModuleGraph.ROOT_APKMODULE_NAME);
    if (rootApkModuleResult == null) {
        throw new HumanReadableException("No classes found in primary or secondary dexes");
    }
    Multimap<Path, Path> aggregatedOutputToInputs = HashMultimap.create();
    ImmutableMap.Builder<Path, Sha1HashCode> dexInputHashesBuilder = ImmutableMap.builder();
    for (PreDexedFilesSorter.Result result : sortResults.values()) {
        if (!result.apkModule.equals(apkModuleGraph.getRootAPKModule())) {
            Path dexOutputPath = paths.additionalJarfilesSubdir.resolve(result.apkModule.getName());
            steps.add(new MkdirStep(getProjectFilesystem(), dexOutputPath));
        }
        aggregatedOutputToInputs.putAll(result.secondaryOutputToInputs);
        dexInputHashesBuilder.putAll(result.dexInputHashes);
    }
    final ImmutableMap<Path, Sha1HashCode> dexInputHashes = dexInputHashesBuilder.build();
    steps.add(new SmartDexingStep(getProjectFilesystem(), primaryDexPath, Suppliers.ofInstance(rootApkModuleResult.primaryDexInputs), Optional.of(paths.jarfilesSubdir), Optional.of(Suppliers.ofInstance(aggregatedOutputToInputs)), () -> dexInputHashes, paths.successDir, DX_MERGE_OPTIONS, dxExecutorService, xzCompressionLevel, dxMaxHeapSize));
    // Record the primary dex SHA1 so exopackage apks can use it to compute their ABI keys.
    // Single dex apks cannot be exopackages, so they will never need ABI keys.
    steps.add(new RecordFileSha1Step(getProjectFilesystem(), primaryDexPath, PRIMARY_DEX_HASH_KEY, buildableContext));
    for (PreDexedFilesSorter.Result result : sortResults.values()) {
        if (!result.apkModule.equals(apkModuleGraph.getRootAPKModule())) {
            Path dexMetadataOutputPath = paths.additionalJarfilesSubdir.resolve(result.apkModule.getName()).resolve("metadata.txt");
            addMetadataWriteStep(result, steps, dexMetadataOutputPath);
        }
    }
    addMetadataWriteStep(rootApkModuleResult, steps, paths.metadataFile);
}
Also used : Iterables(com.google.common.collect.Iterables) Step(com.facebook.buck.step.Step) SourcePath(com.facebook.buck.rules.SourcePath) Multimap(com.google.common.collect.Multimap) BuildOutput(com.facebook.buck.android.PreDexMerge.BuildOutput) MkdirStep(com.facebook.buck.step.fs.MkdirStep) AbstractExecutionStep(com.facebook.buck.step.AbstractExecutionStep) ExecutionContext(com.facebook.buck.step.ExecutionContext) HashMultimap(com.google.common.collect.HashMultimap) Lists(com.google.common.collect.Lists) ImmutableList(com.google.common.collect.ImmutableList) FluentIterable(com.google.common.collect.FluentIterable) Map(java.util.Map) Suppliers(com.google.common.base.Suppliers) BuildOutputInitializer(com.facebook.buck.rules.BuildOutputInitializer) ImmutableMultimap(com.google.common.collect.ImmutableMultimap) BuildRuleParams(com.facebook.buck.rules.BuildRuleParams) Path(java.nio.file.Path) EnumSet(java.util.EnumSet) Nullable(javax.annotation.Nullable) MoreCollectors(com.facebook.buck.util.MoreCollectors) Function(com.google.common.base.Function) ImmutableSet(com.google.common.collect.ImmutableSet) AddToRuleKey(com.facebook.buck.rules.AddToRuleKey) MakeCleanDirectoryStep(com.facebook.buck.step.fs.MakeCleanDirectoryStep) ImmutableMap(com.google.common.collect.ImmutableMap) InitializableFromDisk(com.facebook.buck.rules.InitializableFromDisk) BuildableContext(com.facebook.buck.rules.BuildableContext) IOException(java.io.IOException) HumanReadableException(com.facebook.buck.util.HumanReadableException) OnDiskBuildInfo(com.facebook.buck.rules.OnDiskBuildInfo) AbstractBuildRule(com.facebook.buck.rules.AbstractBuildRule) Objects(java.util.Objects) AbstractMap(java.util.AbstractMap) List(java.util.List) Paths(java.nio.file.Paths) RecordFileSha1Step(com.facebook.buck.rules.RecordFileSha1Step) Sha1HashCode(com.facebook.buck.util.sha1.Sha1HashCode) BuildContext(com.facebook.buck.rules.BuildContext) Optional(java.util.Optional) Preconditions(com.google.common.base.Preconditions) BuildTargets(com.facebook.buck.model.BuildTargets) StepExecutionResult(com.facebook.buck.step.StepExecutionResult) Collections(java.util.Collections) ListeningExecutorService(com.google.common.util.concurrent.ListeningExecutorService) MkdirStep(com.facebook.buck.step.fs.MkdirStep) StepExecutionResult(com.facebook.buck.step.StepExecutionResult) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMultimap(com.google.common.collect.ImmutableMultimap) RecordFileSha1Step(com.facebook.buck.rules.RecordFileSha1Step) SourcePath(com.facebook.buck.rules.SourcePath) Path(java.nio.file.Path) ImmutableMap(com.google.common.collect.ImmutableMap) HumanReadableException(com.facebook.buck.util.HumanReadableException) Sha1HashCode(com.facebook.buck.util.sha1.Sha1HashCode) MakeCleanDirectoryStep(com.facebook.buck.step.fs.MakeCleanDirectoryStep)

Aggregations

Step (com.facebook.buck.step.Step)143 ImmutableList (com.google.common.collect.ImmutableList)82 Path (java.nio.file.Path)79 SourcePath (com.facebook.buck.rules.SourcePath)65 MakeCleanDirectoryStep (com.facebook.buck.step.fs.MakeCleanDirectoryStep)62 Test (org.junit.Test)54 SourcePathResolver (com.facebook.buck.rules.SourcePathResolver)49 MkdirStep (com.facebook.buck.step.fs.MkdirStep)44 FakeBuildableContext (com.facebook.buck.rules.FakeBuildableContext)42 ExplicitBuildTargetSourcePath (com.facebook.buck.rules.ExplicitBuildTargetSourcePath)41 SourcePathRuleFinder (com.facebook.buck.rules.SourcePathRuleFinder)40 BuildTarget (com.facebook.buck.model.BuildTarget)39 DefaultTargetNodeToBuildRuleTransformer (com.facebook.buck.rules.DefaultTargetNodeToBuildRuleTransformer)36 BuildRuleResolver (com.facebook.buck.rules.BuildRuleResolver)35 ExecutionContext (com.facebook.buck.step.ExecutionContext)34 FakeProjectFilesystem (com.facebook.buck.testutil.FakeProjectFilesystem)31 ProjectFilesystem (com.facebook.buck.io.ProjectFilesystem)30 BuildContext (com.facebook.buck.rules.BuildContext)25 RmStep (com.facebook.buck.step.fs.RmStep)24 CopyStep (com.facebook.buck.step.fs.CopyStep)23