本文整理汇总了Java中org.gradle.api.IllegalDependencyNotation类的典型用法代码示例。如果您正苦于以下问题:Java IllegalDependencyNotation类的具体用法?Java IllegalDependencyNotation怎么用?Java IllegalDependencyNotation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IllegalDependencyNotation类属于org.gradle.api包,在下文中一共展示了IllegalDependencyNotation类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convert
import org.gradle.api.IllegalDependencyNotation; //导入依赖的package包/类
public void convert(String notation, NotationConvertResult<? super ModuleVersionSelector> result) throws TypeConversionException {
ParsedModuleStringNotation parsed;
try {
parsed = new ParsedModuleStringNotation(notation, null);
} catch (IllegalDependencyNotation e) {
throw new InvalidUserDataException(
"Invalid format: '" + notation + "'. The correct notation is a 3-part group:name:version notation, "
+ "e.g: 'org.gradle:gradle-core:1.0'");
}
if (parsed.getGroup() == null || parsed.getName() == null || parsed.getVersion() == null) {
throw new InvalidUserDataException(
"Invalid format: '" + notation + "'. Group, name and version cannot be empty. Correct example: "
+ "'org.gradle:gradle-core:1.0'");
}
result.converted(newSelector(parsed.getGroup(), parsed.getName(), parsed.getVersion()));
}
示例2: convert
import org.gradle.api.IllegalDependencyNotation; //导入依赖的package包/类
public void convert(String notation, NotationConvertResult<? super ComponentSelector> result) throws TypeConversionException {
ParsedModuleStringNotation parsed;
try {
parsed = new ParsedModuleStringNotation(notation, null);
} catch (IllegalDependencyNotation e) {
throw new InvalidUserDataException(
"Invalid format: '" + notation + "'. The correct notation is a 3-part group:name:version notation, "
+ "e.g: 'org.gradle:gradle-core:1.0'");
}
if (parsed.getGroup() == null || parsed.getName() == null || parsed.getVersion() == null) {
throw new InvalidUserDataException(
"Invalid format: '" + notation + "'. Group, name and version cannot be empty. Correct example: "
+ "'org.gradle:gradle-core:1.0'");
}
result.converted(newSelector(parsed.getGroup(), parsed.getName(), parsed.getVersion()));
}
示例3: assignValuesFromModuleNotation
import org.gradle.api.IllegalDependencyNotation; //导入依赖的package包/类
private void assignValuesFromModuleNotation(String moduleNotation) {
int count = 0;
int idx = 0;
int cur = -1;
while (++cur < moduleNotation.length()) {
if (':' == moduleNotation.charAt(cur)) {
String fragment = moduleNotation.substring(idx, cur);
assignValue(count, fragment);
idx = cur + 1;
count++;
}
}
assignValue(count, moduleNotation.substring(idx, cur));
count++;
if (count < 2 || count > 4) {
throw new IllegalDependencyNotation("Supplied String module notation '" + moduleNotation + "' is invalid. Example notations: 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core:1.9.5:javadoc'.");
}
}
示例4: assignValuesFromModuleNotation
import org.gradle.api.IllegalDependencyNotation; //导入依赖的package包/类
private void assignValuesFromModuleNotation(String moduleNotation) {
int count = 0;
int idx = 0;
int cur = -1;
while (++cur < moduleNotation.length()) {
if (':' == moduleNotation.charAt(cur)) {
String fragment = moduleNotation.substring(idx, cur);
assignValue(count, fragment);
idx = cur + 1;
count++;
}
}
assignValue(count, moduleNotation.substring(idx, cur));
count++;
if (count < 2 || count > 5) {
throw new IllegalDependencyNotation("Supplied String module notation '" + moduleNotation
+ "' is invalid. Example notations: 'org.gradle:gradle-core:2.2', "
+ "'org.mockito:mockito-core:1.9.5:javadoc'.");
}
}
示例5: parseType
import org.gradle.api.IllegalDependencyNotation; //导入依赖的package包/类
public ModuleVersionSelector parseType(CharSequence notation) {
ParsedModuleStringNotation parsed;
try {
parsed = new ParsedModuleStringNotation(notation.toString(), null);
} catch (IllegalDependencyNotation e) {
throw new InvalidUserDataException(
"Invalid format: '" + notation + "'. The Correct notation is a 3-part group:name:version notation, "
+ "e.g: 'org.gradle:gradle-core:1.0'");
}
if (parsed.getGroup() == null || parsed.getName() == null || parsed.getVersion() == null) {
throw new InvalidUserDataException(
"Invalid format: '" + notation + "'. Group, name and version cannot be empty. Correct example: "
+ "'org.gradle:gradle-core:1.0'");
}
return newSelector(parsed.getGroup(), parsed.getName(), parsed.getVersion());
}
示例6: DefaultModuleDependencySpec
import org.gradle.api.IllegalDependencyNotation; //导入依赖的package包/类
public DefaultModuleDependencySpec(String group, String name, String version) {
if (group == null || name == null) {
throw new IllegalDependencyNotation("A module dependency must have at least a group and a module name specified.");
}
this.group = group;
this.name = name;
this.version = version;
}
示例7: DefaultLibraryBinaryDependencySpec
import org.gradle.api.IllegalDependencyNotation; //导入依赖的package包/类
public DefaultLibraryBinaryDependencySpec(String projectPath, String libraryName, String variant) {
if (libraryName == null || projectPath == null || variant == null) {
throw new IllegalDependencyNotation("A direct library binary dependency must have all of project, library name and variant specified.");
}
this.libraryName = libraryName;
this.projectPath = projectPath;
this.variant = variant;
}
示例8: DefaultProjectDependencySpec
import org.gradle.api.IllegalDependencyNotation; //导入依赖的package包/类
public DefaultProjectDependencySpec(String libraryName, String projectPath) {
if (libraryName == null && projectPath == null) {
throw new IllegalDependencyNotation("A project dependency must have at least a project or library name specified.");
}
this.libraryName = libraryName;
this.projectPath = projectPath;
}
示例9: assignValuesFromModuleNotation
import org.gradle.api.IllegalDependencyNotation; //导入依赖的package包/类
private void assignValuesFromModuleNotation(String moduleNotation) {
String[] moduleNotationParts = moduleNotation.split(":");
if (moduleNotationParts.length < 2 || moduleNotationParts.length > 4) {
throw new IllegalDependencyNotation("Supplied String module notation '" + moduleNotation + "' is invalid. Example notations: 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core:1.9.5:javadoc'.");
}
group = GUtil.elvis(moduleNotationParts[0], null);
name = moduleNotationParts[1];
version = moduleNotationParts.length == 2 ? null : moduleNotationParts[2];
if (moduleNotationParts.length == 4) {
classifier = moduleNotationParts[3];
}
}
示例10: assignValuesFromModuleNotation
import org.gradle.api.IllegalDependencyNotation; //导入依赖的package包/类
private void assignValuesFromModuleNotation(String moduleNotation) {
String[] moduleNotationParts = moduleNotation.split(":");
if (moduleNotationParts.length < 2 || moduleNotationParts.length > 4) {
throw new IllegalDependencyNotation("The description " + moduleNotation + " is invalid");
}
group = GUtil.elvis(moduleNotationParts[0], null);
name = moduleNotationParts[1];
version = moduleNotationParts.length == 2 ? null : moduleNotationParts[2];
if (moduleNotationParts.length == 4) {
classifier = moduleNotationParts[3];
}
}
示例11: checkNotSet
import org.gradle.api.IllegalDependencyNotation; //导入依赖的package包/类
private void checkNotSet(String name, String value) {
if (value != null) {
throw new IllegalDependencyNotation(String.format("Cannot set '%s' multiple times for module dependency.", name));
}
}
示例12: illegalNotation
import org.gradle.api.IllegalDependencyNotation; //导入依赖的package包/类
private IllegalDependencyNotation illegalNotation(String moduleId) {
return new IllegalDependencyNotation(
String.format(
"'%s' is not a valid module dependency notation. Example notations: 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core'.",
moduleId));
}
示例13: checkNotSet
import org.gradle.api.IllegalDependencyNotation; //导入依赖的package包/类
private void checkNotSet(String name, String value) {
if (value != null) {
throw new IllegalDependencyNotation(String.format("Cannot set '%s' multiple times for project dependency.", name));
}
}
示例14: validate
import org.gradle.api.IllegalDependencyNotation; //导入依赖的package包/类
private void validate() {
if (projectPath == null && libraryName != null && libraryName.contains(":")) {
throw new IllegalDependencyNotation(
String.format("'%s' is not a valid library name. Did you mean to refer to a module instead?", libraryName));
}
}