com.android.ide.common.process.ProcessException Java Examples

The following examples show how to use com.android.ide.common.process.ProcessException. 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 check out the related API usage on the sidebar.
Example #1
Source File: GradleProcessExecutor.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
@NonNull
@Override
public ProcessResult execute(
        @NonNull ProcessInfo processInfo,
        @NonNull ProcessOutputHandler processOutputHandler) {
    ProcessOutput output = processOutputHandler.createOutput();

    final ExecResult result = project.exec(new ExecAction(processInfo, output));

    try {
        processOutputHandler.handleOutput(output);
    } catch (final ProcessException e) {
        return new OutputHandlerFailedGradleProcessResult(e);
    }

    return new GradleProcessResult(result);
}
 
Example #2
Source File: GradleJavaProcessExecutor.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
@NonNull
@Override
public ProcessResult execute(
        @NonNull JavaProcessInfo javaProcessInfo,
        @NonNull ProcessOutputHandler processOutputHandler) {
    ProcessOutput output = processOutputHandler.createOutput();

    ExecResult result = project.javaexec(new ExecAction(javaProcessInfo, output));

    try {
        processOutputHandler.handleOutput(output);
    } catch (ProcessException e) {
        return new OutputHandlerFailedGradleProcessResult(e);
    }

    return new GradleProcessResult(result);
}
 
Example #3
Source File: AidlCompile.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Compiles a single file.
 *
 * @param sourceFolder            the file to compile.
 * @param file                    the file to compile.
 * @param importFolders           the import folders.
 * @param dependencyFileProcessor a DependencyFileProcessor
 */
private void compileSingleFile(
        @NonNull File sourceFolder,
        @NonNull File file,
        @Nullable List<File> importFolders,
        @NonNull DependencyFileProcessor dependencyFileProcessor,
        @NonNull ProcessOutputHandler processOutputHandler)
        throws InterruptedException, ProcessException, LoggedErrorException, IOException {
    getBuilder().compileAidlFile(
            sourceFolder,
            file,
            getSourceOutputDir(),
            getAidlParcelableDir(),
            importFolders,
            dependencyFileProcessor,
            processOutputHandler);
}
 
Example #4
Source File: Dex.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
private void doTaskAction(@Nullable Collection<File> inputFiles, @Nullable File inputDir) throws IOException, ProcessException, InterruptedException {
    File outFolder = getOutputFolder();
    FileUtils.emptyFolder(outFolder);


    File tmpFolder = getTmpFolder();
    tmpFolder.mkdirs();

    // if some of our .jar input files exist, just reset the inputDir to null
    for (File inputFile : inputFiles) {
        if (inputFile.exists()) {
            inputDir = null;
        }

    }

    if (inputDir != null) {
        inputFiles = getProject().files(inputDir).getFiles();
    }


    getBuilder().convertByteCode(inputFiles, getLibraries(), outFolder, getMultiDexEnabled(),
            getMainDexListFile(), getDexOptions(), getAdditionalParameters(), tmpFolder,
            false, getOptimize(), new LoggedProcessOutputHandler(getILogger()));
}
 
Example #5
Source File: AndroidBuilder.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Converts the bytecode to Dalvik format
 *
 * @param inputFile  the input file
 * @param outFile    the output file or folder if multi-dex is enabled.
 * @param multiDex   whether multidex is enabled.
 * @param dexOptions dex options
 * @throws IOException
 * @throws InterruptedException
 * @throws ProcessException
 */
public void preDexLibrary(
        @NonNull File inputFile,
        @NonNull File outFile,
        boolean multiDex,
        @NonNull DexOptions dexOptions,
        @NonNull ProcessOutputHandler processOutputHandler)
        throws IOException, InterruptedException, ProcessException {
    checkState(mTargetInfo != null,
            "Cannot call preDexLibrary() before setTargetInfo() is called.");

    BuildToolInfo buildToolInfo = mTargetInfo.getBuildTools();

    PreDexCache.getCache().preDexLibrary(
            inputFile,
            outFile,
            multiDex,
            dexOptions,
            buildToolInfo,
            mVerboseExec,
            mJavaProcessExecutor,
            processOutputHandler);
}
 
