Java源码示例:org.gradle.api.internal.artifacts.dsl.ParsedModuleStringNotation
示例1
private T createDependencyFromString(String notation) {
ParsedModuleStringNotation parsedNotation = splitModuleFromExtension(notation);
T moduleDependency = instantiator.newInstance(wantedType,
parsedNotation.getGroup(), parsedNotation.getName(), parsedNotation.getVersion());
ModuleFactoryHelper.addExplicitArtifactsIfDefined(moduleDependency, parsedNotation.getArtifactType(), parsedNotation.getClassifier());
return moduleDependency;
}
示例2
private ParsedModuleStringNotation splitModuleFromExtension(String notation) {
Matcher matcher = EXTENSION_SPLITTER.matcher(notation);
boolean hasArtifactType = matcher.matches();
if (hasArtifactType && !ClientModule.class.isAssignableFrom(wantedType)) {
if (matcher.groupCount() != 2) {
throw new InvalidUserDataException("The dependency notation " + notation + " is invalid");
}
return new ParsedModuleStringNotation(matcher.group(1), matcher.group(2));
}
return new ParsedModuleStringNotation(notation, null);
}
示例3
private T createDependencyFromString(String notation) {
ParsedModuleStringNotation parsedNotation = splitModuleFromExtension(notation);
T moduleDependency = instantiator.newInstance(wantedType,
parsedNotation.getGroup(), parsedNotation.getName(), parsedNotation.getVersion());
ModuleFactoryHelper.addExplicitArtifactsIfDefined(moduleDependency, parsedNotation.getArtifactType(), parsedNotation.getClassifier());
return moduleDependency;
}
示例4
private ParsedModuleStringNotation splitModuleFromExtension(String notation) {
Matcher matcher = EXTENSION_SPLITTER.matcher(notation);
boolean hasArtifactType = matcher.matches();
if (hasArtifactType && !ClientModule.class.isAssignableFrom(wantedType)) {
if (matcher.groupCount() != 2) {
throw new InvalidUserDataException("The dependency notation " + notation + " is invalid");
}
return new ParsedModuleStringNotation(matcher.group(1), matcher.group(2));
}
return new ParsedModuleStringNotation(notation, null);
}
示例5
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;
}
示例6
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);
}
示例7
private T createDependencyFromString(String notation) {
ParsedModuleStringNotation parsedNotation = splitModuleFromExtension(notation);
T moduleDependency = instantiator.newInstance(wantedType,
parsedNotation.getGroup(), parsedNotation.getName(), parsedNotation.getVersion());
ModuleFactoryHelper.addExplicitArtifactsIfDefined(moduleDependency, parsedNotation.getArtifactType(), parsedNotation.getClassifier());
return moduleDependency;
}
示例8
private ParsedModuleStringNotation splitModuleFromExtension(String notation) {
Matcher matcher = EXTENSION_SPLITTER.matcher(notation);
boolean hasArtifactType = matcher.matches();
if (hasArtifactType && !ClientModule.class.isAssignableFrom(wantedType)) {
if (matcher.groupCount() != 2) {
throw new InvalidUserDataException("The dependency notation " + notation + " is invalid");
}
return new ParsedModuleStringNotation(matcher.group(1), matcher.group(2));
}
return new ParsedModuleStringNotation(notation, null);
}
示例9
private T createDependencyFromString(String notation) {
ParsedModuleStringNotation parsedNotation = splitModuleFromExtension(notation);
T moduleDependency = instantiator.newInstance(wantedType,
parsedNotation.getGroup(), parsedNotation.getName(), parsedNotation.getVersion());
ModuleFactoryHelper.addExplicitArtifactsIfDefined(moduleDependency, parsedNotation.getArtifactType(), parsedNotation.getClassifier());
return moduleDependency;
}
示例10
private ParsedModuleStringNotation splitModuleFromExtension(String notation) {
Matcher matcher = EXTENSION_SPLITTER.matcher(notation);
boolean hasArtifactType = matcher.matches();
if (hasArtifactType && !ClientModule.class.isAssignableFrom(wantedType)) {
if (matcher.groupCount() != 2) {
throw new InvalidUserDataException("The dependency notation " + notation + " is invalid");
}
return new ParsedModuleStringNotation(matcher.group(1), matcher.group(2));
}
return new ParsedModuleStringNotation(notation, null);
}