Search in sources :

Example 16 with ImmutableSet

use of com.google.common.collect.ImmutableSet in project buck by facebook.

the class Watchman method build.

@VisibleForTesting
@SuppressWarnings("PMD.PrematureDeclaration")
static Watchman build(ListeningProcessExecutor executor, Function<Path, Optional<WatchmanClient>> watchmanConnector, ImmutableSet<Path> projectWatchList, ImmutableMap<String, String> env, ExecutableFinder exeFinder, Console console, Clock clock, Optional<Long> commandTimeoutMillis) throws InterruptedException {
    LOG.info("Creating for: " + projectWatchList);
    Optional<WatchmanClient> watchmanClient = Optional.empty();
    try {
        Path watchmanPath = exeFinder.getExecutable(WATCHMAN, env).toAbsolutePath();
        Optional<? extends Map<String, ?>> result;
        long timeoutMillis = commandTimeoutMillis.orElse(DEFAULT_COMMAND_TIMEOUT_MILLIS);
        long endTimeNanos = clock.nanoTime() + TimeUnit.MILLISECONDS.toNanos(timeoutMillis);
        result = execute(executor, console, clock, timeoutMillis, TimeUnit.MILLISECONDS.toNanos(timeoutMillis), watchmanPath, "get-sockname");
        if (!result.isPresent()) {
            return NULL_WATCHMAN;
        }
        String rawSockname = (String) result.get().get("sockname");
        if (rawSockname == null) {
            return NULL_WATCHMAN;
        }
        Path socketPath = Paths.get(rawSockname);
        LOG.info("Connecting to Watchman version %s at %s", result.get().get("version"), socketPath);
        watchmanClient = watchmanConnector.apply(socketPath);
        if (!watchmanClient.isPresent()) {
            LOG.warn("Could not connect to Watchman, disabling.");
            return NULL_WATCHMAN;
        }
        LOG.debug("Connected to Watchman");
        long versionQueryStartTimeNanos = clock.nanoTime();
        result = watchmanClient.get().queryWithTimeout(endTimeNanos - versionQueryStartTimeNanos, "version", ImmutableMap.of("required", REQUIRED_CAPABILITIES, "optional", ALL_CAPABILITIES.keySet()));
        LOG.info("Took %d ms to query capabilities %s", TimeUnit.NANOSECONDS.toMillis(clock.nanoTime() - versionQueryStartTimeNanos), ALL_CAPABILITIES);
        if (!result.isPresent()) {
            LOG.warn("Could not get version response from Watchman, disabling Watchman");
            watchmanClient.get().close();
            return NULL_WATCHMAN;
        }
        ImmutableSet.Builder<Capability> capabilitiesBuilder = ImmutableSet.builder();
        if (!extractCapabilities(result.get(), capabilitiesBuilder)) {
            LOG.warn("Could not extract capabilities, disabling Watchman");
            watchmanClient.get().close();
            return NULL_WATCHMAN;
        }
        ImmutableSet<Capability> capabilities = capabilitiesBuilder.build();
        LOG.debug("Got Watchman capabilities: %s", capabilities);
        ImmutableMap.Builder<Path, ProjectWatch> projectWatchesBuilder = ImmutableMap.builder();
        ImmutableMap.Builder<Path, String> clockIdsBuilder = ImmutableMap.builder();
        for (Path rootPath : projectWatchList) {
            Optional<ProjectWatch> projectWatch = queryWatchProject(watchmanClient.get(), rootPath, clock, endTimeNanos - clock.nanoTime());
            if (!projectWatch.isPresent()) {
                watchmanClient.get().close();
                return NULL_WATCHMAN;
            }
            projectWatchesBuilder.put(rootPath, projectWatch.get());
            Optional<String> clockId = queryClock(watchmanClient.get(), projectWatch.get().getWatchRoot(), capabilities, clock, endTimeNanos - clock.nanoTime());
            if (clockId.isPresent()) {
                clockIdsBuilder.put(rootPath, clockId.get());
            }
        }
        return new Watchman(projectWatchesBuilder.build(), capabilities, clockIdsBuilder.build(), Optional.of(socketPath), watchmanClient);
    } catch (ClassCastException | HumanReadableException | IOException e) {
        LOG.warn(e, "Unable to determine the version of watchman. Going without.");
        if (watchmanClient.isPresent()) {
            try {
                watchmanClient.get().close();
            } catch (IOException ioe) {
                LOG.warn(ioe, "Could not close watchman query client");
            }
        }
        return NULL_WATCHMAN;
    }
}
Also used : Path(java.nio.file.Path) IOException(java.io.IOException) ImmutableMap(com.google.common.collect.ImmutableMap) ImmutableSet(com.google.common.collect.ImmutableSet) HumanReadableException(com.facebook.buck.util.HumanReadableException) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 17 with ImmutableSet