Example #6
Source File: DexWrapperHook.java    From atlas with Apache License 2.0 6 votes vote down vote up
public static ProcessResult run(
            @NonNull DexProcessBuilder processBuilder,
            @NonNull DexOptions dexOptions,
            @NonNull ProcessOutputHandler outputHandler) throws IOException, ProcessException {
        ProcessOutput output = outputHandler.createOutput();
        int res;
        try {
//            DxConsole.out = outputHandler.createOutput().getStandardOutput();
//            DxConsole.err = outputHandler.createOutput().getErrorOutput();
            DxConsole dxConsole = new DxConsole();
            Main.Arguments args = buildArguments(processBuilder, dexOptions, dxConsole);
            res = new Main().run(args);
        } finally {
            output.close();
        }

        outputHandler.handleOutput(output);
        return new DexProcessResult(res);
    }
 
Example #7
Source File: AaptCruncher.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Runs the aapt crunch command on a single file
 *
 * @param key the request key.
 * @param from the file to crunch
 * @param to the output file
 * @throws PngException
 */
@Override
public void crunchPng(int key, @NonNull File from, @NonNull File to) throws PngException {

    try {
        ProcessInfo processInfo = new ProcessInfoBuilder()
                .setExecutable(mAaptLocation)
                .addArgs("s",
                        "-i",
                        from.getAbsolutePath(),
                        "-o",
                        to.getAbsolutePath()).createProcess();

        ProcessResult result = mProcessExecutor.execute(processInfo, mProcessOutputHandler);

        result.rethrowFailure().assertNormalExitValue();
    } catch (ProcessException e) {
        throw new PngException(e);
    }
}
 
Example #8
Source File: ApkInfoParser.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns the aapt output.
 *
 * @param apkFile the apk file to call aapt on.
 * @return the output as a list of files.
 * @throws ProcessException
 */
@NonNull
private List<String> getAaptOutput(@NonNull File apkFile)
        throws ProcessException {
    ProcessInfoBuilder builder = new ProcessInfoBuilder();

    builder.setExecutable(mAaptFile);
    builder.addArgs("dump", "badging", apkFile.getPath());

    CachedProcessOutputHandler processOutputHandler = new CachedProcessOutputHandler();

    mProcessExecutor.execute(
            builder.createProcess(), processOutputHandler)
            .rethrowFailure().assertNormalExitValue();

    BaseProcessOutputHandler.BaseProcessOutput output = processOutputHandler.getProcessOutput();

    return Splitter.on(SdkUtils.getLineSeparator()).splitToList(output.getStandardOutputAsString());
}
 
Example #9
Source File: ProcessResultImpl.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
@Override
public ProcessResult rethrowFailure() throws ProcessException {
    if (mFailure != null) {
        throw new ProcessException("", mFailure);
    }

    return this;
}
 
Example #10
Source File: ParsingProcessOutputHandler.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void handleOutput(@NonNull ProcessOutput processOutput) throws ProcessException {
    if (!(processOutput instanceof BaseProcessOutput)) {
        throw new IllegalArgumentException("processOutput was not created by this handler.");
    }
    BaseProcessOutput impl = (BaseProcessOutput) processOutput;
    String stdout = impl.getStandardOutputAsString();
    if (!stdout.isEmpty()) {
        outputMessages(mStdoutToolOutputParser.parseToolOutput(stdout));
    }
    String stderr = impl.getErrorOutputAsString();
    if (!stderr.isEmpty()) {
        outputMessages(mErrorToolOutputParser.parseToolOutput(stderr));
    }
}
 
Example #11
Source File: SourceSearcher.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
public void search(@NonNull SourceFileProcessor processor)
        throws ProcessException, LoggedErrorException, InterruptedException, IOException {
    for (File file : mSourceFolders) {
        // pass both the root folder (the source folder) and the file/folder to process,
        // in this case the source folder as well.
        processFile(file, file, processor);
    }

    if (mExecutor != null) {
        mExecutor.waitForTasksWithQuickFail(true /*cancelRemaining*/);
    }
}
 
