org.gradle.api.internal.artifacts.DefaultModuleIdentifier Java Examples

The following examples show how to use org.gradle.api.internal.artifacts.DefaultModuleIdentifier. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExternalResourceResolver.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void listModuleVersions(DependencyMetaData dependency, BuildableModuleVersionSelectionResolveResult result) {
    ModuleIdentifier module  = new DefaultModuleIdentifier(dependency.getRequested().getGroup(), dependency.getRequested().getName());
    VersionList versionList = versionLister.getVersionList(module);
    // List modules based on metadata files
    ModuleVersionArtifactMetaData metaDataArtifact = getMetaDataArtifactFor(dependency);
    listVersionsForAllPatterns(getIvyPatterns(), metaDataArtifact, versionList);

    // List modules with missing metadata files
    if (isAllownomd()) {
        for (ModuleVersionArtifactMetaData otherArtifact : getDefaultMetaData(dependency).getArtifacts()) {
            listVersionsForAllPatterns(getArtifactPatterns(), otherArtifact, versionList);
        }
    }
    DefaultModuleVersionListing moduleVersions = new DefaultModuleVersionListing();
    for (VersionList.ListedVersion listedVersion : versionList.getVersions()) {
        moduleVersions.add(listedVersion.getVersion());
    }
    result.listed(moduleVersions);
}
 
Example #2
Source File: ExternalResourceResolver.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void listModuleVersions(DependencyMetaData dependency, BuildableModuleVersionSelectionResolveResult result) {
    ModuleIdentifier module  = new DefaultModuleIdentifier(dependency.getRequested().getGroup(), dependency.getRequested().getName());
    VersionList versionList = versionLister.getVersionList(module);
    // List modules based on metadata files
    ModuleVersionArtifactMetaData metaDataArtifact = getMetaDataArtifactFor(dependency);
    listVersionsForAllPatterns(getIvyPatterns(), metaDataArtifact, versionList);

    // List modules with missing metadata files
    if (isAllownomd()) {
        for (ModuleVersionArtifactMetaData otherArtifact : getDefaultMetaData(dependency).getArtifacts()) {
            listVersionsForAllPatterns(getArtifactPatterns(), otherArtifact, versionList);
        }
    }
    DefaultModuleVersionListing moduleVersions = new DefaultModuleVersionListing();
    for (VersionList.ListedVersion listedVersion : versionList.getVersions()) {
        moduleVersions.add(listedVersion.getVersion());
    }
    result.listed(moduleVersions);
}
 
Example #3
Source File: ModuleForcingResolveRule.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ModuleForcingResolveRule(Collection<? extends ModuleVersionSelector> forcedModules) {
    if (!forcedModules.isEmpty()) {
        this.forcedModules = new HashMap<ModuleIdentifier, String>();
        for (ModuleVersionSelector module : forcedModules) {
            this.forcedModules.put(new DefaultModuleIdentifier(module.getGroup(), module.getName()), module.getVersion());
        }
    } else {
        this.forcedModules = null;
    }
}
 
Example #4
Source File: ModuleForcingResolveRule.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void execute(DependencyResolveDetailsInternal details) {
    if (forcedModules == null) {
        return;
    }
    ModuleIdentifier key = new DefaultModuleIdentifier(details.getRequested().getGroup(), details.getRequested().getName());
    if (forcedModules.containsKey(key)) {
        details.useVersion(forcedModules.get(key), VersionSelectionReasons.FORCED);
    }
}
 
Example #5
Source File: ModuleForcingResolveRule.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ModuleForcingResolveRule(Collection<? extends ModuleVersionSelector> forcedModules) {
    if (!forcedModules.isEmpty()) {
        this.forcedModules = new HashMap<ModuleIdentifier, String>();
        for (ModuleVersionSelector module : forcedModules) {
            this.forcedModules.put(new DefaultModuleIdentifier(module.getGroup(), module.getName()), module.getVersion());
        }
    } else {
        this.forcedModules = null;
    }
}
 
Example #6
Source File: ExternalResourceResolver.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void doListModuleVersions(DependencyMetaData dependency, BuildableModuleComponentVersionSelectionResolveResult result) {
    ModuleIdentifier module  = new DefaultModuleIdentifier(dependency.getRequested().getGroup(), dependency.getRequested().getName());
    Set<String> versions = new LinkedHashSet<String>();
    VersionPatternVisitor visitor = versionLister.newVisitor(module, versions, result);

    // List modules based on metadata files (artifact version is not considered in listVersionsForAllPatterns())
    IvyArtifactName metaDataArtifact = getMetaDataArtifactName(dependency.getRequested().getName());
    listVersionsForAllPatterns(ivyPatterns, metaDataArtifact, visitor);

    // List modules with missing metadata files
    for (IvyArtifactName otherArtifact : getDependencyArtifactNames(dependency)) {
        listVersionsForAllPatterns(artifactPatterns, otherArtifact, visitor);
    }
    result.listed(versions);
}
 
