Tabnine Logo
Transform
Code IndexAdd Tabnine to your IDE (free)

How to use
Transform
in
com.android.build.api.transform

Best Java code snippets using com.android.build.api.transform.Transform (Showing top 17 results out of 315)

origin: uber/okbuck

 private void runTransform(Transform transform, TransformOutputProvider outputProvider)
   throws Exception {

  // Cleaning output directory.
  FileUtil.deleteDirectory(outputJarsDir);
  outputJarsDir.mkdirs();

  // Preparing Transform invocation.
  TransformInput input = new TransformInputBuilder().addJarInputFolder(inputJarsDir).build();
  TransformInput referencedInput =
    new TransformInputBuilder().addJarInput(androidClassPath).build();

  TransformInvocation invocation =
    new TransformInvocationBuilder()
      .addInput(input)
      .addReferencedInput(referencedInput)
      .setOutputProvider(outputProvider)
      .build();

  // Running the transform invocation.
  transform.transform(invocation);
 }
}
origin: com.android.tools.build/gradle-core

private boolean validateTransform(@NonNull Transform transform) {
  // check the content type are of the right Type.
  if (!checkContentTypes(transform.getInputTypes(), transform)
      || !checkContentTypes(transform.getOutputTypes(), transform)) {
    return false;
  }
  // check some scopes are not consumed.
  Set<? super Scope> scopes = transform.getScopes();
  // Allow Jack transform to consume provided classes as the .jack files are needed.
  if (scopes.contains(Scope.PROVIDED_ONLY) && !isJackRuntimeLib(transform)) {
    errorReporter.handleSyncError(null, SyncIssue.TYPE_GENERIC,
        String.format("PROVIDED_ONLY scope cannot be consumed by Transform '%1$s'",
            transform.getName()));
    return false;
  }
  if (scopes.contains(Scope.TESTED_CODE)) {
    errorReporter.handleSyncError(null, SyncIssue.TYPE_GENERIC,
        String.format("TESTED_CODE scope cannot be consumed by Transform '%1$s'",
            transform.getName()));
    return false;
  }
  return true;
}
origin: com.android.tools.build/gradle-core

    String.format(
        "Unable to add Transform '%s' on variant '%s': requested streams not available: %s+%s / %s",
        transform.getName(), scope.getFullVariantName(),
        transform.getScopes(), transform.getReferencedScopes(),
        transform.getInputTypes()));
