@TaskAction public void proguard() throws ParseException, IOException { // Let the logging manager capture the standard output and errors from // ProGuard. LoggingManager loggingManager = getLogging(); loggingManager.captureStandardOutput(LogLevel.INFO); loggingManager.captureStandardError(LogLevel.WARN); // Run ProGuard with the collected configuration. new ProGuard(getConfiguration()).execute(); }
@TaskAction public void proguard() throws ParseException, IOException { // Let the logging manager capture the standard output and errors from // ProGuard. LoggingManager loggingManager = getLogging(); loggingManager.captureStandardOutput(LogLevel.INFO); loggingManager.captureStandardError(LogLevel.WARN); // Run ProGuard with the collected configuration. new ProGuard(getConfiguration()).execute(); }
@Override public void transform(@NonNull TransformInvocation invocation) throws IOException, TransformException, InterruptedException { // Re-direct the output to appropriate log levels, just like the official ProGuard task. LoggingManager loggingManager = invocation.getContext().getLogging(); loggingManager.captureStandardOutput(LogLevel.INFO); loggingManager.captureStandardError(LogLevel.WARN); try { File input = verifyInputs(invocation.getReferencedInputs()); shrinkWithProguard(input); computeList(input); } catch (ParseException | ProcessException e) { throw new TransformException(e); } }
private void configureJavaDoc(Project project) { final Action<Javadoc> action = task -> { task.setDescription("Generates project-level javadoc for use in -javadoc jar"); StandardJavadocDocletOptions options = (StandardJavadocDocletOptions) task.getOptions(); options.setMemberLevel(JavadocMemberLevel.PROTECTED); options.setAuthor(false); options.setHeader(project.getName()); options.links("http://docs.oracle.com/javase/8/docs/api/","http://docs.oracle.com/javaee/7/api/"); options.addStringOption("Xdoclint:none", "-quiet"); // Suppress warnings due to cross-module @see and @link references. project.getLogging().captureStandardError(LogLevel.INFO); project.getLogging().captureStandardOutput(LogLevel.INFO); }; final TaskCollection<Javadoc> javadocTasks = project.getTasks().withType(Javadoc.class); javadocTasks.all(action); }