Java Code Examples for com.google.common.collect.ImmutableCollection

The following examples show how to use com.google.common.collect.ImmutableCollection. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: buck   Source File: AndroidBinaryResourcesGraphEnhancer.java    License: Apache License 2.0 6 votes vote down vote up
private ResourcesFilter createResourcesFilter(
    InternalFlavor flavor,
    AndroidPackageableCollection.ResourceDetails resourceDetails,
    ImmutableSortedSet<BuildRule> resourceRules,
    ImmutableCollection<BuildRule> rulesWithResourceDirectories) {
  return new ResourcesFilter(
      buildTarget.withAppendedFlavors(RESOURCES_FILTER_FLAVOR, flavor),
      projectFilesystem,
      resourceRules,
      rulesWithResourceDirectories,
      graphBuilder,
      resourceDetails.getResourceDirectories(),
      ImmutableSet.copyOf(resourceDetails.getWhitelistedStringDirectories()),
      locales,
      localizedStringFileName,
      resourceCompressionMode,
      resourceFilter,
      postFilterResourcesCmd);
}
 
Example 2
Source Project: buck   Source File: IjSourceRootSimplifierTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testDifferentTypesAreNotMergedIntoParent() {
  IjSourceRootSimplifier simplifier = new IjSourceRootSimplifier(fakePackageFinder());
  IjFolder aSource = buildSourceFolder("a");
  IjFolder aaaSource = buildSourceFolder("a/a/a");
  IjFolder aaaaSource = buildSourceFolder("a/a/a/a");
  IjFolder aabSource = buildSourceFolder("a/a/b");
  IjFolder abSource = buildSourceFolder("a/b");
  IjFolder acTest = buildTestFolder("a/c");
  IjFolder adaTest = buildTestFolder("a/d/a");

  ImmutableCollection<IjFolder> mergedFolders =
      simplifier
          .simplify(
              0,
              ImmutableSet.of(
                  aSource, aaaSource, aaaaSource, aabSource, abSource, acTest, adaTest),
              Paths.get(""),
              ImmutableSet.of())
          .values();

  IjFolder adTest = buildTestFolder("a/d");
  assertThat(mergedFolders, Matchers.containsInAnyOrder(aSource, acTest, adTest));
}
 
Example 3
Source Project: nomulus   Source File: IcannReportingStager.java    License: Apache License 2.0 6 votes vote down vote up
/** Creates and stores activity reports on GCS, returns a list of files stored. */
private ImmutableList<String> stageActivityReports(
    YearMonth yearMonth,
    String subdir,
    String headerRow,
    ImmutableCollection<Map<TableFieldSchema, Object>> rows)
    throws IOException {
  ImmutableList.Builder<String> manifestBuilder = new ImmutableList.Builder<>();
  // Create a report csv for each tld from query table, and upload to GCS
  for (Map<TableFieldSchema, Object> row : rows) {
    // Get the tld (first cell in each row)
    String tld = row.values().iterator().next().toString();
    if (isNullOrEmpty(tld)) {
      throw new RuntimeException("Found an empty row in the activity report table!");
    }
    ImmutableList<String> rowStrings = ImmutableList.of(constructRow(row.values()));
    // Create and upload the activity report with a single row
    manifestBuilder.add(
        saveReportToGcs(
            tld, yearMonth, subdir, createReport(headerRow, rowStrings), ReportType.ACTIVITY));
  }
  return manifestBuilder.build();
}
 
Example 4
Source Project: buck   Source File: GoTestDescription.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void findDepsForTargetFromConstructorArgs(
    BuildTarget buildTarget,
    CellNameResolver cellRoots,
    AbstractGoTestDescriptionArg constructorArg,
    ImmutableCollection.Builder<BuildTarget> extraDepsBuilder,
    ImmutableCollection.Builder<BuildTarget> targetGraphOnlyDepsBuilder) {
  // Add the C/C++ platform parse time deps.
  GoPlatform platform =
      GoDescriptors.getPlatformForRule(
          getGoToolchain(buildTarget.getTargetConfiguration()),
          this.goBuckConfig,
          buildTarget,
          constructorArg);
  targetGraphOnlyDepsBuilder.addAll(
      CxxPlatforms.getParseTimeDeps(
          buildTarget.getTargetConfiguration(), platform.getCxxPlatform()));
}
 