use of com.google.common.collect.ImmutableSet in project buck by facebook.

the class ProjectFilesystem method extractIgnorePaths.

private static ImmutableSet<PathOrGlobMatcher> extractIgnorePaths(final Path root, Config config, final BuckPaths buckPaths) {
    ImmutableSet.Builder<PathOrGlobMatcher> builder = ImmutableSet.builder();
    builder.add(new PathOrGlobMatcher(root, ".idea"));
    final String projectKey = "project";
    final String ignoreKey = "ignore";
    String buckdDirProperty = System.getProperty(BUCK_BUCKD_DIR_KEY, ".buckd");
    if (!Strings.isNullOrEmpty(buckdDirProperty)) {
        builder.add(new PathOrGlobMatcher(root, buckdDirProperty));
    }
    Path cacheDir = getCacheDir(root, config.getValue("cache", "dir"), buckPaths);
    builder.add(new PathOrGlobMatcher(cacheDir));
    builder.addAll(FluentIterable.from(config.getListWithoutComments(projectKey, ignoreKey)).transform(new Function<String, PathOrGlobMatcher>() {

        @Nullable
        @Override
        public PathOrGlobMatcher apply(String input) {
            // walks, so return null
            if (buckPaths.getBuckOut().toString().equals(input)) {
                //root.getFileSystem().getPathMatcher("glob:**");
                return null;
            }
            if (GLOB_CHARS.matcher(input).find()) {
                return new PathOrGlobMatcher(root.getFileSystem().getPathMatcher("glob:" + input), input);
            }
            return new PathOrGlobMatcher(root, input);
        }
    }).filter(Objects::nonNull).toList());
    return builder.build();
}
Also used : Path(java.nio.file.Path) Function(com.google.common.base.Function) ImmutableSet(com.google.common.collect.ImmutableSet) Objects(java.util.Objects)

Example 18 with ImmutableSet

use of com.google.common.collect.ImmutableSet in project buck by facebook.

the class LuaBinaryDescription method getPackageComponentsFromDeps.

