Search in sources :

Example 16 with ModuleVersionIdentifier

use of org.gradle.api.artifacts.ModuleVersionIdentifier in project gradle by gradle.

the class DefaultIvyPublication method getArtifactFileName.

private String getArtifactFileName(String classifier, String extension) {
    StringBuilder artifactPath = new StringBuilder();
    ModuleVersionIdentifier coordinates = getCoordinates();
    artifactPath.append(coordinates.getName());
    artifactPath.append('-');
    artifactPath.append(coordinates.getVersion());
    if (GUtil.isTrue(classifier)) {
        artifactPath.append('-');
        artifactPath.append(classifier);
    }
    if (GUtil.isTrue(extension)) {
        artifactPath.append('.');
        artifactPath.append(extension);
    }
    return artifactPath.toString();
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier) DefaultModuleVersionIdentifier(org.gradle.api.internal.artifacts.DefaultModuleVersionIdentifier)

Example 17 with ModuleVersionIdentifier

use of org.gradle.api.artifacts.ModuleVersionIdentifier in project gradle by gradle.

the class DefaultIvyPublication method addProjectDependency.

private void addProjectDependency(ProjectDependency dependency, String confMapping) {
    ModuleVersionIdentifier identifier = projectDependencyResolver.resolve(ModuleVersionIdentifier.class, dependency);
    ivyDependencies.add(new DefaultIvyDependency(identifier.getGroup(), identifier.getName(), identifier.getVersion(), confMapping, dependency.isTransitive(), Collections.<DependencyArtifact>emptyList(), dependency.getExcludeRules()));
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier) DefaultModuleVersionIdentifier(org.gradle.api.internal.artifacts.DefaultModuleVersionIdentifier) DefaultIvyDependency(org.gradle.api.publish.ivy.internal.dependency.DefaultIvyDependency) DependencyArtifact(org.gradle.api.artifacts.DependencyArtifact)

Example 18 with ModuleVersionIdentifier

use of org.gradle.api.artifacts.ModuleVersionIdentifier in project gradle by gradle.

the class DefaultImmutableModuleIdentifierFactory method moduleWithVersion.

@Override
public ModuleVersionIdentifier moduleWithVersion(String group, String name, String version) {
    ModuleIdentifier mi = module(group, name);
    Map<String, ModuleVersionIdentifier> byVersion = idToVersions.get(mi);
    if (byVersion == null) {
        byVersion = idToVersions.get(mi);
        if (byVersion == null) {
            byVersion = Maps.newConcurrentMap();
            idToVersions.put(mi, byVersion);
        }
    }
    ModuleVersionIdentifier identifier = byVersion.get(version);
    if (identifier == null) {
        identifier = new DefaultModuleVersionIdentifier(mi, version);
        byVersion.put(version, identifier);
    }
    return identifier;
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier) ModuleIdentifier(org.gradle.api.artifacts.ModuleIdentifier)

Example 19 with ModuleVersionIdentifier

use of org.gradle.api.artifacts.ModuleVersionIdentifier in project gradle by gradle.

the class ResolvedConfigurationIdentifierSerializer method read.

public ResolvedConfigurationIdentifier read(Decoder decoder) throws IOException {
    ModuleVersionIdentifier id = idSerializer.read(decoder);
    String configuration = decoder.readString();
    return new ResolvedConfigurationIdentifier(id, configuration);
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier)

Example 20 with ModuleVersionIdentifier

use of org.gradle.api.artifacts.ModuleVersionIdentifier in project gradle by gradle.

the class DefaultConfiguration method toRootComponentMetaData.

public ComponentResolveMetadata toRootComponentMetaData() {
    Module module = getModule();
    ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(module);
    ModuleVersionIdentifier moduleVersionIdentifier = moduleIdentifierFactory.moduleWithVersion(module.getGroup(), module.getName(), module.getVersion());
    ProjectInternal project = projectFinder.findProject(module.getProjectPath());
    AttributesSchemaInternal schema = project == null ? null : (AttributesSchemaInternal) project.getDependencies().getAttributesSchema();
    DefaultLocalComponentMetadata metaData = new DefaultLocalComponentMetadata(moduleVersionIdentifier, componentIdentifier, module.getStatus(), schema);
    configurationComponentMetaDataBuilder.addConfigurations(metaData, configurationsProvider.getAll());
    return metaData;
}
Also used : ModuleVersionIdentifier(org.gradle.api.artifacts.ModuleVersionIdentifier) DefaultLocalComponentMetadata(org.gradle.internal.component.local.model.DefaultLocalComponentMetadata) ProjectInternal(org.gradle.api.internal.project.ProjectInternal) ComponentIdentifier(org.gradle.api.artifacts.component.ComponentIdentifier) Module(org.gradle.api.internal.artifacts.Module) AttributesSchemaInternal(org.gradle.api.internal.attributes.AttributesSchemaInternal)

Aggregations

ModuleVersionIdentifier (org.gradle.api.artifacts.ModuleVersionIdentifier)38 ComponentIdentifier (org.gradle.api.artifacts.component.ComponentIdentifier)8 ProjectComponentIdentifier (org.gradle.api.artifacts.component.ProjectComponentIdentifier)7 DependencyResult (org.gradle.api.artifacts.result.DependencyResult)7 ResolvedDependencyResult (org.gradle.api.artifacts.result.ResolvedDependencyResult)7 File (java.io.File)6 UnresolvedDependencyResult (org.gradle.api.artifacts.result.UnresolvedDependencyResult)6 List (java.util.List)5 ResolvedArtifact (org.gradle.api.artifacts.ResolvedArtifact)5 DefaultModuleVersionIdentifier (org.gradle.api.internal.artifacts.DefaultModuleVersionIdentifier)5 ArrayList (java.util.ArrayList)4 HashSet (java.util.HashSet)4 ComponentSelector (org.gradle.api.artifacts.component.ComponentSelector)4 Module (org.gradle.api.internal.artifacts.Module)4 DefaultLocalComponentMetadata (org.gradle.internal.component.local.model.DefaultLocalComponentMetadata)4 ImmutableList (com.google.common.collect.ImmutableList)3 Configuration (org.gradle.api.artifacts.Configuration)3 ModuleComponentSelector (org.gradle.api.artifacts.component.ModuleComponentSelector)3 ResolvedComponentResult (org.gradle.api.artifacts.result.ResolvedComponentResult)3 JarDependency (com.android.builder.dependency.JarDependency)2