Package org.gradle.api.internal

Examples of org.gradle.api.internal.TaskInternal


        assertFalse(state.isUpToDate());
    }

    @Test
    public void inputPropertyValueCanBeNull() {
        TaskInternal task = builder().withProperty("prop", null).task();
        execute(task);

        TaskArtifactState state = repository.getStateFor(task);
        assertTrue(state.isUpToDate());
    }
View Full Code Here


    public void artifactsAreNotUpToDateWhenOutputDirWhichUsedToExistHasBeenDeleted() {
        // Output dir already exists before first execution of task
        outputDirFile.createFile();
        expectEmptyCacheLocated();

        TaskInternal task1 = builder().withOutputFiles(outputDir).createsFiles(outputDirFile).task();
        TaskInternal task2 = builder().withPath("other").withOutputFiles(outputDir).createsFiles(outputDirFile2).task();

        TaskArtifactState state = repository.getStateFor(task1);
        assertFalse(state.isUpToDate());
        state.update();

        outputDir.deleteDir();

        // Another task creates dir
        state = repository.getStateFor(task2);
        assertFalse(state.isUpToDate());
        task2.execute();
        state.update();

        // Task should be out-of-date
        state = repository.getStateFor(task1);
        assertFalse(state.isUpToDate());
View Full Code Here

        assertThat(state.getOutputFiles().getFiles(), equalTo(toLinkedSet((File) outputFile, outputDirFile, outputDirFile2)));
    }

    @Test
    public void multipleTasksCanProduceFilesIntoTheSameOutputDirectory() {
        TaskInternal task1 = task();
        TaskInternal task2 = builder().withPath("other").withOutputFiles(outputDir).createsFiles(outputDir.file("output2")).task();
        execute(task1, task2);

        TaskArtifactState state = repository.getStateFor(task1);
        assertTrue(state.isUpToDate());
View Full Code Here

        assertTrue(state.isUpToDate());
    }

    @Test
    public void multipleTasksCanProduceTheSameFileWithTheSameContents() {
        TaskInternal task1 = builder().withOutputFiles(outputFile).task();
        TaskInternal task2 = builder().withPath("other").withOutputFiles(outputFile).task();
        execute(task1, task2);

        TaskArtifactState state = repository.getStateFor(task1);
        assertTrue(state.isUpToDate());
View Full Code Here

        assertTrue(state.isUpToDate());
    }

    @Test
    public void multipleTasksCanProduceTheSameEmptyDir() {
        TaskInternal task1 = task();
        TaskInternal task2 = builder().withPath("other").withOutputFiles(outputDir).task();
        execute(task1, task2);

        TaskArtifactState state = repository.getStateFor(task1);
        assertTrue(state.isUpToDate());
View Full Code Here

    public void considersExistingFileInOutputDirectoryWhichIsUpdatedByTheTaskAsProducedByTask() {
        expectEmptyCacheLocated();
       
        TestFile otherFile = outputDir.file("other").createFile();

        TaskInternal task = task();
        TaskArtifactState state = repository.getStateFor(task);
        assertFalse(state.isUpToDate());

        task.execute();
        otherFile.write("new content");

        state.update();

        otherFile.delete();
View Full Code Here

        state.update();
    }

    @Test
    public void artifactsAreUpToDateWhenTaskDoesNotAcceptAnyInputs() {
        TaskInternal task = builder().doesNotAcceptInput().task();
        execute(task);

        TaskArtifactState state = repository.getStateFor(task);
        assertTrue(state.isUpToDate());
View Full Code Here

        assertFalse(state.isUpToDate());
    }

    @Test
    public void artifactsAreNotUpToDateWhenTaskDoesNotProduceAnyOutputs() {
        TaskInternal task = builder().doesNotProduceOutput().task();
        execute(task);

        TaskArtifactState state = repository.getStateFor(task);
        assertFalse(state.isUpToDate());
    }
View Full Code Here

        assertFalse(state.isUpToDate());
    }

    @Test
    public void taskHistoryIsEmptyWhenTaskDoesNotProduceAnyOutout() {
        TaskInternal task = builder().doesNotProduceOutput().task();
        execute(task);

        TaskArtifactState state = repository.getStateFor(task);
        assertFalse(state.isUpToDate());
        assertThat(state.getOutputFiles(), isEmpty());
View Full Code Here

        assertThat(state.getOutputFiles(), isEmpty());
    }

    @Test
    public void artifactsAreUpToDateWhenTaskHasNoInputFiles() {
        TaskInternal task = builder().withInputFiles().task();
        execute(task);

        TaskArtifactState state = repository.getStateFor(task);
        assertTrue(state.isUpToDate());
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.internal.TaskInternal

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.