private LuaBinaryPackageComponents getPackageComponentsFromDeps(BuildRuleParams baseParams, BuildRuleResolver ruleResolver, SourcePathResolver pathResolver, SourcePathRuleFinder ruleFinder, final CxxPlatform cxxPlatform, final PythonPlatform pythonPlatform, Optional<BuildTarget> nativeStarterLibrary, String mainModule, LuaConfig.PackageStyle packageStyle, Iterable<BuildRule> deps) throws NoSuchBuildTargetException {
    final LuaPackageComponents.Builder builder = LuaPackageComponents.builder();
    final OmnibusRoots.Builder omnibusRoots = OmnibusRoots.builder(cxxPlatform, ImmutableSet.of());
    final Map<BuildTarget, NativeLinkable> nativeLinkableRoots = new LinkedHashMap<>();
    final Map<BuildTarget, CxxLuaExtension> luaExtensions = new LinkedHashMap<>();
    final Map<BuildTarget, CxxPythonExtension> pythonExtensions = new LinkedHashMap<>();
    // Walk the deps to find all Lua packageables and native linkables.
    new AbstractBreadthFirstThrowingTraversal<BuildRule, NoSuchBuildTargetException>(deps) {

        private final ImmutableSet<BuildRule> empty = ImmutableSet.of();

        @Override
        public ImmutableSet<BuildRule> visit(BuildRule rule) throws NoSuchBuildTargetException {
            ImmutableSet<BuildRule> deps = empty;
            if (rule instanceof LuaPackageable) {
                LuaPackageable packageable = (LuaPackageable) rule;
                LuaPackageComponents components = packageable.getLuaPackageComponents();
                LuaPackageComponents.addComponents(builder, components);
                if (components.hasNativeCode(cxxPlatform)) {
                    for (BuildRule dep : rule.getDeps()) {
                        if (dep instanceof NativeLinkable) {
                            NativeLinkable linkable = (NativeLinkable) dep;
                            nativeLinkableRoots.put(linkable.getBuildTarget(), linkable);
                            omnibusRoots.addExcludedRoot(linkable);
                        }
                    }
                }
                deps = rule.getDeps();
            } else if (rule instanceof CxxPythonExtension) {
                CxxPythonExtension extension = (CxxPythonExtension) rule;
                NativeLinkTarget target = extension.getNativeLinkTarget(pythonPlatform);
                pythonExtensions.put(target.getBuildTarget(), (CxxPythonExtension) rule);
                omnibusRoots.addIncludedRoot(target);
            } else if (rule instanceof PythonPackagable) {
                PythonPackagable packageable = (PythonPackagable) rule;
                PythonPackageComponents components = packageable.getPythonPackageComponents(pythonPlatform, cxxPlatform);
                builder.putAllPythonModules(MoreMaps.transformKeys(components.getModules(), Object::toString));
                builder.putAllNativeLibraries(MoreMaps.transformKeys(components.getNativeLibraries(), Object::toString));
                if (components.hasNativeCode(cxxPlatform)) {
                    for (BuildRule dep : rule.getDeps()) {
                        if (dep instanceof NativeLinkable) {
                            NativeLinkable linkable = (NativeLinkable) dep;
                            nativeLinkableRoots.put(linkable.getBuildTarget(), linkable);
                            omnibusRoots.addExcludedRoot(linkable);
                        }
                    }
                }
                deps = rule.getDeps();
            } else if (rule instanceof CxxLuaExtension) {
                CxxLuaExtension extension = (CxxLuaExtension) rule;
                luaExtensions.put(extension.getBuildTarget(), extension);
                omnibusRoots.addIncludedRoot(extension);
            } else if (rule instanceof NativeLinkable) {
                NativeLinkable linkable = (NativeLinkable) rule;
                nativeLinkableRoots.put(linkable.getBuildTarget(), linkable);
                omnibusRoots.addPotentialRoot(linkable);
            }
            return deps;
        }
    }.start();
    // Build the starter.
    Starter starter = createStarter(baseParams, ruleResolver, pathResolver, ruleFinder, cxxPlatform, nativeStarterLibrary, mainModule, packageStyle, !nativeLinkableRoots.isEmpty() || !omnibusRoots.isEmpty());
    SourcePath starterPath = null;
    if (luaConfig.getNativeLinkStrategy() == NativeLinkStrategy.MERGED) {
        // If we're using a native starter, include it in omnibus linking.
        if (starter instanceof NativeExecutableStarter) {
            NativeExecutableStarter nativeStarter = (NativeExecutableStarter) starter;
            omnibusRoots.addIncludedRoot(nativeStarter);
        }
        // Build the omnibus libraries.
        OmnibusRoots roots = omnibusRoots.build();
        OmnibusLibraries libraries = Omnibus.getSharedLibraries(baseParams, ruleResolver, ruleFinder, cxxBuckConfig, cxxPlatform, ImmutableList.of(), roots.getIncludedRoots().values(), roots.getExcludedRoots().values());
        // Add all the roots from the omnibus link.  If it's an extension, add it as a module.
        for (Map.Entry<BuildTarget, OmnibusRoot> root : libraries.getRoots().entrySet()) {
            // If it's a Lua extension add it as a module.
            CxxLuaExtension luaExtension = luaExtensions.get(root.getKey());
            if (luaExtension != null) {
                builder.putModules(luaExtension.getModule(cxxPlatform), root.getValue().getPath());
                continue;
            }
            // If it's a Python extension, add it as a python module.
            CxxPythonExtension pythonExtension = pythonExtensions.get(root.getKey());
            if (pythonExtension != null) {
                builder.putPythonModules(pythonExtension.getModule().toString(), root.getValue().getPath());
                continue;
            }
            // A root named after the top-level target is our native starter.
            if (root.getKey().equals(baseParams.getBuildTarget())) {
                starterPath = root.getValue().getPath();
                continue;
            }
            // Otherwise, add it as a native library.
            NativeLinkTarget target = Preconditions.checkNotNull(roots.getIncludedRoots().get(root.getKey()), "%s: linked unexpected omnibus root: %s", baseParams.getBuildTarget(), root.getKey());
            NativeLinkTargetMode mode = target.getNativeLinkTargetMode(cxxPlatform);
            String soname = Preconditions.checkNotNull(mode.getLibraryName().orElse(null), "%s: omnibus library for %s was built without soname", baseParams.getBuildTarget(), root.getKey());
            builder.putNativeLibraries(soname, root.getValue().getPath());
        }
        // Add all remaining libraries as native libraries.
        for (OmnibusLibrary library : libraries.getLibraries()) {
            builder.putNativeLibraries(library.getSoname(), library.getPath());
        }
    } else {
        // roots.
        for (Map.Entry<BuildTarget, CxxLuaExtension> entry : luaExtensions.entrySet()) {
            CxxLuaExtension extension = entry.getValue();
            builder.putModules(extension.getModule(cxxPlatform), extension.getExtension(cxxPlatform));
            nativeLinkableRoots.putAll(Maps.uniqueIndex(extension.getNativeLinkTargetDeps(cxxPlatform), NativeLinkable::getBuildTarget));
        }
        // Add in native executable deps.
        if (starter instanceof NativeExecutableStarter) {
            NativeExecutableStarter executableStarter = (NativeExecutableStarter) starter;
            nativeLinkableRoots.putAll(Maps.uniqueIndex(executableStarter.getNativeStarterDeps(), NativeLinkable::getBuildTarget));
        }
        // python-platform specific deps to the native linkables.
        for (Map.Entry<BuildTarget, CxxPythonExtension> entry : pythonExtensions.entrySet()) {
            PythonPackageComponents components = entry.getValue().getPythonPackageComponents(pythonPlatform, cxxPlatform);
            builder.putAllPythonModules(MoreMaps.transformKeys(components.getModules(), Object::toString));
            builder.putAllNativeLibraries(MoreMaps.transformKeys(components.getNativeLibraries(), Object::toString));
            nativeLinkableRoots.putAll(Maps.uniqueIndex(entry.getValue().getNativeLinkTarget(pythonPlatform).getNativeLinkTargetDeps(cxxPlatform), NativeLinkable::getBuildTarget));
        }
        // Add shared libraries from all native linkables.
        for (NativeLinkable nativeLinkable : NativeLinkables.getTransitiveNativeLinkables(cxxPlatform, nativeLinkableRoots.values()).values()) {
            NativeLinkable.Linkage linkage = nativeLinkable.getPreferredLinkage(cxxPlatform);
            if (linkage != NativeLinkable.Linkage.STATIC) {
                builder.putAllNativeLibraries(nativeLinkable.getSharedLibraries(cxxPlatform));
            }
        }
    }
    // building one directly from the starter.
    if (starterPath == null) {
        starterPath = starter.build();
    }
    return LuaBinaryPackageComponents.of(starterPath, builder.build());
}
Also used : CxxPythonExtension(com.facebook.buck.python.CxxPythonExtension) NativeLinkable(com.facebook.buck.cxx.NativeLinkable) NativeLinkTargetMode(com.facebook.buck.cxx.NativeLinkTargetMode) OmnibusRoot(com.facebook.buck.cxx.OmnibusRoot) LinkedHashMap(java.util.LinkedHashMap) SourcePath(com.facebook.buck.rules.SourcePath) OmnibusLibraries(com.facebook.buck.cxx.OmnibusLibraries) ImmutableSet(com.google.common.collect.ImmutableSet) BuildTarget(com.facebook.buck.model.BuildTarget) OmnibusRoots(com.facebook.buck.cxx.OmnibusRoots) BuildRule(com.facebook.buck.rules.BuildRule) PythonPackageComponents(com.facebook.buck.python.PythonPackageComponents) OmnibusLibrary(com.facebook.buck.cxx.OmnibusLibrary) PythonPackagable(com.facebook.buck.python.PythonPackagable) NativeLinkTarget(com.facebook.buck.cxx.NativeLinkTarget) NoSuchBuildTargetException(com.facebook.buck.parser.NoSuchBuildTargetException) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) ImmutableSortedMap(com.google.common.collect.ImmutableSortedMap)

