Search in sources :

Example 6 with RepositoryTransport

use of org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport in project MyLuaApp-Build-Core by dingyi222666.

the class DefaultMavenLocalArtifactRepository method createRealResolver.

@Override
protected MavenResolver createRealResolver() {
    URI rootUri = validateUrl();
    RepositoryTransport transport = getTransport(rootUri.getScheme());
    MavenMetadataLoader mavenMetadataLoader = new MavenMetadataLoader(transport.getResourceAccessor(), getResourcesFileStore());
    Instantiator injector = createInjectorForMetadataSuppliers(transport, getInstantiatorFactory(), rootUri, getResourcesFileStore());
    MavenResolver resolver = new MavenResolver(getName(), rootUri, transport, getLocallyAvailableResourceFinder(), getArtifactFileStore(), createMetadataSources(mavenMetadataLoader), MavenMetadataArtifactProvider.INSTANCE, mavenMetadataLoader, null, null, injector, checksumService);
    for (URI repoUrl : getArtifactUrls()) {
        resolver.addArtifactLocation(repoUrl);
    }
    return resolver;
}
Also used : MavenResolver(org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver) Instantiator(org.gradle.internal.reflect.Instantiator) RepositoryTransport(org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport) MavenMetadataLoader(org.gradle.api.internal.artifacts.repositories.maven.MavenMetadataLoader) URI(java.net.URI)

Example 7 with RepositoryTransport

use of org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport in project gradle by gradle.

the class DependencyManagementBuildScopeServices method createTextResourceLoader.

TextResourceLoader createTextResourceLoader(ExternalResourceFileStore resourceFileStore, RepositoryTransportFactory repositoryTransportFactory) {
    HashSet<String> schemas = Sets.newHashSet("https", "http");
    RepositoryTransport transport = repositoryTransportFactory.createTransport(schemas, "http auth", Collections.<Authentication>emptyList());
    ExternalResourceAccessor externalResourceAccessor = new DefaultExternalResourceAccessor(resourceFileStore, transport.getResourceAccessor());
    return new DefaultUriTextResourceLoader(externalResourceAccessor, schemas);
}
Also used : DefaultExternalResourceAccessor(org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceAccessor) DefaultUriTextResourceLoader(org.gradle.internal.resource.transfer.DefaultUriTextResourceLoader) ExternalResourceAccessor(org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceAccessor) DefaultExternalResourceAccessor(org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceAccessor) RepositoryTransport(org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport)

Example 8 with RepositoryTransport

use of org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport in project MyLuaApp-Build-Core by dingyi222666.

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.");
    }
    RepositoryTransport transport = transportFactory.createFileTransport(getName());
    Instantiator injector = createInjectorForMetadataSuppliers(transport, instantiatorFactory, null, null);
    IvyResolver resolver = new IvyResolver(getName(), transport, locallyAvailableResourceFinder, false, artifactFileStore, null, null, createMetadataSources(), IvyMetadataArtifactProvider.INSTANCE, injector, checksumService);
    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) IvyResolver(org.gradle.api.internal.artifacts.repositories.resolver.IvyResolver) Instantiator(org.gradle.internal.reflect.Instantiator) RepositoryTransport(org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport) File(java.io.File)

Example 9 with RepositoryTransport

use of org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport 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.");
    }
    RepositoryTransport transport = transportFactory.createFileTransport(getName());
    Instantiator injector = createInjectorForMetadataSuppliers(transport, instantiatorFactory, null, null);
    IvyResolver resolver = new IvyResolver(getName(), transport, locallyAvailableResourceFinder, false, artifactFileStore, null, null, createMetadataSources(), IvyMetadataArtifactProvider.INSTANCE, injector, checksumService);
    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) IvyResolver(org.gradle.api.internal.artifacts.repositories.resolver.IvyResolver) Instantiator(org.gradle.internal.reflect.Instantiator) RepositoryTransport(org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport) File(java.io.File)

Aggregations

RepositoryTransport (org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport)9 Instantiator (org.gradle.internal.reflect.Instantiator)6 URI (java.net.URI)4 MavenMetadataLoader (org.gradle.api.internal.artifacts.repositories.maven.MavenMetadataLoader)4 MavenResolver (org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver)4 File (java.io.File)2 InvalidUserDataException (org.gradle.api.InvalidUserDataException)2 ComponentMetadataListerDetails (org.gradle.api.artifacts.ComponentMetadataListerDetails)2 ComponentMetadataSupplierDetails (org.gradle.api.artifacts.ComponentMetadataSupplierDetails)2 DefaultImmutableMetadataSources (org.gradle.api.internal.artifacts.repositories.metadata.DefaultImmutableMetadataSources)2 ImmutableMetadataSources (org.gradle.api.internal.artifacts.repositories.metadata.ImmutableMetadataSources)2 IvyResolver (org.gradle.api.internal.artifacts.repositories.resolver.IvyResolver)2 ExternalResourceRepository (org.gradle.internal.resource.ExternalResourceRepository)2 DefaultMavenArtifactRepository (org.gradle.api.internal.artifacts.repositories.DefaultMavenArtifactRepository)1 DefaultExternalResourceAccessor (org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceAccessor)1 ExternalResourceAccessor (org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceAccessor)1 DefaultUriTextResourceLoader (org.gradle.internal.resource.transfer.DefaultUriTextResourceLoader)1