use of org.gradle.api.internal.artifacts.dsl.ParsedModuleStringNotation in project atlas by alibaba.
the class ApDependency method addDependency.
// ----- PRIVATE TASK API -----
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);
}
use of org.gradle.api.internal.artifacts.dsl.ParsedModuleStringNotation in project atlas by alibaba.
the class ApDependency method getAwbDependencies.
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;
}
use of org.gradle.api.internal.artifacts.dsl.ParsedModuleStringNotation in project gradle by gradle.
the class DependencyStringNotationConverter method createDependencyFromString.
private T createDependencyFromString(String notation) {
ParsedModuleStringNotation parsedNotation = splitModuleFromExtension(notation);
StrictVersionParser.RichVersion version = strictVersionParser.parse(parsedNotation.getVersion());
T moduleDependency = instantiator.newInstance(wantedType, stringInterner.intern(parsedNotation.getGroup()), stringInterner.intern(parsedNotation.getName()), stringInterner.intern(version.require));
maybeEnrichVersion(version, moduleDependency);
if (moduleDependency instanceof ExternalDependency) {
ModuleFactoryHelper.addExplicitArtifactsIfDefined((ExternalDependency) moduleDependency, parsedNotation.getArtifactType(), parsedNotation.getClassifier());
}
return moduleDependency;
}
use of org.gradle.api.internal.artifacts.dsl.ParsedModuleStringNotation in project gradle by gradle.
the class DependencyStringNotationConverter method splitModuleFromExtension.
private ParsedModuleStringNotation splitModuleFromExtension(String notation) {
int idx = notation.lastIndexOf('@');
if (idx == -1 || ClientModule.class.isAssignableFrom(wantedType)) {
return new ParsedModuleStringNotation(notation, null);
}
int versionIndx = notation.lastIndexOf(':');
if (versionIndx < idx) {
return new ParsedModuleStringNotation(notation.substring(0, idx), notation.substring(idx + 1));
}
return new ParsedModuleStringNotation(notation, null);
}
Aggregations