Example #12
Source File: DesugarTask.java    From javafxmobile-plugin with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private void cacheMissAction(
        @Nullable FileCache cache,
        @Nullable FileCache.Inputs inputs,
        @NonNull Path input,
        @NonNull Path output)
        throws IOException, ProcessException {
    // add it to the list of cache misses, that will be processed
    cacheMisses.add(new InputEntry(cache, inputs, input, output));
}
 
Example #13
Source File: CreateMainDexList.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
@TaskAction
public void output() throws IOException, ProcessException {
    if (getAllClassesJarFile() == null) {
        throw new NullPointerException("No input file");
    }


    // manifest components plus immediate dependencies must be in the main dex.
    File _allClassesJarFile = getAllClassesJarFile();
    Set<String> mainDexClasses = callDx(_allClassesJarFile, getComponentsJarFile());

    // add additional classes specified via a jar file.
    File _includeInMainDexJarFile = getIncludeInMainDexJarFile();
    if (_includeInMainDexJarFile != null) {
        // proguard shrinking is overly aggressive when it comes to removing
        // interface classes: even if an interface is implemented by a concrete
        // class, if no code actually references the interface class directly
        // (i.e., code always references the concrete class), proguard will
        // remove the interface class when shrinking.  This is problematic,
        // as the runtime verifier still needs the interface class to be
        // present, or the concrete class won't be valid.  Use a
        // ClassReferenceListBuilder here (only) to pull in these missing
        // interface classes.  Note that doing so brings in other unnecessary
        // stuff, too; next time we're low on main dex space, revisit this!
        mainDexClasses.addAll(callDx(_allClassesJarFile, _includeInMainDexJarFile));
    }


    if (mainDexListFile != null) {
        Set<String> mainDexList = new HashSet<String>(Files.readLines(mainDexListFile, Charsets.UTF_8));
        mainDexClasses.addAll(mainDexList);
    }


    String fileContent = Joiner.on(System.getProperty("line.separator")).join(mainDexClasses);

    Files.write(fileContent, getOutputFile(), Charsets.UTF_8);
}
 
Example #14
Source File: AidlCompile.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Action methods to compile all the files.
 * <p>
 * The method receives a {@link DependencyFileProcessor} to be used by the
 * {@link com.android.builder.internal.compiler.SourceSearcher.SourceFileProcessor} during
 * the compilation.
 *
 * @param dependencyFileProcessor a DependencyFileProcessor
 */
private void compileAllFiles(DependencyFileProcessor dependencyFileProcessor)
        throws InterruptedException, ProcessException, LoggedErrorException, IOException {
    getBuilder().compileAllAidlFiles(
            getSourceDirs(),
            getSourceOutputDir(),
            getAidlParcelableDir(),
            getImportDirs(),
            dependencyFileProcessor,
            new LoggedProcessOutputHandler(getILogger()));
}
 
Example #15
Source File: SourceSearcher.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
private void processFile(
        @NonNull final File rootFolder,
        @NonNull final File file,
        @NonNull final SourceFileProcessor processor)
        throws ProcessException, IOException {
    if (file.isFile()) {
        // get the extension of the file.
        if (checkExtension(file)) {
            if (mExecutor != null) {
                mExecutor.execute(new Callable<Void>() {
                    @Override
                    public Void call() throws Exception {
                        processor.processFile(rootFolder, file);
                        return null;
                    }
                });
            } else {
                processor.processFile(rootFolder, file);
            }
        }
    } else if (file.isDirectory()) {
        File[] children = file.listFiles();
        if (children != null) {
            for (File child : children) {
                processFile(rootFolder, child, processor);
            }
        }
    }
}
 