Example 19 with ImmutableSet

use of com.google.common.collect.ImmutableSet in project buck by facebook.

the class Project method walkRuleAndAdd.

/**
   * Walks the dependencies of a build rule and adds the appropriate DependentModules to the
   * specified dependencies collection. All library dependencies will be added before any module
   * dependencies. See {@code ProjectTest#testThatJarsAreListedBeforeModules()} for details on why
   * this behavior is important.
   */
@SuppressWarnings("PMD.LooseCoupling")
private void walkRuleAndAdd(final BuildRule rule, final boolean isForTests, final LinkedHashSet<SerializableDependentModule> dependencies, @Nullable final BuildRule srcTarget) {
    final Path basePathForRule = rule.getBuildTarget().getBasePath();
    Set<BuildRule> targetsToWalk;
    if (rule instanceof JavaTest) {
        targetsToWalk = ((JavaTest) rule).getCompiledTestsLibrary().getDeps();
    } else {
        targetsToWalk = rule.getDeps();
    }
    new AbstractBreadthFirstTraversal<BuildRule>(targetsToWalk) {

        private final LinkedHashSet<SerializableDependentModule> librariesToAdd = Sets.newLinkedHashSet();

        private final LinkedHashSet<SerializableDependentModule> modulesToAdd = Sets.newLinkedHashSet();

        @Override
        public ImmutableSet<BuildRule> visit(BuildRule dep) {
            // Hack: we don't want uber R.java to show up in the deps that IntelliJ sees.
            if (dep.getBuildTarget().toString().endsWith("_uber_r_dot_java")) {
                return ImmutableSet.of();
            }
            ImmutableSet<BuildRule> depsToVisit;
            if (rule.getProperties().is(PACKAGING) || dep instanceof AndroidResource || dep == rule) {
                depsToVisit = dep.getDeps();
            } else if (dep.getProperties().is(LIBRARY) && dep instanceof ExportDependencies) {
                depsToVisit = ((ExportDependencies) dep).getExportedDeps();
            } else {
                depsToVisit = ImmutableSet.of();
            }
            // should contain the union of :lib and :test's deps as dependent modules.
            if (isForTests && depsToVisit.isEmpty() && dep.getBuildTarget().getBasePath().equals(basePathForRule) && !dep.equals(srcTarget)) {
                depsToVisit = dep.getDeps();
            }
            SerializableDependentModule dependentModule;
            if (androidAars.contains(dep)) {
                AndroidPrebuiltAar aar = androidAars.getParentAar(dep);
                dependentModule = SerializableDependentModule.newLibrary(aar.getBuildTarget(), getIntellijNameForAar(aar));
            } else if (dep instanceof PrebuiltJar) {
                libraryJars.add(dep);
                String libraryName = getIntellijNameForRule(dep);
                dependentModule = SerializableDependentModule.newLibrary(dep.getBuildTarget(), libraryName);
            } else if (dep instanceof AndroidPrebuiltAar) {
                androidAars.add((AndroidPrebuiltAar) dep);
                String libraryName = getIntellijNameForAar(dep);
                dependentModule = SerializableDependentModule.newLibrary(dep.getBuildTarget(), libraryName);
            } else if ((dep instanceof CxxLibrary) || (dep instanceof NdkLibrary) || (dep instanceof JavaLibrary) || (dep instanceof AndroidResource)) {
                String moduleName = getIntellijNameForRule(dep);
                dependentModule = SerializableDependentModule.newModule(dep.getBuildTarget(), moduleName);
            } else {
                return depsToVisit;
            }
            if (librariesToAdd.contains(dependentModule) || modulesToAdd.contains(dependentModule)) {
                return depsToVisit;
            }
            if (isForTests) {
                dependentModule.scope = "TEST";
            } else {
                // If the dependentModule has already been added in the "TEST" scope, then it should be
                // removed and then re-added using the current (compile) scope.
                String currentScope = dependentModule.scope;
                dependentModule.scope = "TEST";
                if (dependencies.contains(dependentModule)) {
                    dependencies.remove(dependentModule);
                }
                dependentModule.scope = currentScope;
            }
            // dependencies collection once the traversal is complete in the onComplete() method.
            if (dependentModule.isLibrary()) {
                librariesToAdd.add(dependentModule);
            } else {
                modulesToAdd.add(dependentModule);
            }
            return depsToVisit;
        }

        @Override
        protected void onComplete() {
            dependencies.addAll(librariesToAdd);
            dependencies.addAll(modulesToAdd);
        }
    }.start();
}
Also used : Path(java.nio.file.Path) PathSourcePath(com.facebook.buck.rules.PathSourcePath) SourcePath(com.facebook.buck.rules.SourcePath) CxxLibrary(com.facebook.buck.cxx.CxxLibrary) ExportDependencies(com.facebook.buck.rules.ExportDependencies) AndroidResource(com.facebook.buck.android.AndroidResource) PrebuiltJar(com.facebook.buck.jvm.java.PrebuiltJar) ImmutableSet(com.google.common.collect.ImmutableSet) JavaLibrary(com.facebook.buck.jvm.java.JavaLibrary) JavaTest(com.facebook.buck.jvm.java.JavaTest) AndroidPrebuiltAar(com.facebook.buck.android.AndroidPrebuiltAar) BuildRule(com.facebook.buck.rules.BuildRule) NdkLibrary(com.facebook.buck.android.NdkLibrary)