return Optional.empty();
logger.debug("\tName: " + transform.getName());
logger.debug("\tTask: " + taskName);
for (TransformStream sd : inputStreams) {
origin: com.android.tools.build/gradle-core

private synchronized Collection<SecondaryFile> getAllSecondaryInputs() {
  if (secondaryFiles == null) {
    ImmutableList.Builder<SecondaryFile> builder = ImmutableList.builder();
    builder.addAll(transform.getSecondaryFiles());
    builder.addAll(
        Iterables.transform(
            transform.getSecondaryFileInputs(), SecondaryFile::nonIncremental));
    secondaryFiles = builder.build();
  }
  return secondaryFiles;
}
origin: com.android.tools.build/gradle-core

IncrementalTransformInput next = iterator.next();
if (next.checkRemovedJarFile(
    Sets.union(transform.getScopes(), transform.getReferencedScopes()),
    transform.getInputTypes(),
    removedFile,
    removedFileSegments)
    || next.checkRemovedFolderFile(
        Sets.union(transform.getScopes(), transform.getReferencedScopes()),
        transform.getInputTypes(),
        removedFile,
        removedFileSegments)) {
origin: com.android.tools.build/gradle-core

@OutputDirectories
public Collection<File> getOtherFolderOutputs() {
  return transform.getSecondaryDirectoryOutputs();
}
origin: com.android.tools.build/gradle-core

@VisibleForTesting
@NonNull
static String getTaskNamePrefix(@NonNull Transform transform) {
  StringBuilder sb = new StringBuilder(100);
  sb.append("transform");
  sb.append(
      transform.getInputTypes()
          .stream()
          .map(inputType ->
              CaseFormat.UPPER_UNDERSCORE.to(
                  CaseFormat.UPPER_CAMEL, inputType.name()))
          .sorted() // Keep the order stable.
          .collect(Collectors.joining("And")))
      .append("With")
      .append(capitalize(transform.getName()))
      .append("For");
  return sb.toString();
}
origin: com.android.tools.build/gradle-core

@NonNull
private List<TransformStream> grabReferencedStreams(@NonNull Transform transform) {
  Set<? super Scope> requestedScopes = transform.getReferencedScopes();
  if (requestedScopes.isEmpty()) {
    return ImmutableList.of();
  }
  List<TransformStream> streamMatches = Lists.newArrayListWithExpectedSize(streams.size());
  Set<ContentType> requestedTypes = transform.getInputTypes();
  for (TransformStream stream : streams) {
    // streams may contain more than we need. In this case, we'll provide the whole
    // stream as-is since it's not actually consumed.
    // It'll be up to the TransformTask to make sure that the content of the stream is
    // usable (for instance when a stream
    // may contain two scopes, these scopes could be combined or not, impacting consumption)
    Set<ContentType> availableTypes = stream.getContentTypes();
    Set<? super Scope> availableScopes = stream.getScopes();
    Set<ContentType> commonTypes = Sets.intersection(requestedTypes,
        availableTypes);
    Set<? super Scope> commonScopes = Sets.intersection(requestedScopes, availableScopes);
    if (!commonTypes.isEmpty() && !commonScopes.isEmpty()) {
      streamMatches.add(stream);
    }
  }
  return streamMatches;
}
origin: com.android.tools.build/gradle-core

private boolean checkContentTypes(
    @NonNull Set<ContentType> contentTypes,
    @NonNull Transform transform) {
  for (ContentType contentType : contentTypes) {
    if (!(contentType instanceof QualifiedContent.DefaultContentType
        || contentType instanceof ExtendedContentType)) {
      errorReporter.handleSyncError(null, SyncIssue.TYPE_GENERIC,
          String.format("Custom content types (%1$s) are not supported in transforms (%2$s)",
              contentType.getClass().getName(), transform.getName()));
      return false;
    }
  }
  return true;
}
origin: com.android.tools.build/gradle-core

@Input
public Map<String, Object> getOtherInputs() {
  return transform.getParameterInputs();
}
origin: com.android.tools.build/gradle-api

/**
 * Returns the type(s) of data that is generated by the Transform. This may be more than
 * one type.
 *
 * <p>The default implementation returns {@link #getInputTypes()}.
 *
 * <p><strong>This must be of type {@link QualifiedContent.DefaultContentType}</strong>
 */
@NonNull
public Set<ContentType> getOutputTypes() {
  return getInputTypes();
}
origin: com.android.tools.build/gradle-core

if (transform.getScopes().isEmpty()) {
  variantScope.getAssembleTask().dependsOn(tasks, t);
origin: com.android.tools.build/gradle-core

  @NonNull File buildDir) {
Set<? super Scope> requestedScopes = transform.getScopes();
if (requestedScopes.isEmpty()) {
Set<ContentType> requestedTypes = transform.getInputTypes();
Set<ContentType> outputTypes = transform.getOutputTypes();
    transform.getName(),
    scope.getDirectorySegments()));
origin: com.android.tools.build/gradle-core

@InputFiles
public Collection<File> getOtherFileInputs() {
  //noinspection deprecation: Needed for backward compatibility.
  return Stream.concat(
          transform.getSecondaryFiles().stream().map(SecondaryFile::getFile),
          transform.getSecondaryFileInputs().stream())
      .collect(Collectors.toList());
}
origin: CoffeePartner/capt

if (t.getTransform().getName().equals(NAME)) {
  t.dependsOn(getByVariant(t.getVariantName()));
origin: gradle.plugin.com.roly/tracking

@Override
public void transform(TransformInvocation transformInvocation) throws TransformException, InterruptedException, IOException {
  super.transform(transformInvocation);
  Collection<TransformInput> inputs = transformInvocation.getInputs();
  TransformOutputProvider outputProvider = transformInvocation.getOutputProvider();
origin: com.android.tools.build/gradle-api

transform(transformInvocation.getContext(), transformInvocation.getInputs(),
    transformInvocation.getReferencedInputs(),
    transformInvocation.getOutputProvider(),
com.android.build.api.transformTransform

Most used methods

  • transform
  • getInputTypes
  • getName
  • getOutputTypes
  • getParameterInputs
  • getReferencedScopes
  • getScopes
  • getSecondaryDirectoryOutputs
  • getSecondaryFileInputs
  • getSecondaryFileOutputs
  • getSecondaryFiles
  • isIncremental
  • getSecondaryFiles,
  • isIncremental

Popular in Java

  • Making http post requests using okhttp
  • getSystemService (Context)
  • compareTo (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Notification (javax.management)
  • Option (scala)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now