Example #16
Source File: AtlasDesugarTransform.java    From atlas with Apache License 2.0 5 votes vote down vote up
private void processNonCachedOnesWithGradleExecutor(
        WorkerExecutor workerExecutor, List<Path> classpath)
        throws IOException, ProcessException, ExecutionException {
    List<Path> desugarBootclasspath = getBootclasspath();
    for (AtlasDesugarTransform.InputEntry pathPathEntry : cacheMisses) {
        DesugarWorkerItem workerItem =
                new DesugarWorkerItem(
                        desugarJar.get(),
                        PathUtils.createTmpDirToRemoveOnShutdown("gradle_lambdas"),
                        true,
                        pathPathEntry.getInputPath(),
                        pathPathEntry.getOutputPath(),
                        classpath,
                        desugarBootclasspath,
                        minSdk);

        workerExecutor.submit(DesugarWorkerItem.DesugarAction.class, workerItem::configure);
    }

    workerExecutor.await();

    for (AtlasDesugarTransform.InputEntry e : cacheMisses) {
        if (e.getCache() != null && e.getInputs() != null) {
            e.getCache()
                    .createFileInCacheIfAbsent(
                            e.getInputs(), in -> Files.copy(e.getOutputPath(), in.toPath()));
        }
    }
}
 
Example #17
Source File: Dex.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Actual entry point for the action.
 * Calls out to the doTaskAction as needed.
 */
@TaskAction
public void taskAction() throws IOException, InterruptedException, ProcessException {
    Collection<File> _inputFiles = getInputFiles();
    File _inputDir = getInputDir();
    if (_inputFiles == null && _inputDir == null) {
        throw new RuntimeException("Dex task \'" + getName() + ": inputDir and inputFiles cannot both be null");
    }

    doTaskAction(_inputFiles, _inputDir);
}
 
Example #18
Source File: GradleProcessResult.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
@Override
public ProcessResult assertNormalExitValue() throws ProcessException {
    try {
        result.assertNormalExitValue();
    } catch (ExecException e) {
        throw new ProcessException(e);
    }

    return this;
}
 
Example #19
Source File: ProcessResultImpl.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
@Override
public ProcessResult assertNormalExitValue() throws ProcessException {
    if (mExitValue != 0) {
        throw new ProcessException(
                String.format("Return code %d for process '%s'", mExitValue, mCommand));
    }

    return this;
}
 
Example #20
Source File: GradleProcessResult.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
@Override
public ProcessResult rethrowFailure() throws ProcessException {
    try {
        result.rethrowFailure();
    } catch (ExecException e) {
        throw new ProcessException(e);
    }
    return this;
}
 
Example #21
Source File: AndroidBuilder.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Compiles the given aidl file.
 *
 * @param aidlFile                the AIDL file to compile
 * @param sourceOutputDir         the output dir in which to generate the source code
 * @param importFolders           all the import folders, including the source folders.
 * @param dependencyFileProcessor the dependencyFileProcessor to record the dependencies
 *                                of the compilation.
 * @throws IOException
 * @throws InterruptedException
 * @throws LoggedErrorException
 */
public void compileAidlFile(@NonNull File sourceFolder,
                            @NonNull File aidlFile,
                            @NonNull File sourceOutputDir,
                            @Nullable File parcelableOutputDir,
                            @NonNull List<File> importFolders,
                            @Nullable DependencyFileProcessor dependencyFileProcessor,
                            @NonNull ProcessOutputHandler processOutputHandler)
        throws IOException, InterruptedException, LoggedErrorException, ProcessException {
    checkNotNull(aidlFile, "aidlFile cannot be null.");
    checkNotNull(sourceOutputDir, "sourceOutputDir cannot be null.");
    checkNotNull(importFolders, "importFolders cannot be null.");
    checkState(mTargetInfo != null,
            "Cannot call compileAidlFile() before setTargetInfo() is called.");

    IAndroidTarget target = mTargetInfo.getTarget();
    BuildToolInfo buildToolInfo = mTargetInfo.getBuildTools();

    String aidl = buildToolInfo.getPath(BuildToolInfo.PathId.AIDL);
    if (aidl == null || !new File(aidl).isFile()) {
        throw new IllegalStateException("aidl is missing");
    }

    AidlProcessor processor = new AidlProcessor(
            aidl,
            target.getPath(IAndroidTarget.ANDROID_AIDL),
            importFolders,
            sourceOutputDir,
            parcelableOutputDir,
            dependencyFileProcessor != null ?
                    dependencyFileProcessor : sNoOpDependencyFileProcessor,
            mProcessExecutor,
            processOutputHandler);

    processor.processFile(sourceFolder, aidlFile);
}
 
