@NonNull public ProcessResult executeProcess(@NonNull ProcessInfo processInfo) { return executeProcess(processInfo, mProcessOutputHandler); }
getBuilder().executeProcess(builder.createProcess(), handler) .rethrowFailure().assertNormalExitValue();
/** * Execute an external process and log the result in the case of a process exceptions. * Returns the info part of the log so that it can be parsed by ndk-build parser; * @throws BuildCommandException when the build failed. */ @NonNull public static String executeBuildProcessAndLogError( @NonNull AndroidBuilder androidBuilder, @NonNull ProcessInfoBuilder process, boolean logStdioToInfo) throws BuildCommandException, IOException { ProgressiveLoggingProcessOutputHandler handler = new ProgressiveLoggingProcessOutputHandler(androidBuilder.getLogger(), logStdioToInfo); try { // Log the command to execute but only in verbose (ie --info) androidBuilder.getLogger().verbose(process.toString()); androidBuilder.executeProcess(process.createProcess(), handler) .rethrowFailure().assertNormalExitValue(); return handler.getStandardOutputString(); } catch (ProcessException e) { // Also, add process output to the process exception so that it can be analyzed by // caller. Use combined stderr stdout instead of just stdout because compiler errors // go to stdout. String combinedMessage = String.format("%s\n%s", e.getMessage(), handler.getCombinedOutputString()); throw new BuildCommandException(combinedMessage); } }