Search in sources :

Example 11 with ModuleComponentIdentifier

use of org.gradle.api.artifacts.component.ModuleComponentIdentifier in project gradle by gradle.

the class IvyBackedArtifactPublisher method toPublishMetaData.

private BuildableIvyModulePublishMetadata toPublishMetaData(Module module, Set<? extends ConfigurationInternal> configurations) {
    ModuleComponentIdentifier id = DefaultModuleComponentIdentifier.newId(module.getGroup(), module.getName(), module.getVersion());
    DefaultIvyModulePublishMetadata publishMetaData = new DefaultIvyModulePublishMetadata(id, module.getStatus());
    configurationComponentMetaDataBuilder.addConfigurations(publishMetaData, configurations);
    return publishMetaData;
}
Also used : DefaultIvyModulePublishMetadata(org.gradle.internal.component.external.model.DefaultIvyModulePublishMetadata) ModuleComponentIdentifier(org.gradle.api.artifacts.component.ModuleComponentIdentifier) DefaultModuleComponentIdentifier(org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier)

Example 12 with ModuleComponentIdentifier

use of org.gradle.api.artifacts.component.ModuleComponentIdentifier in project gradle by gradle.

the class ComponentArtifactMetadataSerializer method read.

public ComponentArtifactMetadata read(Decoder decoder) throws Exception {
    ModuleComponentIdentifier componentIdentifier = (ModuleComponentIdentifier) componentIdentifierSerializer.read(decoder);
    String artifactName = decoder.readString();
    String type = decoder.readString();
    String extension = decoder.readNullableString();
    String classifier = decoder.readNullableString();
    return new DefaultModuleComponentArtifactMetadata(componentIdentifier, new DefaultIvyArtifactName(artifactName, type, extension, classifier));
}
Also used : DefaultIvyArtifactName(org.gradle.internal.component.model.DefaultIvyArtifactName) ModuleComponentIdentifier(org.gradle.api.artifacts.component.ModuleComponentIdentifier) DefaultModuleComponentArtifactMetadata(org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata)

Example 13 with ModuleComponentIdentifier

use of org.gradle.api.artifacts.component.ModuleComponentIdentifier in project gradle by gradle.

the class IvyModuleDescriptorConverter method forIvyModuleDescriptor.

public ModuleDescriptorState forIvyModuleDescriptor(ModuleDescriptor ivyDescriptor) {
    ModuleRevisionId moduleRevisionId = ivyDescriptor.getModuleRevisionId();
    ModuleComponentIdentifier componentIdentifier = DefaultModuleComponentIdentifier.newId(moduleRevisionId.getOrganisation(), moduleRevisionId.getName(), moduleRevisionId.getRevision());
    MutableModuleDescriptorState state = new MutableModuleDescriptorState(componentIdentifier, ivyDescriptor.getStatus(), ivyDescriptor.isDefault());
    state.setBranch(moduleRevisionId.getBranch());
    state.setDescription(ivyDescriptor.getDescription());
    state.setPublicationDate(ivyDescriptor.getPublicationDate());
    Map<NamespaceId, String> extraInfo = Cast.uncheckedCast(ivyDescriptor.getExtraInfo());
    state.getExtraInfo().putAll(extraInfo);
    for (ExcludeRule excludeRule : ivyDescriptor.getAllExcludeRules()) {
        addExcludeRule(state, excludeRule);
    }
    return state;
}
Also used : MutableModuleDescriptorState(org.gradle.internal.component.external.descriptor.MutableModuleDescriptorState) DefaultModuleComponentIdentifier(org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier) ModuleComponentIdentifier(org.gradle.api.artifacts.component.ModuleComponentIdentifier) ModuleRevisionId(org.apache.ivy.core.module.id.ModuleRevisionId) NamespaceId(org.gradle.api.internal.artifacts.ivyservice.NamespaceId) ExcludeRule(org.apache.ivy.core.module.descriptor.ExcludeRule)

Example 14 with ModuleComponentIdentifier

use of org.gradle.api.artifacts.component.ModuleComponentIdentifier in project gradle by gradle.

the class ModuleComponentFileArtifactIdentifierSerializer method read.

@Override
public ModuleComponentFileArtifactIdentifier read(Decoder decoder) throws Exception {
    ModuleComponentIdentifier componentIdentifier = (ModuleComponentIdentifier) componentIdentifierSerializer.read(decoder);
    String fileName = decoder.readString();
    return new ModuleComponentFileArtifactIdentifier(componentIdentifier, fileName);
}
Also used : ModuleComponentIdentifier(org.gradle.api.artifacts.component.ModuleComponentIdentifier) ModuleComponentFileArtifactIdentifier(org.gradle.internal.component.external.model.ModuleComponentFileArtifactIdentifier)

Example 15 with ModuleComponentIdentifier

use of org.gradle.api.artifacts.component.ModuleComponentIdentifier in project gradle by gradle.

the class AbstractResourcePattern method isComplete.

@Override
public boolean isComplete(ModuleComponentArtifactMetadata artifactIdentifier) {
    IvyArtifactName artifactName = artifactIdentifier.getName();
    ModuleComponentIdentifier componentIdentifier = artifactIdentifier.getId().getComponentIdentifier();
    return isValidSubstitute(componentIdentifier.getModule(), false) && isValidSubstitute(componentIdentifier.getGroup(), organisationIsOptional) && isValidSubstitute(componentIdentifier.getVersion(), revisionIsOptional) && isValidSubstitute(artifactName.getName(), artifactIsOptional) && isValidSubstitute(artifactName.getClassifier(), classifierIsOptional) && isValidSubstitute(artifactName.getExtension(), extensionIsOptional) && isValidSubstitute(artifactName.getType(), typeIsOptional);
}
Also used : IvyArtifactName(org.gradle.internal.component.model.IvyArtifactName) ModuleComponentIdentifier(org.gradle.api.artifacts.component.ModuleComponentIdentifier)

Aggregations

ModuleComponentIdentifier (org.gradle.api.artifacts.component.ModuleComponentIdentifier)20 DefaultModuleComponentIdentifier (org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier)9 NamespaceId (org.gradle.api.internal.artifacts.ivyservice.NamespaceId)3 ModuleRevisionId (org.apache.ivy.core.module.id.ModuleRevisionId)2 ComponentSelection (org.gradle.api.artifacts.ComponentSelection)2 ComponentSelector (org.gradle.api.artifacts.component.ComponentSelector)2 ModuleComponentSelector (org.gradle.api.artifacts.component.ModuleComponentSelector)2 DefaultComponentSelection (org.gradle.api.internal.artifacts.DefaultComponentSelection)2 VersionSelector (org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionSelector)2 MutableMavenModuleResolveMetadata (org.gradle.internal.component.external.model.MutableMavenModuleResolveMetadata)2 DefaultIvyArtifactName (org.gradle.internal.component.model.DefaultIvyArtifactName)2 IvyArtifactName (org.gradle.internal.component.model.IvyArtifactName)2 SpecRuleAction (org.gradle.internal.rules.SpecRuleAction)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 ExcludeRule (org.apache.ivy.core.module.descriptor.ExcludeRule)1 ArtifactView (org.gradle.api.artifacts.ArtifactView)1 ModuleVersionIdentifier (org.gradle.api.artifacts.ModuleVersionIdentifier)1 ModuleVersionSelector (org.gradle.api.artifacts.ModuleVersionSelector)1