Search in sources :

Example 1 with IvyResolver

use of org.gradle.api.internal.artifacts.repositories.resolver.IvyResolver in project gradle by gradle.

the class DefaultFlatDirArtifactRepository method createRealResolver.

private IvyResolver createRealResolver() {
    Set<File> dirs = getDirs();
    if (dirs.isEmpty()) {
        throw new InvalidUserDataException("You must specify at least one directory for a flat directory repository.");
    }
    IvyResolver resolver = new IvyResolver(getName(), transportFactory.createTransport("file", getName(), Collections.<Authentication>emptyList()), locallyAvailableResourceFinder, false, artifactFileStore, ivyContextManager, moduleIdentifierFactory, null);
    for (File root : dirs) {
        resolver.addArtifactLocation(root.toURI(), "/[artifact]-[revision](-[classifier]).[ext]");
        resolver.addArtifactLocation(root.toURI(), "/[artifact](-[classifier]).[ext]");
    }
    return resolver;
}
Also used : InvalidUserDataException(org.gradle.api.InvalidUserDataException) Authentication(org.gradle.authentication.Authentication) IvyResolver(org.gradle.api.internal.artifacts.repositories.resolver.IvyResolver) File(java.io.File)

Example 2 with IvyResolver

use of org.gradle.api.internal.artifacts.repositories.resolver.IvyResolver in project gradle by gradle.

the class DefaultIvyArtifactRepository method createRealResolver.

protected IvyResolver createRealResolver() {
    URI uri = getUrl();
    Set<String> schemes = new LinkedHashSet<String>();
    layout.addSchemes(uri, schemes);
    additionalPatternsLayout.addSchemes(uri, schemes);
    IvyResolver resolver = createResolver(schemes);
    layout.apply(uri, resolver);
    additionalPatternsLayout.apply(uri, resolver);
    return resolver;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) IvyResolver(org.gradle.api.internal.artifacts.repositories.resolver.IvyResolver) URI(java.net.URI)

Aggregations

IvyResolver (org.gradle.api.internal.artifacts.repositories.resolver.IvyResolver)2 File (java.io.File)1 URI (java.net.URI)1 LinkedHashSet (java.util.LinkedHashSet)1 InvalidUserDataException (org.gradle.api.InvalidUserDataException)1 Authentication (org.gradle.authentication.Authentication)1