Example 5
Source Project: bazel   Source File: LocationTemplateContext.java    License: Apache License 2.0 6 votes vote down vote up
public LocationTemplateContext(
    TemplateContext delegate,
    RuleContext ruleContext,
    @Nullable ImmutableMap<Label, ImmutableCollection<Artifact>> labelMap,
    boolean execPaths,
    boolean allowData,
    boolean windowsPath) {
  this(
      delegate,
      ruleContext.getLabel(),
      // Use a memoizing supplier to avoid eagerly building the location map.
      Suppliers.memoize(
          () -> LocationExpander.buildLocationMap(ruleContext, labelMap, allowData)),
      execPaths,
      ruleContext.getRule().getPackage().getRepositoryMapping(),
      windowsPath);
}
 
Example 6
Source Project: buck   Source File: CxxPythonExtensionDescription.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void findDepsForTargetFromConstructorArgs(
    BuildTarget buildTarget,
    CellNameResolver cellRoots,
    AbstractCxxPythonExtensionDescriptionArg constructorArg,
    ImmutableCollection.Builder<BuildTarget> extraDepsBuilder,
    ImmutableCollection.Builder<BuildTarget> targetGraphOnlyDepsBuilder) {
  // Get any parse time deps from the C/C++ platforms.
  getCxxPlatforms(buildTarget.getTargetConfiguration())
      .getValues(buildTarget)
      .forEach(
          p -> extraDepsBuilder.addAll(p.getParseTimeDeps(buildTarget.getTargetConfiguration())));

  for (PythonPlatform pythonPlatform :
      getPythonPlatforms(buildTarget.getTargetConfiguration()).getValues()) {
    Optionals.addIfPresent(pythonPlatform.getCxxLibrary(), extraDepsBuilder);
  }
}
 
Example 7
Source Project: vespa   Source File: SearchPath.java    License: Apache License 2.0 6 votes vote down vote up
private Group selectGroup(SearchCluster cluster) {
    if (group != null) {
        Optional<Group> specificGroup = cluster.group(group);
        if (specificGroup.isPresent()) {
            return specificGroup.get();
        } else {
            throw new InvalidSearchPathException("Invalid searchPath, cluster does not have " + (group + 1) + " groups");
        }
    }

    // pick "anything": try to find the first working
    ImmutableCollection<Group> groups = cluster.groups().values();
    for (Group g : groups) {
        if (g.hasSufficientCoverage()) {
            return g;
        }
    }

    // fallback: first
    return groups.iterator().next();
}
 
Example 8
Source Project: buck   Source File: CxxWriteArgsToFileStep.java    License: Apache License 2.0 6 votes vote down vote up
static ImmutableList<String> stringify(
    ImmutableCollection<Arg> args,
    CanonicalCellName currentCellName,
    SourcePathResolverAdapter pathResolver,
    boolean useUnixPathSeparator) {
  ImmutableList.Builder<String> builder = ImmutableList.builder();
  for (Arg arg : args) {
    if (arg instanceof FileListableLinkerInputArg) {
      ((FileListableLinkerInputArg) arg)
          .appendToCommandLineRel(
              builder::add, currentCellName, pathResolver, useUnixPathSeparator);
    } else if (arg instanceof SourcePathArg) {
      ((SourcePathArg) arg)
          .appendToCommandLineRel(
              builder::add, currentCellName, pathResolver, useUnixPathSeparator);
    } else if (arg instanceof CompositeArg) {
      ((CompositeArg) arg)
          .appendToCommandLineRel(
              builder::add, currentCellName, pathResolver, useUnixPathSeparator);
    } else {
      arg.appendToCommandLine(builder::add, pathResolver);
    }
  }
  return builder.build();
}
 
Example 9
Source Project: codebuff   Source File: AggregateFuture.java    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
@CanIgnoreReturnValue
@Override
public final boolean cancel(boolean mayInterruptIfRunning) {
  // Must get a reference to the futures before we cancel, as they'll be cleared out.
  RunningState localRunningState = runningState;
  ImmutableCollection<? extends ListenableFuture<? extends InputT>> futures =
      (localRunningState != null) ? localRunningState.futures : null;
  // Cancel all the component futures.
  boolean cancelled = super.cancel(mayInterruptIfRunning);
  // & is faster than the branch required for &&
  if (cancelled & futures != null) {
    for (ListenableFuture<?> future : futures) {
      future.cancel(mayInterruptIfRunning);
    }
  }
  return cancelled;
}
 