Example #7
Source File: ModuleForcingResolveRule.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void execute(DependencyResolveDetailsInternal details) {
    if (forcedModules == null) {
        return;
    }
    ModuleIdentifier key = new DefaultModuleIdentifier(details.getRequested().getGroup(), details.getRequested().getName());
    if (forcedModules.containsKey(key)) {
        details.useVersion(forcedModules.get(key), VersionSelectionReasons.FORCED);
    }
}
 
Example #8
Source File: ModuleForcingResolveRule.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ModuleForcingResolveRule(Collection<? extends ModuleVersionSelector> forcedModules) {
    if (!forcedModules.isEmpty()) {
        this.forcedModules = new HashMap<ModuleIdentifier, String>();
        for (ModuleVersionSelector module : forcedModules) {
            this.forcedModules.put(new DefaultModuleIdentifier(module.getGroup(), module.getName()), module.getVersion());
        }
    } else {
        this.forcedModules = null;
    }
}
 
Example #9
Source File: ApDependency.java    From atlas with Apache License 2.0 5 votes vote down vote up
private void addDependency(String dependencyString, Map<ModuleIdentifier, String> awb) {
    ParsedModuleStringNotation parsedNotation = new ParsedModuleStringNotation(dependencyString,dependencyString.split("@")[1]);
    ModuleIdentifier moduleIdentifier = DefaultModuleIdentifier.newId(parsedNotation.getGroup(),
            parsedNotation.getName());
    String version = parsedNotation.getVersion();
    awb.put(moduleIdentifier, version);
    mFlatDependenciesMap.put(moduleIdentifier, version);
}
 
Example #10
Source File: ApDependency.java    From atlas with Apache License 2.0 5 votes vote down vote up
private Map<ModuleIdentifier, String> getAwbDependencies(String awb) {
    ParsedModuleStringNotation parsedNotation = new ParsedModuleStringNotation(awb,"awb");
    String group = parsedNotation.getGroup();
    String name = parsedNotation.getName();
    ModuleIdentifier moduleIdentifier = DefaultModuleIdentifier.newId(group, name);
    Map<ModuleIdentifier, String> awbDependencies = mAwbDependenciesMap.get(moduleIdentifier);
    if (awbDependencies == null) {
        awbDependencies = Maps.newHashMap();
        mAwbDependenciesMap.put(moduleIdentifier, awbDependencies);
    }
    return awbDependencies;
}
 
Example #11
Source File: ModuleForcingResolveRule.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void execute(DependencyResolveDetailsInternal details) {
    if (forcedModules == null) {
        return;
    }
    ModuleIdentifier key = new DefaultModuleIdentifier(details.getRequested().getGroup(), details.getRequested().getName());
    if (forcedModules.containsKey(key)) {
        details.useVersion(forcedModules.get(key), VersionSelectionReasons.FORCED);
    }
}
 
Example #12
Source File: ModuleForcingResolveRule.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void execute(DependencyResolveDetailsInternal details) {
    if (forcedModules == null) {
        return;
    }
    ModuleIdentifier key = new DefaultModuleIdentifier(details.getRequested().getGroup(), details.getRequested().getName());
    if (forcedModules.containsKey(key)) {
        details.useVersion(forcedModules.get(key), VersionSelectionReasons.FORCED);
    }
}
 
Example #13
Source File: ModuleForcingResolveRule.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ModuleForcingResolveRule(Collection<? extends ModuleVersionSelector> forcedModules) {
    if (!forcedModules.isEmpty()) {
        this.forcedModules = new HashMap<ModuleIdentifier, String>();
        for (ModuleVersionSelector module : forcedModules) {
            this.forcedModules.put(new DefaultModuleIdentifier(module.getGroup(), module.getName()), module.getVersion());
        }
    } else {
        this.forcedModules = null;
    }
}
 
Example #14
Source File: ExternalResourceResolver.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void doListModuleVersions(DependencyMetaData dependency, BuildableModuleComponentVersionSelectionResolveResult result) {
    ModuleIdentifier module  = new DefaultModuleIdentifier(dependency.getRequested().getGroup(), dependency.getRequested().getName());
    Set<String> versions = new LinkedHashSet<String>();
    VersionPatternVisitor visitor = versionLister.newVisitor(module, versions, result);

    // List modules based on metadata files (artifact version is not considered in listVersionsForAllPatterns())
    IvyArtifactName metaDataArtifact = getMetaDataArtifactName(dependency.getRequested().getName());
    listVersionsForAllPatterns(ivyPatterns, metaDataArtifact, visitor);

    // List modules with missing metadata files
    for (IvyArtifactName otherArtifact : getDependencyArtifactNames(dependency)) {
        listVersionsForAllPatterns(artifactPatterns, otherArtifact, visitor);
    }
    result.listed(versions);
}
 
Example #15
Source File: SingleFileBackedModuleVersionsCache.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ModuleKey read(Decoder decoder) throws Exception {
    String resolverId = decoder.readString();
    String group = decoder.readString();
    String module = decoder.readString();
    return new ModuleKey(resolverId, new DefaultModuleIdentifier(group, module));
}
 
