Package org.gradle.api.artifacts

Examples of org.gradle.api.artifacts.ProjectDependency


        }
        if (dependency == null || getClass() != dependency.getClass()) {
            return false;
        }

        ProjectDependency that = (ProjectDependency) dependency;
        if (!isCommonContentEquals(that)) {
            return false;
        }

        return dependencyProject.equals(that.getDependencyProject());
    }
View Full Code Here


    }

    @Test
    public void testCreateFromProjectDependency() {
        final ModuleRevisionId someModuleRevisionId = ModuleRevisionId.newInstance("a", "b", "c");
        final ProjectDependency projectDependency = createProjectDependency(TEST_DEP_CONF);
        setUpDependency(projectDependency);
        context.checking(new Expectations() {{
            allowing(descriptorStrategyStub).createModuleRevisionId(projectDependency);
            will(returnValue(someModuleRevisionId));
            allowing(descriptorStrategyStub).isChanging();
View Full Code Here

        return new DefaultProjectDependency(dependencyProject, dependencyConfiguration, new ProjectDependenciesBuildInstruction(Collections.<String>emptyList()));
    }

    @Test
    public void addExternalModuleDependenciesWithSameModuleRevisionIdAndDifferentConfsShouldBePartOfSameDependencyDescriptor() {
        final ProjectDependency dependency1 = createProjectDependency(TEST_DEP_CONF);
        final ProjectDependency dependency2 = createProjectDependency(TEST_OTHER_DEP_CONF);

        context.checking(new Expectations() {{
            allowing(descriptorStrategyStub).isChanging();
            will(returnValue(true));
            allowing(descriptorStrategyStub).createModuleRevisionId(dependency1);
View Full Code Here

        );
    }

    @Test
    public void ivyFileModuleRevisionIdShouldBeDeterminedByModuleForPublicDescriptorWithoutExtraAttributes() {
        ProjectDependency projectDependency = createProjectDependency(TEST_CONF);
        Module module = ((ProjectInternal) projectDependency.getDependencyProject()).getModule();
        ModuleRevisionId moduleRevisionId =
                ProjectDependencyDescriptorFactory.IVY_FILE_DESCRIPTOR_STRATEGY.createModuleRevisionId(projectDependency);
        assertThat(moduleRevisionId.getOrganisation(), equalTo(module.getGroup()));
        assertThat(moduleRevisionId.getName(), equalTo(module.getName()));
        assertThat(moduleRevisionId.getRevision(), equalTo(module.getVersion()));
View Full Code Here

        assertThat(moduleRevisionId.getExtraAttributes(), equalTo((Map) new HashMap()));
    }

    @Test
    public void resolveModuleRevisionIdShouldBeDeterminedByModuleForResolvePlusExtraAttributes() {
        ProjectDependency projectDependency = createProjectDependency(TEST_CONF);
        Module module = ((ProjectInternal) projectDependency.getDependencyProject()).getModule();
        ModuleRevisionId moduleRevisionId =
                ProjectDependencyDescriptorFactory.RESOLVE_DESCRIPTOR_STRATEGY.createModuleRevisionId(projectDependency);
        assertThat(moduleRevisionId.getOrganisation(), equalTo(module.getGroup()));
        assertThat(moduleRevisionId.getName(), equalTo(module.getName()));
        assertThat(moduleRevisionId.getRevision(), equalTo(module.getVersion()));
        assertThat(moduleRevisionId.getExtraAttributes(),
                equalTo((Map) WrapUtil.toMap(DependencyDescriptorFactory.PROJECT_PATH_KEY, projectDependency.getDependencyProject().getPath())));
    }
View Full Code Here

    public ProjectDependency createProjectDependencyFromMap(ProjectFinder projectFinder,
                                                   Map<? extends String, ? extends Object> map) {
        Map<String, Object> args = new HashMap<String, Object>(map);
        String path = getAndRemove(args, "path");
        String configuration = getAndRemove(args, "configuration");
        ProjectDependency dependency = classGenerator.newInstance(DefaultProjectDependency.class, projectFinder.getProject(path), configuration, instruction);
        ConfigureUtil.configureByMap(args, dependency);
        return dependency;
    }
View Full Code Here

    }

    @Test
    public void createProject() {
        final ProjectDependencyFactory projectDependencyFactoryStub = context.mock(ProjectDependencyFactory.class);
        final ProjectDependency projectDependency = context.mock(ProjectDependency.class);
        final ProjectFinder projectFinderDummy = context.mock(ProjectFinder.class);
        DefaultDependencyFactory dependencyFactory = new DefaultDependencyFactory(null, null, projectDependencyFactoryStub);
        final Map map = WrapUtil.toMap("key", "value");
        context.checking(new Expectations() {{
            allowing(projectDependencyFactoryStub).createProjectDependencyFromMap(projectFinderDummy, map);
View Full Code Here

          libraries.add(new GradleLibrary(fileDependency.getGroup(), file,
              scope));
        }
      }
      else if (dependency instanceof ProjectDependency) {
        ProjectDependency projectDependency = (ProjectDependency) dependency;
        libraries.addAll(getLibrariesForFileDependencies(
            projectDependency.getProjectConfiguration(), scope));
      }
    }
    return libraries;
  }
View Full Code Here

    public boolean canConvert(ModuleDependency dependency) {
        return dependency instanceof ProjectDependency;
    }

    private ModuleRevisionId createModuleRevisionId(ModuleDependency dependency) {
        ProjectDependency projectDependency = (ProjectDependency) dependency;
        Module module = ((ProjectInternal) projectDependency.getDependencyProject()).getModule();
        return IvyUtil.createModuleRevisionId(module);
    }
View Full Code Here

        }
        if (dependency == null || getClass() != dependency.getClass()) {
            return false;
        }

        ProjectDependency that = (ProjectDependency) dependency;
        if (!isCommonContentEquals(that)) {
            return false;
        }

        return dependencyProject.equals(that.getDependencyProject());
    }
View Full Code Here

TOP

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

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.