Example 10
Source Project: buck   Source File: CgoLibraryDescription.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void findDepsForTargetFromConstructorArgs(
    BuildTarget buildTarget,
    CellNameResolver cellRoots,
    CgoLibraryDescriptionArg constructorArg,
    ImmutableCollection.Builder<BuildTarget> extraDepsBuilder,
    ImmutableCollection.Builder<BuildTarget> targetGraphOnlyDepsBuilder) {
  // Add the C/C++ platform deps.
  GoToolchain toolchain = getGoToolchain(buildTarget.getTargetConfiguration());
  toolchain
      .getPlatformFlavorDomain()
      .getValue(buildTarget)
      .ifPresent(
          platform ->
              targetGraphOnlyDepsBuilder.addAll(
                  CxxPlatforms.getParseTimeDeps(
                      buildTarget.getTargetConfiguration(), platform.getCxxPlatform())));
}
 
Example 11
Source Project: buck   Source File: HaskellHaddockDescription.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void findDepsForTargetFromConstructorArgs(
    BuildTarget buildTarget,
    CellNameResolver cellRoots,
    AbstractHaskellHaddockDescriptionArg constructorArg,
    ImmutableCollection.Builder<BuildTarget> extraDepsBuilder,
    ImmutableCollection.Builder<BuildTarget> targetGraphOnlyDepsBuilder) {

  HaskellDescriptionUtils.getParseTimeDeps(
      buildTarget.getTargetConfiguration(),
      ImmutableList.of(getPlatform(buildTarget, constructorArg)),
      targetGraphOnlyDepsBuilder);

  constructorArg
      .getDepsQuery()
      .ifPresent(
          depsQuery ->
              QueryUtils.extractParseTimeTargets(buildTarget, cellRoots, depsQuery)
                  .forEach(targetGraphOnlyDepsBuilder::add));
}
 
Example 12
Source Project: buck   Source File: AndroidBinaryResourcesGraphEnhancer.java    License: Apache License 2.0 6 votes vote down vote up
private PackageStringAssets createPackageStringAssets(
    ImmutableSortedSet<BuildRule> resourceRules,
    ImmutableCollection<BuildRule> rulesWithResourceDirectories,
    FilteredResourcesProvider filteredResourcesProvider,
    AaptOutputInfo aaptOutputInfo) {
  return new PackageStringAssets(
      buildTarget.withAppendedFlavors(
          AndroidBinaryResourcesGraphEnhancer.PACKAGE_STRING_ASSETS_FLAVOR),
      projectFilesystem,
      graphBuilder,
      resourceRules,
      rulesWithResourceDirectories,
      filteredResourcesProvider,
      locales,
      aaptOutputInfo.getPathToRDotTxt());
}
 
Example 13
Source Project: LuckPerms   Source File: AbstractUserManager.java    License: MIT License 6 votes vote down vote up
/**
 * Check whether the user's state indicates that they should be persisted to storage.
 *
 * @param user the user to check
 * @return true if the user should be saved
 */
@Override
public boolean shouldSave(User user) {
    ImmutableCollection<Node> nodes = user.normalData().immutable().values();
    if (nodes.size() != 1) {
        return true;
    }

    Node onlyNode = nodes.iterator().next();
    if (!(onlyNode instanceof InheritanceNode)) {
        return true;
    }

    if (onlyNode.hasExpiry() || !onlyNode.getContexts().isEmpty()) {
        return true;
    }

    if (!((InheritanceNode) onlyNode).getGroupName().equalsIgnoreCase(GroupManager.DEFAULT_GROUP_NAME)) {
        // The user's only node is not the default group one.
        return true;
    }


    // Not in the default primary group
    return !user.getPrimaryGroup().getStoredValue().orElse(GroupManager.DEFAULT_GROUP_NAME).equalsIgnoreCase(GroupManager.DEFAULT_GROUP_NAME);
}
 
Example 14
@Test
public void variantsWithoutNativeLibs() throws Exception {
  NativeLibsCompressionVariantGenerator nativeLibsCompressionVariantGenerator =
      new NativeLibsCompressionVariantGenerator(
          ApkGenerationConfiguration.builder()
              .setEnableNativeLibraryCompressionSplitter(true)
              .build());

  BundleModule bundleModule =
      new BundleModuleBuilder("testModule")
          .addFile("assets/leftover.txt")
          .addFile("dex/classes.dex")
          .setManifest(androidManifest("com.test.app"))
          .build();

  ImmutableCollection<VariantTargeting> splits =
      nativeLibsCompressionVariantGenerator.generate(bundleModule).collect(toImmutableList());
  assertThat(splits).isEmpty();
}
 
