@Override String executeProcess(ProcessInfoBuilder processBuilder) throws ProcessException, IOException { return ExternalNativeBuildTaskUtils .executeBuildProcessAndLogError( androidBuilder, processBuilder, true /* logStdioToInfo */); }
@Override String executeProcess(ProcessInfoBuilder processBuilder) throws ProcessException, IOException { return ExternalNativeBuildTaskUtils .executeBuildProcessAndLogError( androidBuilder, processBuilder, false /* logStdioToInfo */); }
/** * Given a list of build commands, execute each. If there is a failure, processing is stopped at * that point. */ protected void executeProcessBatch(@NonNull List<String> commands, @NonNull List<String> targetNames) throws ProcessException, IOException { for (int commandIndex = 0; commandIndex < commands.size(); ++commandIndex) { String command = commands.get(commandIndex); String target = targetNames.get(commandIndex); getLogger().lifecycle(String.format("Clean %s", target)); List<String> tokens = StringHelper.tokenizeString(command); ProcessInfoBuilder processBuilder = new ProcessInfoBuilder(); processBuilder.setExecutable(tokens.get(0)); for (int i = 1; i < tokens.size(); ++i) { processBuilder.addArgs(tokens.get(i)); } diagnostic("%s", processBuilder); ExternalNativeBuildTaskUtils.executeBuildProcessAndLogError( getBuilder(), processBuilder, true /* logStdioToInfo */); } }
/** * Given a list of build commands, execute each. If there is a failure, processing is stopped at * that point. */ protected void executeProcessBatch( @NonNull List<String> libraryNames, @NonNull List<String> commands) throws BuildCommandException, IOException { // Order of building doesn't matter to final result but building in reverse order causes // the dependencies to be built first for CMake and ndk-build. This gives better progress // visibility to the user because they will see "building XXXXX.a" before // "building XXXXX.so". Nicer still would be to have the dependency information in the JSON // so we can build in toposort order. for (int library = libraryNames.size() - 1; library >= 0; --library) { String libraryName = libraryNames.get(library); getLogger().lifecycle(String.format("Build %s", libraryName)); String command = commands.get(library); List<String> tokens = StringHelper.tokenizeString(command); ProcessInfoBuilder processBuilder = new ProcessInfoBuilder(); processBuilder.setExecutable(tokens.get(0)); for (int i = 1; i < tokens.size(); ++i) { processBuilder.addArgs(tokens.get(i)); } diagnostic("%s", processBuilder); ExternalNativeBuildTaskUtils.executeBuildProcessAndLogError( getBuilder(), processBuilder, true /* logStdioToInfo */); } }