Java Code Examples for org.gradle.language.base.internal.compile.Compiler#execute()

The following examples show how to use org.gradle.language.base.internal.compile.Compiler#execute() . 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: CompilerDaemonServer.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public <T extends CompileSpec> void execute(Compiler<T> compiler, T spec) {
    try {
        LOGGER.info("Executing {} in compiler daemon.", compiler);
        WorkResult result = compiler.execute(spec);
        LOGGER.info("Successfully executed {} in compiler daemon.", compiler);
        client.executed(new CompileResult(result.getDidWork(), null));
    } catch (Throwable t) {
        LOGGER.info("Exception executing {} in compiler daemon: {}.", compiler, t);
        client.executed(new CompileResult(true, t));
    }
}
 
Example 2
Source File: Javadoc.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void executeExternalJavadoc() {
    JavadocSpec spec = new JavadocSpec();
    spec.setExecutable(executable);
    spec.setOptions(options);
    spec.setIgnoreFailures(!failOnError);
    spec.setWorkingDir(getProject().getProjectDir());
    spec.setOptionsFile(getOptionsFile());

    Compiler<JavadocSpec> generator = ((JavaToolChainInternal) getToolChain()).select(null).newCompiler(spec);
    generator.execute(spec);
}
 
Example 3
Source File: CleaningJavaCompilerSupport.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public WorkResult execute(T spec) {
    StaleClassCleaner cleaner = createCleaner(spec);

    cleaner.setDestinationDir(spec.getDestinationDir());
    cleaner.setSource(spec.getSource());
    cleaner.execute();

    Compiler<? super T> compiler = getCompiler();
    return compiler.execute(spec);
}
 
Example 4
Source File: CompilerDaemonServer.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public <T extends CompileSpec> void execute(Compiler<T> compiler, T spec) {
    try {
        LOGGER.info("Executing {} in compiler daemon.", compiler);
        WorkResult result = compiler.execute(spec);
        LOGGER.info("Successfully executed {} in compiler daemon.", compiler);
        client.executed(new CompileResult(result.getDidWork(), null));
    } catch (Throwable t) {
        LOGGER.info("Exception executing {} in compiler daemon: {}.", compiler, t);
        client.executed(new CompileResult(true, t));
    }
}
 
Example 5
Source File: Javadoc.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void executeExternalJavadoc() {
    JavadocSpec spec = new JavadocSpec();
    spec.setExecutable(executable);
    spec.setOptions(options);
    spec.setIgnoreFailures(!failOnError);
    spec.setWorkingDir(getProject().getProjectDir());
    spec.setOptionsFile(getOptionsFile());

    Compiler<JavadocSpec> generator = ((JavaToolChainInternal) getToolChain()).select(null).newCompiler(spec);
    generator.execute(spec);
}
 
Example 6
Source File: CleaningJavaCompilerSupport.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public WorkResult execute(T spec) {
    StaleClassCleaner cleaner = createCleaner(spec);

    cleaner.setDestinationDir(spec.getDestinationDir());
    cleaner.setSource(spec.getSource());
    cleaner.execute();

    Compiler<? super T> compiler = getCompiler();
    return compiler.execute(spec);
}
 
Example 7
Source File: ZincScalaCompiler.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WorkResult execute(ScalaJavaJointCompileSpec spec) {
    return Compiler.execute(spec);
}
 
Example 8
Source File: JavaCompile.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private void performCompilation(JavaCompileSpec spec, Compiler<JavaCompileSpec> compiler) {
    WorkResult result = compiler.execute(spec);
    setDidWork(result.getDidWork());
}
 
Example 9
Source File: ZincScalaCompiler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public WorkResult execute(ScalaJavaJointCompileSpec spec) {
    return Compiler.execute(spec);
}
 
Example 10
Source File: JavaCompile.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private void performCompilation(JavaCompileSpec spec, Compiler<JavaCompileSpec> compiler) {
    WorkResult result = compiler.execute(spec);
    setDidWork(result.getDidWork());
}