Example 15
@Test
public void nativeCompressionSplitter_withM_withLibsWithoutExternalStorage() throws Exception {
  NativeLibrariesCompressionSplitter nativeLibrariesCompressionSplitter =
      new NativeLibrariesCompressionSplitter();
  ImmutableCollection<ModuleSplit> splits =
      nativeLibrariesCompressionSplitter.split(
          ModuleSplit.forNativeLibraries(
              createSingleLibraryModule("testModule", "x86", "lib/x86/libnoname.so"),
              variantSdkTargeting(ANDROID_M_API_VERSION)));

  assertThat(splits).hasSize(1);
  ModuleSplit moduleSplit = Iterables.getOnlyElement(splits);

  assertThat(moduleSplit.getVariantTargeting())
      .isEqualTo(variantSdkTargeting(ANDROID_M_API_VERSION));

  assertThat(extractPaths(moduleSplit.getEntries())).containsExactly("lib/x86/libnoname.so");
  assertThat(moduleSplit.isMasterSplit()).isTrue();
  assertThat(getForceUncompressed(moduleSplit, "lib/x86/libnoname.so")).isTrue();
  assertThat(moduleSplit.getApkTargeting()).isEqualToDefaultInstance();
  assertThat(
          compareManifestMutators(
              moduleSplit.getMasterManifestMutators(), withExtractNativeLibs(false)))
      .isTrue();
}
 
Example 16
@Test
public void nativeCompressionSplitter_withM_withNativeActivities() throws Exception {
  NativeLibrariesCompressionSplitter nativeLibrariesCompressionSplitter =
      new NativeLibrariesCompressionSplitter();
  ImmutableCollection<ModuleSplit> splits =
      nativeLibrariesCompressionSplitter.split(
          ModuleSplit.forNativeLibraries(
              createSingleLibraryModule(
                  "testModule", "x86", "lib/x86/libnoname.so", withNativeActivity("noname")),
              variantSdkTargeting(ANDROID_M_API_VERSION)));

  assertThat(splits).hasSize(1);
  ModuleSplit moduleSplit = Iterables.getOnlyElement(splits);

  assertThat(moduleSplit.getVariantTargeting())
      .isEqualTo(variantSdkTargeting(ANDROID_M_API_VERSION));

  assertThat(extractPaths(moduleSplit.getEntries())).containsExactly("lib/x86/libnoname.so");
  assertThat(moduleSplit.isMasterSplit()).isTrue();
  assertThat(getForceUncompressed(moduleSplit, "lib/x86/libnoname.so")).isFalse();
  assertThat(moduleSplit.getApkTargeting()).isEqualToDefaultInstance();
}
 
Example 17
Source Project: buck   Source File: ExecutableFinder.java    License: Apache License 2.0 6 votes vote down vote up
public Optional<Path> getOptionalExecutable(
    Path suggestedExecutable,
    ImmutableCollection<Path> path,
    ImmutableCollection<String> fileSuffixes) {

  // Fast path out of here.
  if (isExecutable(suggestedExecutable)) {
    return Optional.of(suggestedExecutable);
  }

  Optional<Path> executable =
      FileFinder.getOptionalFile(
          FileFinder.combine(
              /* prefixes */ null,
              suggestedExecutable.toString(),
              ImmutableSet.copyOf(fileSuffixes)),
          path,
          ExecutableFinder::isExecutable);
  LOG.debug("Executable '%s' mapped to '%s'", suggestedExecutable, executable);

  return executable;
}
 
Example 18
Source Project: buck   Source File: HaskellGhciDescription.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void findDepsForTargetFromConstructorArgs(
    BuildTarget buildTarget,
    CellNameResolver cellRoots,
    AbstractHaskellGhciDescriptionArg constructorArg,
    ImmutableCollection.Builder<BuildTarget> extraDepsBuilder,
    ImmutableCollection.Builder<BuildTarget> targetGraphOnlyDepsBuilder) {

  HaskellDescriptionUtils.getParseTimeDeps(
      buildTarget.getTargetConfiguration(),
      ImmutableList.of(getPlatform(buildTarget, constructorArg)),
      targetGraphOnlyDepsBuilder);

  constructorArg
      .getDepsQuery()
      .ifPresent(
          depsQuery ->
              QueryUtils.extractParseTimeTargets(buildTarget, cellRoots, depsQuery)
                  .forEach(targetGraphOnlyDepsBuilder::add));
}
 