Example #16
Source File: ResolveIvyFactory.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ModuleIdentifier transform(ModuleVersionSelector original) {
    return new DefaultModuleIdentifier(original.getGroup(), original.getName() + ":" + original.getVersion());
}
 
Example #17
Source File: DependencyGraphBuilder.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private ModuleVersionSelectorResolveState(DependencyMetaData dependencyMetaData, DependencyToModuleVersionIdResolver resolver, ResolveState resolveState) {
    this.dependencyMetaData = dependencyMetaData;
    this.resolver = resolver;
    this.resolveState = resolveState;
    targetModule = resolveState.getModule(new DefaultModuleIdentifier(dependencyMetaData.getRequested().getGroup(), dependencyMetaData.getRequested().getName()));
}
 
Example #18
Source File: ResolveIvyFactory.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ModuleIdentifier transform(ModuleVersionSelector original) {
    return new DefaultModuleIdentifier(original.getGroup(), original.getName() + ":" + original.getVersion());
}
 
Example #19
Source File: ResolveIvyFactory.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ModuleIdentifier transform(ModuleVersionSelector original) {
    return new DefaultModuleIdentifier(original.getGroup(), original.getName());
}
 
Example #20
Source File: CachingModuleComponentRepository.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private DefaultModuleIdentifier getCacheKey(ModuleVersionSelector requested) {
    return new DefaultModuleIdentifier(requested.getGroup(), requested.getName());
}
 
Example #21
Source File: SingleFileBackedModuleVersionsCache.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ModuleKey read(Decoder decoder) throws Exception {
    String resolverId = decoder.readString();
    String group = decoder.readString();
    String module = decoder.readString();
    return new ModuleKey(resolverId, new DefaultModuleIdentifier(group, module));
}
 
Example #22
Source File: DependencyGraphBuilder.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private ModuleVersionSelectorResolveState(DependencyMetaData dependencyMetaData, DependencyToComponentIdResolver resolver, ResolveState resolveState) {
    this.dependencyMetaData = dependencyMetaData;
    this.resolver = resolver;
    this.resolveState = resolveState;
    targetModule = resolveState.getModule(new DefaultModuleIdentifier(dependencyMetaData.getRequested().getGroup(), dependencyMetaData.getRequested().getName()));
}
 
Example #23
Source File: DependencyGraphBuilder.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private ModuleVersionSelectorResolveState(DependencyMetaData dependencyMetaData, DependencyToComponentIdResolver resolver, ResolveState resolveState) {
    this.dependencyMetaData = dependencyMetaData;
    this.resolver = resolver;
    this.resolveState = resolveState;
    targetModule = resolveState.getModule(new DefaultModuleIdentifier(dependencyMetaData.getRequested().getGroup(), dependencyMetaData.getRequested().getName()));
}
 
Example #24
Source File: CachingModuleComponentRepository.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private DefaultModuleIdentifier getCacheKey(ModuleVersionSelector requested) {
    return new DefaultModuleIdentifier(requested.getGroup(), requested.getName());
}
 
Example #25
Source File: SingleFileBackedModuleVersionsCache.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ModuleKey read(Decoder decoder) throws Exception {
    String resolverId = decoder.readString();
    String group = decoder.readString();
    String module = decoder.readString();
    return new ModuleKey(resolverId, new DefaultModuleIdentifier(group, module));
}
 
Example #26
Source File: SingleFileBackedModuleVersionsCache.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ModuleKey read(Decoder decoder) throws Exception {
    String resolverId = decoder.readString();
    String group = decoder.readString();
    String module = decoder.readString();
    return new ModuleKey(resolverId, new DefaultModuleIdentifier(group, module));
}
 
Example #27
Source File: ApDependency.java    From atlas with Apache License 2.0 4 votes vote down vote up
public boolean isMainLibrary(ResolvedDependencyInfo dependencyInfo) {
    return mMainDependenciesMap.containsKey(
            DefaultModuleIdentifier.newId(dependencyInfo.getGroup(), dependencyInfo.getName()));
}
 
Example #28
Source File: ApDependency.java    From atlas with Apache License 2.0 4 votes vote down vote up
public Map<ModuleIdentifier, String> getAwbDependencies(String group, String name) {
    ModuleIdentifier moduleIdentifier = DefaultModuleIdentifier.newId(group, name);
    Map<ModuleIdentifier, String> awbDependencies = mAwbDependenciesMap.get(moduleIdentifier);
    return awbDependencies;
}
 
Example #29
Source File: AppModelGradleResolver.java    From quarkus with Apache License 2.0 4 votes vote down vote up
private static ModuleIdentifier getModuleId(ResolvedArtifact a) {
    final String[] split = a.getModuleVersion().toString().split(":");
    return DefaultModuleIdentifier.newId(split[0], split[1]);
}
 
Example #30
Source File: ResolveIvyFactory.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ModuleIdentifier transform(ModuleVersionSelector original) {
    return new DefaultModuleIdentifier(original.getGroup(), original.getName());
}