Example 20 with ImmutableSet

use of com.google.common.collect.ImmutableSet in project buck by facebook.

the class AppleDescriptions method createBuildRulesForCoreDataDependencies.

public static Optional<CoreDataModel> createBuildRulesForCoreDataDependencies(TargetGraph targetGraph, BuildRuleParams params, String moduleName, AppleCxxPlatform appleCxxPlatform) {
    TargetNode<?, ?> targetNode = targetGraph.get(params.getBuildTarget());
    ImmutableSet<AppleWrapperResourceArg> coreDataModelArgs = AppleBuildRules.collectTransitiveBuildRules(targetGraph, Optional.empty(), AppleBuildRules.CORE_DATA_MODEL_DESCRIPTION_CLASSES, ImmutableList.of(targetNode));
    BuildRuleParams coreDataModelParams = params.withAppendedFlavor(CoreDataModel.FLAVOR).copyReplacingDeclaredAndExtraDeps(Suppliers.ofInstance(ImmutableSortedSet.of()), Suppliers.ofInstance(ImmutableSortedSet.of()));
    if (coreDataModelArgs.isEmpty()) {
        return Optional.empty();
    } else {
        return Optional.of(new CoreDataModel(coreDataModelParams, appleCxxPlatform, moduleName, coreDataModelArgs.stream().map(input -> new PathSourcePath(params.getProjectFilesystem(), input.path)).collect(MoreCollectors.toImmutableSet())));
    }
}
Also used : OptionalCompat(com.facebook.buck.util.OptionalCompat) ProvidesLinkedBinaryDeps(com.facebook.buck.cxx.ProvidesLinkedBinaryDeps) SourcePathRuleFinder(com.facebook.buck.rules.SourcePathRuleFinder) AbstractGenruleDescription(com.facebook.buck.shell.AbstractGenruleDescription) RichStream(com.facebook.buck.util.RichStream) InternalFlavor(com.facebook.buck.model.InternalFlavor) FlavorDomain(com.facebook.buck.model.FlavorDomain) CxxCompilationDatabase(com.facebook.buck.cxx.CxxCompilationDatabase) FluentIterable(com.google.common.collect.FluentIterable) SourcePathResolver(com.facebook.buck.rules.SourcePathResolver) SourceList(com.facebook.buck.rules.coercer.SourceList) StripStyle(com.facebook.buck.cxx.StripStyle) BuildRuleParams(com.facebook.buck.rules.BuildRuleParams) Path(java.nio.file.Path) CxxDescriptionEnhancer(com.facebook.buck.cxx.CxxDescriptionEnhancer) BuildRules(com.facebook.buck.rules.BuildRules) FrameworkDependencies(com.facebook.buck.cxx.FrameworkDependencies) Function(com.google.common.base.Function) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) TargetGraph(com.facebook.buck.rules.TargetGraph) Set(java.util.Set) BuildTarget(com.facebook.buck.model.BuildTarget) Sets(com.google.common.collect.Sets) LinkerMapMode(com.facebook.buck.cxx.LinkerMapMode) SourceWithFlags(com.facebook.buck.rules.SourceWithFlags) Predicate(com.google.common.base.Predicate) PathSourcePath(com.facebook.buck.rules.PathSourcePath) Optional(java.util.Optional) BuildRuleResolver(com.facebook.buck.rules.BuildRuleResolver) CxxBinaryDescription(com.facebook.buck.cxx.CxxBinaryDescription) Joiner(com.google.common.base.Joiner) CxxStrip(com.facebook.buck.cxx.CxxStrip) CxxLibraryDescription(com.facebook.buck.cxx.CxxLibraryDescription) SourcePath(com.facebook.buck.rules.SourcePath) Either(com.facebook.buck.model.Either) BuildRule(com.facebook.buck.rules.BuildRule) HashSet(java.util.HashSet) Tool(com.facebook.buck.rules.Tool) ImmutableList(com.google.common.collect.ImmutableList) NoSuchBuildTargetException(com.facebook.buck.parser.NoSuchBuildTargetException) BuildTargetSourcePath(com.facebook.buck.rules.BuildTargetSourcePath) Predicates(com.google.common.base.Predicates) Suppliers(com.google.common.base.Suppliers) ImmutableSortedMap(com.google.common.collect.ImmutableSortedMap) MoreCollectors(com.facebook.buck.util.MoreCollectors) ImmutableSortedSet(com.google.common.collect.ImmutableSortedSet) CxxConstructorArg(com.facebook.buck.cxx.CxxConstructorArg) TargetNode(com.facebook.buck.rules.TargetNode) CxxPlatform(com.facebook.buck.cxx.CxxPlatform) HumanReadableException(com.facebook.buck.util.HumanReadableException) MorePaths(com.facebook.buck.io.MorePaths) Ordering(com.google.common.collect.Ordering) BuildRuleWithBinary(com.facebook.buck.cxx.BuildRuleWithBinary) Paths(java.nio.file.Paths) SWIFT_EXTENSION(com.facebook.buck.swift.SwiftDescriptions.SWIFT_EXTENSION) Preconditions(com.google.common.base.Preconditions) Flavor(com.facebook.buck.model.Flavor) VisibleForTesting(com.google.common.annotations.VisibleForTesting) BuildRuleParams(com.facebook.buck.rules.BuildRuleParams) PathSourcePath(com.facebook.buck.rules.PathSourcePath)

Aggregations

ImmutableSet (com.google.common.collect.ImmutableSet)196 Path (java.nio.file.Path)65 BuildTarget (com.facebook.buck.model.BuildTarget)58 ImmutableMap (com.google.common.collect.ImmutableMap)44 ImmutableList (com.google.common.collect.ImmutableList)43 IOException (java.io.IOException)42 Optional (java.util.Optional)37 Test (org.junit.Test)32 SourcePath (com.facebook.buck.rules.SourcePath)31 TargetNode (com.facebook.buck.rules.TargetNode)28 BuildRule (com.facebook.buck.rules.BuildRule)26 Map (java.util.Map)26 List (java.util.List)25 Set (java.util.Set)25 HumanReadableException (com.facebook.buck.util.HumanReadableException)23 SourcePathResolver (com.facebook.buck.rules.SourcePathResolver)22 ImmutableSortedSet (com.google.common.collect.ImmutableSortedSet)21 SourcePathRuleFinder (com.facebook.buck.rules.SourcePathRuleFinder)20 TargetGraph (com.facebook.buck.rules.TargetGraph)19 VisibleForTesting (com.google.common.annotations.VisibleForTesting)19