Example 19
Source Project: buck   Source File: ScalaTestDescription.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void findDepsForTargetFromConstructorArgs(
    BuildTarget buildTarget,
    CellNameResolver cellRoots,
    AbstractScalaTestDescriptionArg constructorArg,
    ImmutableCollection.Builder<BuildTarget> extraDepsBuilder,
    ImmutableCollection.Builder<BuildTarget> targetGraphOnlyDepsBuilder) {
  extraDepsBuilder.add(config.getScalaLibraryTarget(buildTarget.getTargetConfiguration()));
  Optionals.addIfPresent(
      config.getScalacTarget(buildTarget.getTargetConfiguration()), extraDepsBuilder);
  javaOptionsForTests
      .apply(buildTarget.getTargetConfiguration())
      .addParseTimeDeps(targetGraphOnlyDepsBuilder, buildTarget.getTargetConfiguration());
  javacFactory.addParseTimeDeps(
      targetGraphOnlyDepsBuilder, constructorArg, buildTarget.getTargetConfiguration());
}
 
Example 20
@Test
public void splittingByCompression_preM_instantModule() throws Exception {
  NativeLibrariesCompressionSplitter nativeLibrariesCompressionSplitter =
      new NativeLibrariesCompressionSplitter(
          ApkGenerationConfiguration.builder().setForInstantAppVariants(true).build());

  ImmutableCollection<ModuleSplit> splits =
      nativeLibrariesCompressionSplitter.split(
          ModuleSplit.forNativeLibraries(
              createSingleLibraryModule("testModule", "x86", "lib/x86/libnoname.so"),
              lPlusVariantTargeting()));

  assertThat(splits).hasSize(1);

  ModuleSplit moduleSplit = Iterables.getOnlyElement(splits);

  assertThat(moduleSplit.getVariantTargeting()).isEqualTo(lPlusVariantTargeting());
  assertThat(extractPaths(moduleSplit.getEntries())).containsExactly("lib/x86/libnoname.so");
  assertThat(moduleSplit.isMasterSplit()).isTrue();
  assertThat(moduleSplit.getApkTargeting()).isEqualToDefaultInstance();
  assertThat(getForceUncompressed(moduleSplit, "lib/x86/libnoname.so")).isTrue();
  assertThat(
          compareManifestMutators(
              moduleSplit.getMasterManifestMutators(), withExtractNativeLibs(false)))
      .isTrue();
}
 
Example 21
Source Project: joda-collect   Source File: DenseImmutableGrid.java    License: Apache License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public ImmutableCollection<V> values() {
    Object[] array = new Object[size];
    int index = 0;
    for (Object object : values) {
        if (object != null) {
            array[index++] = object;
        }
    }
    return ImmutableList.copyOf((V[]) array);
}
 
Example 22
@Override
protected ImmutableCollection<T> doDeserialize( JsonReader reader, JsonDeserializationContext ctx, JsonDeserializerParameters params ) {
    try {
        currentBuilder = ImmutableList.builder();
        buildCollection( reader, ctx, params );
        return currentBuilder.build();
    } finally {
        currentBuilder = null;
    }
}
 
Example 23
Source Project: bazel   Source File: Expander.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Returns a new instance that also expands locations, passing the given location map, as well as
 * {@code execPaths} to the underlying {@link LocationTemplateContext}.
 */
public Expander withExecLocations(
    ImmutableMap<Label, ImmutableCollection<Artifact>> locations, boolean windowsPath) {
  TemplateContext newTemplateContext =
      new LocationTemplateContext(
          templateContext, ruleContext, locations, true, false, windowsPath);
  return new Expander(ruleContext, newTemplateContext, labelMap, lookedUpVariables);
}
 
