Search in sources :

Example 1 with DefaultMavenProjectDependency

use of org.gradle.api.publish.maven.internal.dependencies.DefaultMavenProjectDependency in project gradle by gradle.

the class DefaultMavenPublication method addProjectDependency.

private void addProjectDependency(ProjectDependency dependency, Set<ExcludeRule> globalExcludes, Set<MavenDependencyInternal> dependencies) {
    ModuleVersionIdentifier identifier = projectDependencyResolver.resolve(ModuleVersionIdentifier.class, dependency);
    DefaultMavenDependency moduleDependency = new DefaultMavenDependency(identifier.getGroup(), identifier.getName(), identifier.getVersion(), Collections.emptyList(), getExcludeRules(globalExcludes, dependency));
    dependencies.add(new DefaultMavenProjectDependency(moduleDependency, dependency.getDependencyProject().getPath()));
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier) DefaultModuleVersionIdentifier(org.gradle.api.internal.artifacts.DefaultModuleVersionIdentifier) DefaultMavenDependency(org.gradle.api.publish.maven.internal.dependencies.DefaultMavenDependency) DefaultMavenProjectDependency(org.gradle.api.publish.maven.internal.dependencies.DefaultMavenProjectDependency)

Example 2 with DefaultMavenProjectDependency

use of org.gradle.api.publish.maven.internal.dependencies.DefaultMavenProjectDependency in project gradle by gradle.

the class DefaultMavenPublication method addDependencyConstraint.

private void addDependencyConstraint(DefaultProjectDependencyConstraint dependency, Set<MavenDependency> dependencies) {
    ProjectDependency projectDependency = dependency.getProjectDependency();
    ModuleVersionIdentifier identifier = projectDependencyResolver.resolve(ModuleVersionIdentifier.class, projectDependency);
    DefaultMavenDependency moduleDependency = new DefaultMavenDependency(identifier.getGroup(), identifier.getName(), identifier.getVersion());
    dependencies.add(new DefaultMavenProjectDependency(moduleDependency, projectDependency.getDependencyProject().getPath()));
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier) DefaultModuleVersionIdentifier(org.gradle.api.internal.artifacts.DefaultModuleVersionIdentifier) DefaultMavenDependency(org.gradle.api.publish.maven.internal.dependencies.DefaultMavenDependency) DefaultMavenProjectDependency(org.gradle.api.publish.maven.internal.dependencies.DefaultMavenProjectDependency) ProjectDependency(org.gradle.api.artifacts.ProjectDependency) DefaultMavenProjectDependency(org.gradle.api.publish.maven.internal.dependencies.DefaultMavenProjectDependency)

Aggregations

ModuleVersionIdentifier (org.gradle.api.artifacts.ModuleVersionIdentifier)2 DefaultModuleVersionIdentifier (org.gradle.api.internal.artifacts.DefaultModuleVersionIdentifier)2 DefaultMavenDependency (org.gradle.api.publish.maven.internal.dependencies.DefaultMavenDependency)2 DefaultMavenProjectDependency (org.gradle.api.publish.maven.internal.dependencies.DefaultMavenProjectDependency)2 ProjectDependency (org.gradle.api.artifacts.ProjectDependency)1