for (TransformInput input : invocation.getInputs()) { input.getJarInputs().parallelStream().forEach(jarInput -> { File src = jarInput.getFile();
@Test public void addInput_shouldAddAnInput() throws Exception { TransformInvocation invocation = builder.addInput(transformInput).setOutputProvider(outputProvider).build(); assertThat(invocation.getInputs()).containsExactly(transformInput); assertThat(invocation.getReferencedInputs()).isEmpty(); assertThat(invocation.getOutputProvider()).isEqualTo(outputProvider); }
@Test public void addReferencedInput_shouldAddReferencedInput() throws Exception { TransformInvocation invocation = builder.addReferencedInput(transformInput).setOutputProvider(outputProvider).build(); assertThat(invocation.getInputs()).isEmpty(); assertThat(invocation.getReferencedInputs()).containsExactly(transformInput); assertThat(invocation.getOutputProvider()).isEqualTo(outputProvider); }
.getContentLocation(TRANSFORM_OUTPUT, getOutputTypes(), getScopes(), Format.DIRECTORY); for (TransformInput input : transformInvocation.getInputs()) {
URLClassLoader captDependencies = new URLClassLoader(runnerUrls, Plugin.class.getClassLoader()); URL[] runtimeUrls = invocation.getInputs().stream() .flatMap(s -> Stream.concat(s.getDirectoryInputs().stream(), s.getJarInputs().stream())) .map(QualifiedContent::getFile) Streams.concat(invocation.getInputs().stream(), invocation.getReferencedInputs().stream()) .flatMap(s -> Stream.concat(s.getDirectoryInputs().stream(), s.getJarInputs().stream()))
@Override public void transform(@NonNull TransformInvocation invocation) throws IOException, TransformException, InterruptedException { TransformOutputProvider output = invocation.getOutputProvider(); Collection<TransformInput> referencedInputs = invocation.getReferencedInputs(); checkNotNull(output, "Missing output object for transform " + getName()); if (isIncrementalRun(invocation.isIncremental(), referencedInputs)) { incrementalRun(invocation.getInputs(), referencedInputs, output); } else { fullRun(invocation.getInputs(), referencedInputs, output); } }
Map<String, QualifiedContent> inputs = invocation.getInputs().stream() .flatMap(i -> Stream.concat(i.getDirectoryInputs().stream(), i.getJarInputs().stream())) .collect(Collectors.toMap(QualifiedContent::getName, Function.identity()));
for (TransformInput input : transformInvocation.getInputs()) { for (JarInput jarInput : input.getJarInputs()) { throw new IllegalArgumentException("JAR Inputs are not supported yet");
for (TransformInput transformInput : transformInvocation.getInputs()) { for (JarInput jarInput : transformInput.getJarInputs()) { logger.error("InstantRunDependenciesApkBuilder received a jar file "
@Override public void transform(TransformInvocation transformInvocation) throws TransformException, InterruptedException, IOException { super.transform(transformInvocation); Collection<TransformInput> inputs = transformInvocation.getInputs(); TransformOutputProvider outputProvider = transformInvocation.getOutputProvider(); if (outputProvider != null) outputProvider.deleteAll();
throws IOException, InterruptedException, TransformException { WaitableTasks io = WaitableTasks.get(resource.io()); invocation.getInputs() .forEach(i -> { i.getDirectoryInputs()
@Override public void transform(@NonNull TransformInvocation invocation) throws IOException, TransformException, InterruptedException { checkNotNull(invocation.getOutputProvider(), "Missing output object for transform " + getName()); File outputDir = invocation.getOutputProvider().getContentLocation( "main", getOutputTypes(), getScopes(), Format.DIRECTORY); FileUtils.mkdirs(outputDir); TransformInput input = Iterables.getOnlyElement(invocation.getInputs()); // we don't want jar inputs. Preconditions.checkState(input.getJarInputs().isEmpty()); DirectoryInput directoryInput = Iterables.getOnlyElement(input.getDirectoryInputs()); File inputDir = directoryInput.getFile(); Instrumenter instrumenter = new Instrumenter(new OfflineInstrumentationAccessGenerator()); if (invocation.isIncremental()) { instrumentFilesIncremental(instrumenter, inputDir, outputDir, directoryInput.getChangedFiles()); } else { instrumentFilesFullRun(instrumenter, inputDir, outputDir); } }
String buildType = styleables.getParentFile().getName(); outputProvider.deleteAll(); Collection<TransformInput> inputs = transformInvocation.getInputs(); if (config.inlineR && !Objects.equals(buildType, "debug")) { RSymbols rSymbols = new RSymbols().from(inputs);
@Override public void transform(@NonNull TransformInvocation transformInvocation) throws IOException, TransformException, InterruptedException { TransformOutputProvider outputProvider = transformInvocation.getOutputProvider(); boolean isIncremental = transformInvocation.isIncremental(); Collection<TransformInput> inputs = transformInvocation.getInputs(); if (outputProvider == null) { logger.error(null /* throwable */, "null TransformOutputProvider for InstantRunSlicer"); return; } Slices slices = new Slices(); if (isIncremental) { processCodeChanges(inputs, outputProvider, slices); } else { slice(inputs, outputProvider, slices); } }
java.util.Collection<TransformInput> inputs = transformInvocation.getInputs(); Collection<TransformInput> referencedInputs = transformInvocation.getReferencedInputs(); TransformOutputProvider outputProvider = transformInvocation.getOutputProvider();
transform(transformInvocation.getContext(), transformInvocation.getInputs(), transformInvocation.getReferencedInputs(), transformInvocation.getOutputProvider(),
checkNotNull(outputProvider); Iterable<File> jarInputs = TransformInputUtil.getJarFiles(transformInvocation.getInputs()); if (!forPackagedLibs) {
WaitableExecutor<Void> executor = WaitableExecutor.useGlobalSharedThreadPool(); for (TransformInput input : transformInvocation.getInputs()) { for (DirectoryInput dirInput : input.getDirectoryInputs()) { File dirOutput = outputProvider.getContentLocation(dirInput.getName()
for (TransformInput input : invocation.getInputs()) { for (JarInput jarInput : input.getJarInputs()) { jarMerger.addJar(jarInput.getFile());
private void runJack(@NonNull TransformInvocation transformInvocation) throws ProcessException, IOException, JackToolchain.ToolchainException, ClassNotFoundException { TransformOutputProvider outputProvider = transformInvocation.getOutputProvider(); checkNotNull(outputProvider); final File outDirectory = outputProvider.getContentLocation( "main", getOutputTypes(), getScopes(), Format.DIRECTORY); options.setDexOutputDirectory(outDirectory); options.setClasspaths( TransformInputUtil.getAllFiles(transformInvocation.getReferencedInputs())); options.setImportFiles(TransformInputUtil.getAllFiles(transformInvocation.getInputs())); options.setInputFiles(getSourceFiles()); JackToolchain toolchain = new JackToolchain( androidBuilder.getTargetInfo().getBuildTools(), androidBuilder.getLogger(), androidBuilder.getErrorReporter()); toolchain.convert(options, androidBuilder.getJavaProcessExecutor(), jackInProcess); }