Example 24
@java.lang.SuppressWarnings("all")
protected SingularGuavaCollection(final SingularGuavaCollectionBuilder<T, ?, ?> b) {
  com.google.common.collect.ImmutableCollection<java.lang.Object> rawTypes = b.rawTypes == null ? com.google.common.collect.ImmutableList.<java.lang.Object>of() : b.rawTypes.build();
  this.rawTypes = rawTypes;
  com.google.common.collect.ImmutableCollection<Integer> integers = b.integers == null ? com.google.common.collect.ImmutableList.<Integer>of() : b.integers.build();
  this.integers = integers;
  com.google.common.collect.ImmutableCollection<T> generics = b.generics == null ? com.google.common.collect.ImmutableList.<T>of() : b.generics.build();
  this.generics = generics;
  com.google.common.collect.ImmutableCollection<Number> extendsGenerics = b.extendsGenerics == null ? com.google.common.collect.ImmutableList.<Number>of() : b.extendsGenerics.build();
  this.extendsGenerics = extendsGenerics;
}
 
Example 25
Source Project: Velocity   Source File: QueryResponse.java    License: MIT License 5 votes vote down vote up
@VisibleForTesting
QueryResponse(String hostname, String gameVersion, String map, int currentPlayers,
    int maxPlayers, String proxyHost, int proxyPort, ImmutableCollection<String> players,
    String proxyVersion, ImmutableCollection<PluginInformation> plugins) {
  this.hostname = hostname;
  this.gameVersion = gameVersion;
  this.map = map;
  this.currentPlayers = currentPlayers;
  this.maxPlayers = maxPlayers;
  this.proxyHost = proxyHost;
  this.proxyPort = proxyPort;
  this.players = players;
  this.proxyVersion = proxyVersion;
  this.plugins = plugins;
}
 
Example 26
@java.lang.SuppressWarnings("all")
public SingularGuavaCollection<T> build() {
  com.google.common.collect.ImmutableCollection<java.lang.Object> rawTypes = this.rawTypes == null ? com.google.common.collect.ImmutableList.<java.lang.Object>of() : this.rawTypes.build();
  com.google.common.collect.ImmutableCollection<Integer> integers = this.integers == null ? com.google.common.collect.ImmutableList.<Integer>of() : this.integers.build();
  com.google.common.collect.ImmutableCollection<T> generics = this.generics == null ? com.google.common.collect.ImmutableList.<T>of() : this.generics.build();
  com.google.common.collect.ImmutableCollection<Number> extendsGenerics = this.extendsGenerics == null ? com.google.common.collect.ImmutableList.<Number>of() : this.extendsGenerics.build();
  return new SingularGuavaCollection<T>(rawTypes, integers, generics, extendsGenerics);
}
 
Example 27
@Override
protected void setDimensionAlternatives(
    VariantTargeting.Builder targetingBuilder, ImmutableCollection<SdkVersion> alternatives) {
  targetingBuilder
      .getSdkVersionTargetingBuilder()
      .clearAlternatives()
      .addAllAlternatives(alternatives);
}
 
Example 28
Source Project: buck   Source File: UnresolvedInferPlatform.java    License: Apache License 2.0 5 votes vote down vote up
/** Helper method to add parse-time deps to target graph for nullsafe flavored targets. */
static void addParseTimeDepsToInferFlavored(
    ImmutableCollection.Builder<BuildTarget> targetGraphOnlyDepsBuilder,
    BuildTarget buildTarget,
    UnresolvedInferPlatform platform) {
  if (buildTarget.getFlavors().contains(InferNullsafe.INFER_NULLSAFE)) {
    targetGraphOnlyDepsBuilder.addAll(
        platform.getParseTimeDeps(buildTarget.getTargetConfiguration()));
  }
}
 
Example 29
Source Project: bundletool   Source File: EntryCompressionPreprocessor.java    License: Apache License 2.0 5 votes vote down vote up
@CheckReturnValue
private static ImmutableList<BundleModule> setEntryCompression(
    ImmutableCollection<BundleModule> modules) {
  return modules.stream()
      .map(EntryCompressionPreprocessor::setEntryCompression)
      .collect(toImmutableList());
}
 
Example 30
private static ImmutableCollection<ModuleEntry> processEntries(
    ImmutableCollection<ModuleEntry> entries,
    ImmutableCollection<TargetedNativeDirectory> targeted64BitNativeDirectories) {
  return entries.stream()
      .filter(entry -> shouldIncludeEntry(entry, targeted64BitNativeDirectories))
      .collect(toImmutableList());
}