Package org.gradle.api.artifacts

Examples of org.gradle.api.artifacts.Dependency


        assertThat(resolvedConfig.getResolvedArtifacts(), isEmpty());
    }

    @Test
    public void resolveDelegatesToBackingServiceWhenConfigHasDependencies() {
        final Dependency dependencyDummy = context.mock(Dependency.class);
        final ResolvedConfiguration resolvedConfigDummy = context.mock(ResolvedConfiguration.class);

        context.checking(new Expectations() {{
            allowing(configuration).getAllDependencies();
            will(returnValue(toSet(dependencyDummy)));
View Full Code Here


        checkCommonMavenDependencies(actualMavenDependencies);
    }

    @Test
    public void convertWithUnMappedConfAndSkipTrue() {
        final Dependency dependency4 = createDependency("org4", "name4", "rev4");
        final Configuration unmappedConfigurationStub = createNamedConfigurationStubWithDependencies("unmappedConf");
        context.checking(new Expectations() {{
            allowing(unmappedConfigurationStub).getDependencies();
            will(returnValue(toSet(dependency4)));
        }});
View Full Code Here

    public Dependency createDependency(Object dependencyNotation) {
        if (dependencyNotation instanceof Dependency) {
            return (Dependency) dependencyNotation;
        }
       
        Dependency dependency = null;
        for (IDependencyImplementationFactory factory : dependencyFactories) {
            try {
                dependency = factory.createDependency(Dependency.class, dependencyNotation);
                break;
            }
View Full Code Here

    @Test
    public void createsADependencyFromAFileCollectionNotation() {
        FileCollection collection = context.mock(FileCollection.class);

        Dependency dependency = factory.createDependency(Dependency.class, collection);
        assertThat(dependency, instanceOf(DefaultSelfResolvingDependency.class));
        DefaultSelfResolvingDependency selfResolvingDependency = (DefaultSelfResolvingDependency) dependency;
        assertThat(selfResolvingDependency.getSource(), sameInstance(collection));
    }
View Full Code Here

            WrapUtil.toSet(testImplPointFactoryStub), null, null);

    @Test
    public void testCreateDependencyWithValidDescription() {
        final Point point = createAnonymousPoint();
        final Dependency pointDependencyDummy = context.mock(Dependency.class, "PointDependency");
        context.checking(new Expectations() {{
            allowing(testImplPointFactoryStub).createDependency(Dependency.class, point);
            will(returnValue(pointDependencyDummy));
        }});
        assertSame(pointDependencyDummy, dependencyFactory.createDependency(point));
View Full Code Here

        assertSame(pointDependencyDummy, dependencyFactory.createDependency(point));
    }

    @Test
    public void createDependencyWithDependencyObject() {
        final Dependency dependencyDummy = context.mock(Dependency.class);
        assertSame(dependencyDummy, dependencyFactory.createDependency(dependencyDummy));   
    }
View Full Code Here

    }

    @Test
    public void testCreateDependencyWithValidDescriptionAndClosure() {
        final Point point = createAnonymousPoint();
        final Dependency pointDependencyMock = context.mock(Dependency.class, "PointDependency");
        context.checking(new Expectations() {{
            allowing(testImplPointFactoryStub).createDependency(Dependency.class, point);
            will(returnValue(pointDependencyMock));
        }});
        assertSame(pointDependencyMock, dependencyFactory.createDependency(point));
View Full Code Here

        assertThat(configurationContainer.getAll(), equalTo(WrapUtil.toSet(configuration1, configuration2)));
    }

    @Test
    public void testCreateDetached() {
        Dependency dependency1 = HelperUtil.createDependency("group1", "name1", "version1");
        Dependency dependency2 = HelperUtil.createDependency("group2", "name2", "version2");

        Configuration detachedConf = configurationContainer.detachedConfiguration(dependency1, dependency2);

        assertThat(detachedConf.getAll(), equalTo(WrapUtil.toSet(detachedConf)));
        assertThat(detachedConf.getHierarchy(), equalTo(WrapUtil.<Configuration>toSet(detachedConf)));
View Full Code Here

                    public void execute(ResolvableDependencies resolvableDependencies) {
                        DependencySet dependencies = resolvableDependencies.getDependencies();
                        if (dependencies.isEmpty()) {
                            String toolVersion = rootExtension.getToolVersion();
                            DependencyHandler dependencyHandler = project.getDependencies();
                            Dependency dependency = dependencyHandler.create("org.codehaus.sonar.runner:sonar-runner-dist:" + toolVersion);
                            configuration.getDependencies().add(dependency);
                        }
                    }
                });
    }
View Full Code Here

    public Dependency create(Object dependencyNotation) {
        return create(dependencyNotation, null);
    }

    public Dependency create(Object dependencyNotation, Closure configureClosure) {
        Dependency dependency = dependencyFactory.createDependency(dependencyNotation);
        return ConfigureUtil.configure(configureClosure, dependency);
    }
View Full Code Here

TOP

Related Classes of org.gradle.api.artifacts.Dependency

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.