Examples of TaskDependency


Examples of org.gradle.api.tasks.TaskDependency

    @Test
    public void buildArtifacts() {
        final Task otherConfTaskMock = context.mock(Task.class, "otherConfTask");
        final Task artifactTaskMock = context.mock(Task.class, "artifactTask");
        final Configuration otherConfiguration = context.mock(Configuration.class);
        final TaskDependency otherArtifactTaskDependencyMock = context.mock(TaskDependency.class, "otherConfTaskDep");
        final PublishArtifact otherArtifact = context.mock(PublishArtifact.class, "otherArtifact");
        final PublishArtifactSet inheritedArtifacts = new DefaultPublishArtifactSet("artifacts", toDomainObjectSet(PublishArtifact.class, otherArtifact));
        DefaultPublishArtifact artifact = createPublishArtifact("name1", "ext1", "type1", "classifier1");
        artifact.builtBy(artifactTaskMock);
        configuration.getArtifacts().add(artifact);
View Full Code Here

Examples of org.gradle.api.tasks.TaskDependency

    @Test
    public void getAllArtifactFiles() {
        final Task otherConfTaskMock = context.mock(Task.class, "otherConfTask");
        final Task artifactTaskMock = context.mock(Task.class, "artifactTask");
        final Configuration otherConfiguration = context.mock(Configuration.class);
        final TaskDependency otherConfTaskDependencyMock = context.mock(TaskDependency.class, "otherConfTaskDep");
        final TaskDependency artifactTaskDependencyMock = context.mock(TaskDependency.class, "artifactTaskDep");
        final File artifactFile1 = new File("artifact1");
        final File artifactFile2 = new File("artifact2");
        final PublishArtifact artifact = context.mock(PublishArtifact.class, "artifact");
        final PublishArtifact otherArtifact = context.mock(PublishArtifact.class, "otherArtifact");
        final PublishArtifactSet otherArtifacts = new DefaultPublishArtifactSet("artifacts", toDomainObjectSet(PublishArtifact.class, otherArtifact));
View Full Code Here

Examples of org.gradle.api.tasks.TaskDependency

        final Task fileDepTaskDummy = context.mock(Task.class, "fileDepTask");
        final ProjectDependency projectDependencyStub = context.mock(ProjectDependency.class);
        final FileCollectionDependency fileCollectionDependencyStub = context.mock(FileCollectionDependency.class);

        context.checking(new Expectations() {{
            TaskDependency projectTaskDependencyDummy = context.mock(TaskDependency.class, "projectDep");
            TaskDependency fileTaskDependencyStub = context.mock(TaskDependency.class, "fileDep");

            allowing(projectDependencyStub).getBuildDependencies();
            will(returnValue(projectTaskDependencyDummy));

            allowing(projectTaskDependencyDummy).getDependencies(target);
View Full Code Here

Examples of org.gradle.api.tasks.TaskDependency

    @Test
    public void buildDependenciesDelegatesToInheritedConfigurations() {
        final Task target = context.mock(Task.class, "target");
        final Task otherConfTaskMock = context.mock(Task.class, "otherConfTask");
        final TaskDependency dependencyTaskDependencyStub = context.mock(TaskDependency.class, "otherConfTaskDep");
        final Configuration otherConfiguration = context.mock(Configuration.class, "otherConf");
        final FileCollectionDependency fileCollectionDependencyStub = context.mock(FileCollectionDependency.class);
        final DependencySet inherited = new DefaultDependencySet("dependencies", toDomainObjectSet(Dependency.class, fileCollectionDependencyStub));

        context.checking(new Expectations() {{
View Full Code Here

Examples of org.gradle.api.tasks.TaskDependency

            // return null to mock not finding the given configuration
            allowing(configurationContainer).findByName(configName); will(returnValue(null));
        }});

        TaskDependency td = configuration.getTaskDependencyFromProjectDependency(false, taskName);
        assertThat(td.getDependencies(tdTask), equalTo(Collections.EMPTY_SET));
    }
View Full Code Here

Examples of org.gradle.api.tasks.TaskDependency

        final Task task2 = context.mock(Task.class, "task2");
        final Task task3 = context.mock(Task.class, "task3");
        final FileCollection source3 = context.mock(FileCollection.class, "source3");

        context.checking(new Expectations(){{
            TaskDependency dependency1 = context.mock(TaskDependency.class, "dep1");
            TaskDependency dependency2 = context.mock(TaskDependency.class, "dep2");
            TaskDependency dependency3 = context.mock(TaskDependency.class, "dep3");

            allowing(source1).getBuildDependencies();
            will(returnValue(dependency1));
            allowing(dependency1).getDependencies(target);
            will(returnValue(toSet(task1)));
            allowing(source2).getBuildDependencies();
            will(returnValue(dependency2));
            allowing(dependency2).getDependencies(target);
            will(returnValue(toSet(task2)));
            allowing(source3).getBuildDependencies();
            will(returnValue(dependency3));
            allowing(dependency3).getDependencies(target);
            will(returnValue(toSet(task3)));
        }});

        TaskDependency dependency = collection.getBuildDependencies();
        assertThat(dependency.getDependencies(target), equalTo((Set) toSet(task1, task2)));

        collection.sourceCollections.add(source3);

        assertThat(dependency.getDependencies(target), equalTo((Set) toSet(task1, task2, task3)));
    }
View Full Code Here

Examples of org.gradle.api.tasks.TaskDependency

        final Task target = context.mock(Task.class, "target");
        final Task task1 = context.mock(Task.class, "task1");
        final Task task2 = context.mock(Task.class, "task2");

        context.checking(new Expectations(){{
            TaskDependency dependency1 = context.mock(TaskDependency.class, "dep1");
            TaskDependency dependency2 = context.mock(TaskDependency.class, "dep2");

            one(source1).getBuildDependencies();
            will(returnValue(dependency1));
            one(dependency1).getDependencies(target);
            will(returnValue(toSet(task1)));
            one(source2).getBuildDependencies();
            will(returnValue(dependency2));
            one(dependency2).getDependencies(target);
            will(returnValue(toSet(task2)));
        }});

        TaskDependency dependency = collection.getBuildDependencies();
        assertThat(dependency.getDependencies(target), equalTo((Set) toSet(task1, task2)));
    }
View Full Code Here

Examples of org.gradle.api.tasks.TaskDependency

        final Task taskA = context.mock(Task.class, "a");
        final Task taskB = context.mock(Task.class, "b");
        context.checking(new Expectations() {{
            allowing(resolverMock).resolve("f");
            will(returnValue(new File("f")));
            TaskDependency dependency = context.mock(TaskDependency.class);
            allowing(fileCollectionMock).getBuildDependencies();
            will(returnValue(dependency));
            allowing(dependency).getDependencies(null);
            will(returnValue(toSet(taskA)));
            allowing(taskResolverStub).resolveTask("b");
View Full Code Here

Examples of org.gradle.api.tasks.TaskDependency

                connectedNodes.addAll(queue);
            } else if (node instanceof Buildable) {
                Buildable buildable = (Buildable) node;
                connectedNodes.add(buildable.getBuildDependencies());
            } else if (node instanceof TaskDependency) {
                TaskDependency dependency = (TaskDependency) node;
                values.addAll(dependency.getDependencies(task));
            } else if (node instanceof Task) {
                values.add((Task) node);
            } else {
                throw new IllegalArgumentException(String.format("Cannot resolve object of unknown type %s to a Task.",
                        node.getClass().getSimpleName()));
View Full Code Here

Examples of org.gradle.api.tasks.TaskDependency

        assertFalse(dependency.contentEquals(differentType));
    }

    @Test
    public void usesSourceFileCollectionToDetermineBuildDependencies() {
        final TaskDependency taskDependency = context.mock(TaskDependency.class);

        context.checking(new Expectations() {{
            allowing(source).getBuildDependencies();
            will(returnValue(taskDependency));
        }});
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.