Example #22
Source File: TaobaoInstantRunDex.java    From atlas with Apache License 2.0 5 votes vote down vote up
@VisibleForTesting
protected void convertByteCode(List<File> inputFiles, File outputFolder)
        throws InterruptedException, ProcessException, IOException {
    dexByteCodeConverter
            .convertByteCode(
                    inputFiles,
                    outputFolder,
                    false /* multiDexEnabled */,
                    null /*getMainDexListFile */,
                    dexOptions,
                    new LoggedProcessOutputHandler(logger),
                    minSdkForDx);
}
 
Example #23
Source File: AndroidBuilder.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
public Set<String> createMainDexList(
        @NonNull File allClassesJarFile,
        @NonNull File jarOfRoots) throws ProcessException {

    BuildToolInfo buildToolInfo = mTargetInfo.getBuildTools();
    ProcessInfoBuilder builder = new ProcessInfoBuilder();

    String dx = buildToolInfo.getPath(BuildToolInfo.PathId.DX_JAR);
    if (dx == null || !new File(dx).isFile()) {
        throw new IllegalStateException("dx.jar is missing");
    }

    builder.setClasspath(dx);
    builder.setMain("com.android.multidex.ClassReferenceListBuilder");

    builder.addArgs(jarOfRoots.getAbsolutePath());
    builder.addArgs(allClassesJarFile.getAbsolutePath());

    CachedProcessOutputHandler processOutputHandler = new CachedProcessOutputHandler();

    mJavaProcessExecutor.execute(builder.createJavaProcess(), processOutputHandler)
            .rethrowFailure()
            .assertNormalExitValue();

    String content = processOutputHandler.getProcessOutput().getStandardOutputAsString();

    return Sets.newHashSet(Splitter.on('\n').split(content));
}
 
Example #24
Source File: AtlasDesugarTransform.java    From atlas with Apache License 2.0 5 votes vote down vote up
private void cacheMissAction(
        @Nullable FileCache cache,
        @Nullable FileCache.Inputs inputs,
        @NonNull Path input,
        @NonNull Path output)
        throws IOException, ProcessException {
    logger.info("process desugar miss cache:" + input.toFile().getAbsolutePath());

    // add it to the list of cache misses, that will be processed
    cacheMisses.add(new AtlasDesugarTransform.InputEntry(cache, inputs, input, output));
}
 
Example #25
Source File: DexWrapperHook.java    From atlas with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public ProcessResult assertNormalExitValue()
        throws ProcessException {
    if (mExitValue != 0) {
        throw new ProcessException(
                String.format("Return code %d for dex process", mExitValue));
    }

    return this;
}
 
Example #26
Source File: ApkInfoParser.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Computes and returns the info for an APK
 *
 * @param apkFile the APK to parse
 * @return a non-null ApkInfo object.
 * @throws ProcessException
 */
@NonNull
public ApkInfo parseApk(@NonNull File apkFile)
        throws ProcessException {

    if (!mAaptFile.isFile()) {
        throw new IllegalStateException(
                "aapt is missing from location: " + mAaptFile.getAbsolutePath());
    }

    return getApkInfo(getAaptOutput(apkFile));
}
 
Example #27
Source File: PreDexCache.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Pre-dex a given library to a given output with a specific version of the build-tools.
 * @param inputFile the jar to pre-dex
 * @param outFile the output file or folder (if multi-dex is enabled). must exist
 * @param multiDex whether mutli-dex is enabled.
 * @param dexOptions the dex options to run pre-dex
 * @param buildToolInfo the build tools info
 * @param verbose verbose flag
 * @param processExecutor the process executor
 * @throws IOException
 * @throws ProcessException
 * @throws InterruptedException
 */
