input.getJarInputs().parallelStream().forEach(jarInput -> { File src = jarInput.getFile(); File dst = invocation.getOutputProvider().getContentLocation( jarInput.getName(), jarInput.getContentTypes(), jarInput.getScopes(), Format.JAR); input.getDirectoryInputs().parallelStream().forEach(directoryInput -> { File src = directoryInput.getFile(); File dst = invocation.getOutputProvider().getContentLocation( directoryInput.getName(), directoryInput.getContentTypes(), directoryInput.getScopes(), Format.DIRECTORY); File dest = invocation.getOutputProvider().getContentLocation( "WMRouter", TransformManager.CONTENT_CLASS, ImmutableSet.of(QualifiedContent.Scope.PROJECT), Format.DIRECTORY);
throws TransformException, InterruptedException, IOException { if (transformInvocation.getOutputProvider() == null) { throw new IllegalArgumentException("Transform invocation needs a valid output provider."); .getOutputProvider() .getContentLocation(TRANSFORM_OUTPUT, getOutputTypes(), getScopes(), Format.DIRECTORY); File outputJar = transformInvocation .getOutputProvider() .getContentLocation(inputJar.getName(), getOutputTypes(), getScopes(), Format.JAR); outputJar.getParentFile().mkdirs();
@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); }
private File classRootFor(String id) { return invocation.getOutputProvider().getContentLocation("capt-generated-by:" + id, Collections.singleton(QualifiedContent.DefaultContentType.CLASSES), Collections.singleton(QualifiedContent.Scope.EXTERNAL_LIBRARIES), Format.DIRECTORY); }
public void clearForFullMode() throws IOException { invocation.getOutputProvider().deleteAll(); FileUtils.deleteDirectory(variantRoot); } }
Util.deleteIFExists(invocation.getOutputProvider().getContentLocation( jar.getName(), jar.getContentTypes(), jar.getScopes(), Format.JAR)); File output = invocation.getOutputProvider().getContentLocation( jar.getName(), jar.getContentTypes(), jar.getScopes(), Format.JAR); zos = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(output)));
try { if (!transformInvocation.isIncremental()) { transformInvocation.getOutputProvider().deleteAll(); Path outDir = transformInvocation.getOutputProvider().getContentLocation( directoryInput.getName(), directoryInput.getContentTypes(),
@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); } }
@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); } }
super.transform(transformInvocation); Collection<TransformInput> inputs = transformInvocation.getInputs(); TransformOutputProvider outputProvider = transformInvocation.getOutputProvider(); if (outputProvider != null) outputProvider.deleteAll(); System.out.println("/////////////////////////begin inputs///////////////////////////////////");
TransformOutputProvider outputProvider = transformInvocation.getOutputProvider();
@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();
@Override public void transform(@NonNull TransformInvocation invocation) throws InterruptedException, IOException { final TransformOutputProvider outputProvider = invocation.getOutputProvider(); assert outputProvider != null;
transformInvocation.getOutputProvider(), transformInvocation.isIncremental());
InterruptedException, IOException { TransformOutputProvider outputProvider = transformInvocation.getOutputProvider(); checkNotNull(outputProvider);
@Override public void transform(@NonNull TransformInvocation transformInvocation) throws IOException, TransformException, InterruptedException { TransformOutputProvider outputProvider = transformInvocation.getOutputProvider(); boolean isIncremental = transformInvocation.isIncremental(); checkNotNull(outputProvider, "Missing output object for transform " + getName());
@Override public void transform(@NonNull TransformInvocation invocation) throws TransformException, IOException { TransformOutputProvider outputProvider = invocation.getOutputProvider(); checkNotNull(outputProvider, "Missing output object for transform " + getName());
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); }