Search in sources :

Example 11 with Exclude

use of org.gradle.internal.component.model.Exclude in project gradle by gradle.

the class ModuleExclusions method excludeAny.

public ModuleExclusion excludeAny(List<Exclude> excludes, Set<String> hierarchy) {
    Map<Set<String>, ModuleExclusion> exclusionMap = cachedExcludes.get(excludes);
    if (exclusionMap == null) {
        exclusionMap = Maps.newConcurrentMap();
        cachedExcludes.put(excludes, exclusionMap);
    }
    ModuleExclusion moduleExclusion = exclusionMap.get(hierarchy);
    if (moduleExclusion == null) {
        List<Exclude> filtered = Lists.newArrayList();
        for (Exclude exclude : excludes) {
            for (String config : exclude.getConfigurations()) {
                if (hierarchy.contains(config)) {
                    filtered.add(exclude);
                    break;
                }
            }
        }
        moduleExclusion = excludeAny(filtered);
        exclusionMap.put(hierarchy, moduleExclusion);
    }
    return moduleExclusion;
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) BitSet(java.util.BitSet) Exclude(org.gradle.internal.component.model.Exclude)

Example 12 with Exclude

use of org.gradle.internal.component.model.Exclude in project gradle by gradle.

the class RealisedIvyModuleResolveMetadataSerializationHelper method writeExcludeRules.

private void writeExcludeRules(Encoder encoder, List<Exclude> excludes) throws IOException {
    encoder.writeSmallInt(excludes.size());
    for (Exclude exclude : excludes) {
        encoder.writeString(exclude.getModuleId().getGroup());
        encoder.writeString(exclude.getModuleId().getName());
        IvyArtifactName artifact = exclude.getArtifact();
        writeNullableArtifact(encoder, artifact);
        writeStringSet(encoder, exclude.getConfigurations());
        encoder.writeNullableString(exclude.getMatcher());
    }
}
Also used : Exclude(org.gradle.internal.component.model.Exclude) DefaultExclude(org.gradle.internal.component.external.descriptor.DefaultExclude) DefaultIvyArtifactName(org.gradle.internal.component.model.DefaultIvyArtifactName) IvyArtifactName(org.gradle.internal.component.model.IvyArtifactName)

Aggregations

Exclude (org.gradle.internal.component.model.Exclude)12 DefaultExclude (org.gradle.internal.component.external.descriptor.DefaultExclude)5 ModuleRevisionId (org.apache.ivy.core.module.id.ModuleRevisionId)3 ModuleVersionSelector (org.gradle.api.artifacts.ModuleVersionSelector)3 ModuleComponentSelector (org.gradle.api.artifacts.component.ModuleComponentSelector)3 DefaultModuleVersionSelector (org.gradle.api.internal.artifacts.DefaultModuleVersionSelector)3 Artifact (org.gradle.internal.component.external.descriptor.Artifact)3 DefaultIvyArtifactName (org.gradle.internal.component.model.DefaultIvyArtifactName)3 IvyArtifactName (org.gradle.internal.component.model.IvyArtifactName)3 List (java.util.List)2 Map (java.util.Map)2 DependencyArtifactDescriptor (org.apache.ivy.core.module.descriptor.DependencyArtifactDescriptor)2 ExcludeRule (org.apache.ivy.core.module.descriptor.ExcludeRule)2 DefaultModuleComponentSelector (org.gradle.internal.component.external.model.DefaultModuleComponentSelector)2 IvyDependencyDescriptor (org.gradle.internal.component.external.model.ivy.IvyDependencyDescriptor)2 DslOriginDependencyMetadataWrapper (org.gradle.internal.component.local.model.DslOriginDependencyMetadataWrapper)2 LocalComponentDependencyMetadata (org.gradle.internal.component.model.LocalComponentDependencyMetadata)2 BitSet (java.util.BitSet)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1