public void preDexLibrary(
        @NonNull File inputFile,
        @NonNull File outFile,
                 boolean multiDex,
        @NonNull DexOptions dexOptions,
        @NonNull BuildToolInfo buildToolInfo,
        boolean verbose,
        @NonNull JavaProcessExecutor processExecutor,
        @NonNull ProcessOutputHandler processOutputHandler)
        throws IOException, ProcessException, InterruptedException {
    checkState(!multiDex || outFile.isDirectory());

    DexKey itemKey = DexKey.of(
            inputFile,
            buildToolInfo.getRevision());

    Pair<Item, Boolean> pair = getItem(itemKey);
    Item item = pair.getFirst();

    // if this is a new item
    if (pair.getSecond()) {
        try {
            // haven't process this file yet so do it and record it.
            List<File> files = AndroidBuilder.preDexLibrary(
                    inputFile,
                    outFile,
                    multiDex,
                    dexOptions,
                    buildToolInfo,
                    verbose,
                    processExecutor,
                    processOutputHandler);

            item.getOutputFiles().clear();
            item.getOutputFiles().addAll(files);

            incrementMisses();
        } catch (ProcessException exception) {
            // in case of error, delete (now obsolete) output file
            outFile.delete();
            // and rethrow the error
            throw exception;
        } finally {
            // enable other threads to use the output of this pre-dex.
            // if something was thrown they'll handle the missing output file.
            item.getLatch().countDown();
        }
    } else {
        // wait until the file is pre-dexed by the first thread.
        item.getLatch().await();

        // check that the generated file actually exists
        if (item.areOutputFilesPresent()) {
            if (multiDex) {
                // output should be a folder
                for (File sourceFile : item.getOutputFiles()) {
                    File destFile = new File(outFile, sourceFile.getName());
                    checkSame(sourceFile, destFile);
                    Files.copy(sourceFile, destFile);
                }

            } else {
                // file already pre-dex, just copy the output.
                if (item.getOutputFiles().isEmpty()) {
                    throw new RuntimeException(item.toString());
                }
                checkSame(item.getOutputFiles().get(0), outFile);
                Files.copy(item.getOutputFiles().get(0), outFile);
            }
            incrementHits();

        }
    }
}
 
Example #28
Source File: AidlProcessor.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void processFile(@NonNull File sourceFolder, @NonNull File sourceFile)
        throws ProcessException, IOException {
    ProcessInfoBuilder builder = new ProcessInfoBuilder();

    builder.setExecutable(mAidlExecutable);

    builder.addArgs("-p" + mFrameworkLocation);
    builder.addArgs("-o" + mSourceOutputDir.getAbsolutePath());

    // add all the library aidl folders to access parcelables that are in libraries
    for (File f : mImportFolders) {
        builder.addArgs("-I" + f.getAbsolutePath());
    }

    // create a temp file for the dependency
    File depFile = File.createTempFile("aidl", ".d");
    builder.addArgs("-d" + depFile.getAbsolutePath());

    builder.addArgs(sourceFile.getAbsolutePath());

    ProcessResult result = mProcessExecutor.execute(
            builder.createProcess(), mProcessOutputHandler);
    result.rethrowFailure().assertNormalExitValue();

    // send the dependency file to the processor.
    DependencyData data = mDependencyFileProcessor.processFile(depFile);

    if (mParcelableOutputDir != null && data != null && data.getOutputFiles().isEmpty()) {
        // looks like a parcelable. Store it in the 2ndary output of the DependencyData object.

        String relative = FileOp.makeRelative(sourceFolder, sourceFile);

        File destFile = new File(mParcelableOutputDir, relative);
        destFile.getParentFile().mkdirs();
        Files.copy(sourceFile, destFile);
        data.addSecondaryOutputFile(destFile.getPath());
    }

    depFile.delete();
}
 
Example #29
Source File: SourceSearcher.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
void processFile(@NonNull File sourceFolder, @NonNull File sourceFile)
throws ProcessException, IOException;
 
Example #30
Source File: CreateMainDexList.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
private Set<String> callDx(File allClassesJarFile, File jarOfRoots) throws ProcessException {
    return getBuilder().createMainDexList(allClassesJarFile, jarOfRoots);
}