Java Code Examples for org.gradle.api.internal.artifacts.dsl.ParsedModuleStringNotation

The following examples show how to use org.gradle.api.internal.artifacts.dsl.ParsedModuleStringNotation. These examples are extracted from open source projects. 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
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;
    }
 
Example 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);
}
 
Example 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;
    }
 
Example 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);
}
 
Example 5
Source Project: atlas   Source File: ApDependency.java    License: 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 6
Source Project: atlas   Source File: ApDependency.java    License: 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 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;
    }
 
Example 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);
}
 
Example 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;
    }
 
Example 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);
}