当前位置: 首页>>代码示例>>Java>>正文


Java IllegalDependencyNotation类代码示例

本文整理汇总了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()));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:ModuleVersionSelectorParsers.java

示例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()));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:ComponentSelectorParsers.java

示例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'.");
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:19,代码来源:ParsedModuleStringNotation.java

示例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'.");
    }
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:21,代码来源:ParsedModuleStringNotation.java

示例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());
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:18,代码来源:ModuleVersionSelectorParsers.java

示例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;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultModuleDependencySpec.java

示例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;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultLibraryBinaryDependencySpec.java

示例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;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultProjectDependencySpec.java

示例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];
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:13,代码来源:ParsedModuleStringNotation.java

示例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];
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:13,代码来源:ParsedModuleStringNotation.java

示例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));
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:6,代码来源:DefaultModuleDependencySpec.java

示例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));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:7,代码来源:DefaultModuleDependencySpec.java

示例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));
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:6,代码来源:DefaultProjectDependencySpec.java

示例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));
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:7,代码来源:DefaultProjectDependencySpec.java


注:本文中的org.gradle.api.IllegalDependencyNotation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。