Package org.gradle.api.tasks

Examples of org.gradle.api.tasks.WorkResult


    }

    public void testExecute(final int numFilesCompiled) {
        setUpMocksAndAttributes(testObj, TEST_GROOVY_CLASSPATH);
        context.checking(new Expectations(){{
            WorkResult result = context.mock(WorkResult.class);

            one(groovyCompilerMock).setSource(with(hasSameItems(testObj.getSource())));
            one(groovyCompilerMock).setDestinationDir(testObj.getDestinationDir());
            one(groovyCompilerMock).setClasspath(testObj.getClasspath());
            one(groovyCompilerMock).setSourceCompatibility(testObj.getSourceCompatibility());
View Full Code Here


    }

    public void testExecute(final int numFilesCompiled) {
        setUpMocksAndAttributes(compile);
        context.checking(new Expectations() {{
            WorkResult result = context.mock(WorkResult.class);

            one(compilerMock).setSource(with(hasSameItems(compile.getSource())));
            one(compilerMock).setClasspath(compile.getClasspath());
            one(compilerMock).setDestinationDir(compile.getDestinationDir());
            one(compilerMock).setDependencyCacheDir(compile.getDependencyCacheDir());
View Full Code Here

        javaCompiler.setDestinationDir(getDestinationDir());
        javaCompiler.setClasspath(getClasspath());
        javaCompiler.setDependencyCacheDir(getDependencyCacheDir());
        javaCompiler.setSourceCompatibility(getSourceCompatibility());
        javaCompiler.setTargetCompatibility(getTargetCompatibility());
        WorkResult result = javaCompiler.execute();
        setDidWork(result.getDidWork());
    }
View Full Code Here

        compiler.setDestinationDir(getDestinationDir());
        compiler.setClasspath(getClasspath());
        compiler.setSourceCompatibility(getSourceCompatibility());
        compiler.setTargetCompatibility(getTargetCompatibility());
        compiler.setGroovyClasspath(taskClasspath);
        WorkResult result = compiler.execute();
        setDidWork(result.getDidWork());
    }
View Full Code Here

        if (!javaSource.isEmpty()) {
            javaCompiler.setSource(javaSource);
            javaCompiler.execute();
        }

        return new WorkResult() {
            public boolean getDidWork() {
                return true;
            }
        };
    }
View Full Code Here

    }

    public void testExecute(final int numFilesCompiled) {
        setUpMocksAndAttributes(testObj, false);
        context.checking(new Expectations(){{
            WorkResult result = context.mock(WorkResult.class);

            one(groovyCompilerMock).execute((GroovyJavaJointCompileSpec) with(IsNull.notNullValue()));
            will(returnValue(result));
            allowing(result).getDidWork();
            will(returnValue(numFilesCompiled > 0));
View Full Code Here

    @TaskAction
    protected void compile() {
        checkGroovyClasspathIsNonEmpty();
        DefaultGroovyJavaJointCompileSpec spec = createSpec();
        WorkResult result = getCompiler(spec).execute(spec);
        setDidWork(result.getDidWork());
    }
View Full Code Here

        if (!javaSource.isEmpty()) {
            spec.setSource(javaSource);
            javaCompiler.execute(spec);
        }

        return new WorkResult() {
            public boolean getDidWork() {
                return true;
            }
        };
    }
View Full Code Here

    }

    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));
        }
    }
View Full Code Here

        return delegateCompiler.execute(spec);
    }

    protected WorkResult doCleanIncrementalCompile(NativeCompileSpec spec) {
        boolean deleted = cleanPreviousOutputs(spec);
        WorkResult compileResult = delegateCompiler.execute(spec);
        if (deleted && !compileResult.getDidWork()) {
            return new SimpleWorkResult(deleted);
        }
        return compileResult;
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.tasks.WorkResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.