Search in sources :

Example 1 with MutableModuleDescriptorState

use of org.gradle.internal.component.external.descriptor.MutableModuleDescriptorState in project gradle by gradle.

the class GradlePomModuleDescriptorBuilder method setModuleRevId.

public void setModuleRevId(String group, String module, String version) {
    String effectiveVersion = version;
    if (version != null) {
        Matcher matcher = TIMESTAMP_PATTERN.matcher(version);
        if (matcher.matches()) {
            effectiveVersion = matcher.group(1) + "-SNAPSHOT";
        }
    }
    String status = effectiveVersion != null && effectiveVersion.endsWith("SNAPSHOT") ? "integration" : "release";
    descriptor = new MutableModuleDescriptorState(DefaultModuleComponentIdentifier.newId(group, module, effectiveVersion), status, false);
}
Also used : MutableModuleDescriptorState(org.gradle.internal.component.external.descriptor.MutableModuleDescriptorState) Matcher(java.util.regex.Matcher)

Example 2 with MutableModuleDescriptorState

use of org.gradle.internal.component.external.descriptor.MutableModuleDescriptorState 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)

Aggregations

MutableModuleDescriptorState (org.gradle.internal.component.external.descriptor.MutableModuleDescriptorState)2 Matcher (java.util.regex.Matcher)1 ExcludeRule (org.apache.ivy.core.module.descriptor.ExcludeRule)1 ModuleRevisionId (org.apache.ivy.core.module.id.ModuleRevisionId)1 ModuleComponentIdentifier (org.gradle.api.artifacts.component.ModuleComponentIdentifier)1 NamespaceId (org.gradle.api.internal.artifacts.ivyservice.NamespaceId)1 DefaultModuleComponentIdentifier (org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier)1