Java 类org.gradle.api.internal.component.ArtifactType 实例源码

项目:xmvn    文件:GradleResolver.java   
@Override
public void resolveArtifactsWithType( ComponentResolveMetadata component, ArtifactType type,
                                      BuildableArtifactSetResolveResult result )
{
    if ( type != ArtifactType.MAVEN_POM )
    {
        logger.debug( "resolveModuleArtifacts() called for artifact type {}", type );
        result.failed( new ArtifactResolveException( "resolveModuleArtifacts() is implemended only for Maven POMs" ) );
        return;
    }

    ModuleComponentIdentifier id = (ModuleComponentIdentifier) component.getComponentId();
    DefaultIvyArtifactName name = new DefaultIvyArtifactName( id.getModule(), "pom", "pom" );
    DefaultModuleComponentArtifactMetadata resolvedMetaData =
        new DefaultModuleComponentArtifactMetadata( id, name );
    result.resolved( Collections.singleton( resolvedMetaData ) );
}
项目:net.akehurst.build.gradle    文件:AbstractP2RepositoryAccess.java   
@Override
public void resolveModuleArtifacts(ComponentResolveMetaData component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    LOG.trace("resolveModuleArtifacts");
    ModuleComponentResolveMetaData moduleMetaData = (ModuleComponentResolveMetaData) component;

    if (artifactType == ArtifactType.JAVADOC) {
        resolveJavadocArtifacts(moduleMetaData, result);
    } else if (artifactType == ArtifactType.SOURCES) {
        resolveSourceArtifacts(moduleMetaData, result);
        // } else if (isMetaDataArtifact(artifactType)) {
        // resolveMetaDataArtifacts(moduleMetaData, result);
    } else {
        int i = 0;
    }
    LOG.trace("resolveModuleArtifacts - end");
}
项目:Reer    文件:CacheLockingArtifactResolver.java   
@Override
public void resolveArtifactsWithType(final ComponentResolveMetadata component, final ArtifactType artifactType, final BuildableArtifactSetResolveResult result) {
    String description = "Resolve " + artifactType + " for " + component;
    lockingManager.useCache(description, new Runnable() {
        public void run() {
            delegate.resolveArtifactsWithType(component, artifactType, result);
        }
    });
}
项目:Reer    文件:ErrorHandlingModuleComponentRepository.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    try {
        delegate.resolveArtifactsWithType(component, artifactType, result);
    } catch (Throwable throwable) {
        result.failed(new ArtifactResolveException(component.getComponentId(), throwable));
    }
}
项目:Reer    文件:ResolveIvyFactory.java   
@Override
public void resolveArtifactsWithType(final ComponentResolveMetadata component, final ArtifactType artifactType, final BuildableArtifactSetResolveResult result) {
    cacheLockingManager.useCache("Resolve " + artifactType + " for " + component, new Runnable() {
        public void run() {
            delegate.getArtifactResolver().resolveArtifactsWithType(component, artifactType, result);
        }
    });
}
项目:Reer    文件:CacheLockReleasingModuleComponentsRepository.java   
@Override
public void resolveArtifactsWithType(final ComponentResolveMetadata component, final ArtifactType artifactType, final BuildableArtifactSetResolveResult result) {
    cacheLockingManager.longRunningOperation("Resolve " + artifactType + " for " + component + " using repository " + name, new Runnable() {
        public void run() {
            delegate.resolveArtifactsWithType(component, artifactType, result);
        }
    });
}
项目:Reer    文件:InMemoryArtifactsCache.java   
public boolean supplyArtifacts(ComponentIdentifier component, ArtifactType type, BuildableArtifactSetResolveResult result) {
    Set<ComponentArtifactMetadata> artifacts = typedArtifacts.get(new TypedArtifactsKey(component, type));
    if (artifacts != null) {
        result.resolved(artifacts);
        return true;
    }
    return false;
}
项目:Reer    文件:InMemoryCachedModuleComponentRepository.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    if (!artifactsCache.supplyArtifacts(component.getComponentId(), artifactType, result)) {
        super.resolveArtifactsWithType(component, artifactType, result);
        artifactsCache.newArtifacts(component.getComponentId(), artifactType, result);
    }
}
项目:Reer    文件:CachingModuleComponentRepository.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    final CachingModuleSource cachedModuleSource = (CachingModuleSource) component.getSource();

    // First try to determine the artifacts in-memory (e.g using the metadata): don't use the cache in this case
    delegate.getLocalAccess().resolveArtifactsWithType(component.withSource(cachedModuleSource.getDelegate()), artifactType, result);
    if (result.hasResult()) {
        return;
    }

    resolveModuleArtifactsFromCache(cacheKey(artifactType), component, result, cachedModuleSource);
}
项目:Reer    文件:CachingModuleComponentRepository.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    final CachingModuleSource moduleSource = (CachingModuleSource) component.getSource();
    delegate.getRemoteAccess().resolveArtifactsWithType(component.withSource(moduleSource.getDelegate()), artifactType, result);

    if (result.getFailure() == null) {
        moduleArtifactsCache.cacheArtifacts(delegate, component.getComponentId(), cacheKey(artifactType), moduleSource.getDescriptorHash(), result.getResult());
    }
}
项目:Reer    文件:RepositoryChainArtifactResolver.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    ModuleComponentRepository sourceRepository = findSourceRepository(component.getSource());
    ComponentResolveMetadata unpackedComponent = unpackSource(component);
    // First try to determine the artifacts locally before going remote
    sourceRepository.getLocalAccess().resolveArtifactsWithType(unpackedComponent, artifactType, result);
    if (!result.hasResult()) {
        sourceRepository.getRemoteAccess().resolveArtifactsWithType(unpackedComponent, artifactType, result);
    }
}
项目:Reer    文件:ErrorHandlingArtifactResolver.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    try {
        resolver.resolveArtifactsWithType(component, artifactType, result);
    } catch (Throwable t) {
        result.failed(new ArtifactResolveException(component.getComponentId(), t));
    }
}
项目:Reer    文件:LocalModuleComponentRepository.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    delegate.getLocalAccess().resolveArtifactsWithType(component, artifactType, result);
    if(!result.hasResult()) {
        delegate.getRemoteAccess().resolveArtifactsWithType(component, artifactType, result);
    }
}
项目:Reer    文件:ComponentResolversChain.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    for (ArtifactResolver resolver : resolvers) {
        if (result.hasResult()) {
            return;
        }
        resolver.resolveArtifactsWithType(component, artifactType, result);
    }
}
项目:Reer    文件:ExternalResourceResolver.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    T moduleMetaData = getSupportedMetadataType().cast(component);
    if (artifactType == ArtifactType.JAVADOC) {
        resolveJavadocArtifacts(moduleMetaData, result);
    } else if (artifactType == ArtifactType.SOURCES) {
        resolveSourceArtifacts(moduleMetaData, result);
    } else if (isMetaDataArtifact(artifactType)) {
        resolveMetaDataArtifacts(moduleMetaData, result);
    }
}
项目:Reer    文件:ExternalResourceResolverDescriptorParseContext.java   
private File resolveMetaDataArtifactFile(ModuleComponentIdentifier moduleComponentIdentifier, ComponentMetaDataResolver componentResolver,
                                         ArtifactResolver artifactResolver, ArtifactType artifactType) {
    BuildableComponentResolveResult moduleVersionResolveResult = new DefaultBuildableComponentResolveResult();
    componentResolver.resolve(moduleComponentIdentifier, new DefaultComponentOverrideMetadata(), moduleVersionResolveResult);

    BuildableArtifactSetResolveResult moduleArtifactsResolveResult = new DefaultBuildableArtifactSetResolveResult();
    artifactResolver.resolveArtifactsWithType(moduleVersionResolveResult.getMetaData(), artifactType, moduleArtifactsResolveResult);

    BuildableArtifactResolveResult artifactResolveResult = new DefaultBuildableArtifactResolveResult();
    ComponentArtifactMetadata artifactMetaData = moduleArtifactsResolveResult.getResult().iterator().next();
    artifactResolver.resolveArtifact(artifactMetaData, moduleVersionResolveResult.getMetaData().getSource(), artifactResolveResult);
    return artifactResolveResult.getResult();
}
项目:Reer    文件:JvmPluginServiceRegistry.java   
/***
 * @param registration unused parameter required by convention, see {@link org.gradle.internal.service.DefaultServiceRegistry}.
 */
public void configure(ServiceRegistration registration,
                      ComponentTypeRegistry componentTypeRegistry) {
    componentTypeRegistry
        .maybeRegisterComponentType(JvmLibrary.class)
        .registerArtifactType(SourcesArtifact.class, ArtifactType.SOURCES);
}
项目:xmvn    文件:GradleResolver.java   
@Override
public LocallyAvailableExternalResource getMetaDataArtifact( ModuleComponentIdentifier id, ArtifactType type )
{
    Path pomPath = resolve( new DefaultArtifact( id.getGroup(), id.getModule(), "pom", id.getVersion() ) );

    if ( pomPath == null )
        return null;

    DefaultExternalResourceMetaData metadata = new DefaultExternalResourceMetaData( pomPath.toUri(), 0, 0 );
    return fileRepository.resource( pomPath.toFile(), pomPath.toUri(), metadata );
}
项目:Pushjet-Android    文件:ContextualArtifactResolver.java   
public void resolveModuleArtifacts(final ComponentResolveMetaData component, final ArtifactType artifactType, final BuildableArtifactSetResolveResult result) {
    executeInContext(String.format("Resolve %s for %s", artifactType, component), new Action<Ivy>() {
        public void execute(Ivy ivy) {
            delegate.resolveModuleArtifacts(component, artifactType, result);
        }
    });
}
项目:Pushjet-Android    文件:ResolveIvyFactory.java   
public void resolveModuleArtifacts(final ComponentResolveMetaData component, final ArtifactType artifactType, final BuildableArtifactSetResolveResult result) {
    cacheLockingManager.useCache(String.format("Resolve %s for %s", artifactType, component), new Runnable() {
        public void run() {
            artifactResolver.resolveModuleArtifacts(component, artifactType, result);
        }
    });
}
项目:Pushjet-Android    文件:CacheLockReleasingModuleComponentsRepository.java   
public void resolveModuleArtifacts(final ComponentResolveMetaData component, final ArtifactType artifactType, final BuildableArtifactSetResolveResult result) {
    cacheLockingManager.longRunningOperation(String.format("Resolve %s for %s using repository %s", artifactType, component, name), new Runnable() {
        public void run() {
            delegate.resolveModuleArtifacts(component, artifactType, result);
        }
    });
}
项目:Pushjet-Android    文件:CachingModuleComponentRepository.java   
public void resolveModuleArtifacts(ComponentResolveMetaData component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    final CachingModuleSource cachedModuleSource = (CachingModuleSource) component.getSource();

    // First try to determine the artifacts in-memory (e.g using the metadata): don't use the cache in this case
    delegate.getLocalAccess().resolveModuleArtifacts(component.withSource(cachedModuleSource.getDelegate()), artifactType, result);
    if (result.hasResult()) {
        return;
    }

    resolveModuleArtifactsFromCache(cacheKey(artifactType), component, result, cachedModuleSource);
}
项目:Pushjet-Android    文件:RepositoryChainArtifactResolver.java   
public void resolveModuleArtifacts(ComponentResolveMetaData component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    ModuleComponentRepository sourceRepository = findSourceRepository(component.getSource());
    ComponentResolveMetaData unpackedComponent = unpackSource(component);
    // First try to determine the artifacts locally before going remote
    sourceRepository.getLocalAccess().resolveModuleArtifacts(unpackedComponent, artifactType, result);
    if (!result.hasResult()) {
        sourceRepository.getRemoteAccess().resolveModuleArtifacts(unpackedComponent, artifactType, result);
    }
}
项目:Pushjet-Android    文件:ErrorHandlingArtifactResolver.java   
public void resolveModuleArtifacts(ComponentResolveMetaData component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    try {
        resolver.resolveModuleArtifacts(component, artifactType, result);
    } catch (Throwable t) {
        result.failed(new ArtifactResolveException(component.getComponentId(), t));
    }
}
项目:Pushjet-Android    文件:ExternalResourceResolver.java   
public void resolveModuleArtifacts(ComponentResolveMetaData component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    ModuleComponentResolveMetaData moduleMetaData = (ModuleComponentResolveMetaData) component;

    if (artifactType == ArtifactType.JAVADOC) {
        resolveJavadocArtifacts(moduleMetaData, result);
    } else if (artifactType == ArtifactType.SOURCES) {
        resolveSourceArtifacts(moduleMetaData, result);
    } else if (isMetaDataArtifact(artifactType)) {
        resolveMetaDataArtifacts(moduleMetaData, result);
    }
}
项目:Pushjet-Android    文件:ExternalResourceResolverDescriptorParseContext.java   
private File resolveMetaDataArtifactFile(ModuleVersionIdentifier moduleVersionIdentifier, DependencyToComponentResolver dependencyResolver,
                                         ArtifactResolver artifactResolver, ArtifactType artifactType) {
    BuildableComponentResolveResult moduleVersionResolveResult = new DefaultBuildableComponentResolveResult();
    dependencyResolver.resolve(new DefaultDependencyMetaData(moduleVersionIdentifier), moduleVersionResolveResult);

    BuildableArtifactSetResolveResult moduleArtifactsResolveResult = new DefaultBuildableArtifactSetResolveResult();
    artifactResolver.resolveModuleArtifacts(moduleVersionResolveResult.getMetaData(), artifactType, moduleArtifactsResolveResult);

    BuildableArtifactResolveResult artifactResolveResult = new DefaultBuildableArtifactResolveResult();
    ComponentArtifactMetaData artifactMetaData = moduleArtifactsResolveResult.getArtifacts().iterator().next();
    artifactResolver.resolveArtifact(artifactMetaData, moduleVersionResolveResult.getMetaData().getSource(), artifactResolveResult);
    return artifactResolveResult.getFile();
}
项目:Reer    文件:LocalLibraryDependencyResolver.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    if (isLibrary(component.getComponentId())) {
        result.resolved(Collections.<ComponentArtifactMetadata>emptySet());
    }
}
项目:Reer    文件:MavenPublishServices.java   
public void configure(ServiceRegistration registration, ComponentTypeRegistry componentTypeRegistry) {
    // TODO There should be a more explicit way to execute an action against existing services
    componentTypeRegistry.maybeRegisterComponentType(MavenModule.class)
            .registerArtifactType(MavenPomArtifact.class, ArtifactType.MAVEN_POM);
}
项目:Reer    文件:ProjectDependencyResolver.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    if (isProjectModule(component.getComponentId())) {
        throw new UnsupportedOperationException("Resolving artifacts by type is not yet supported for project modules");
    }
}
项目:Reer    文件:IvyXmlModuleDescriptorParser.java   
protected ModuleDescriptor parseOtherIvyFile(String parentOrganisation, String parentModule, String parentRevision) throws IOException, ParseException, SAXException {
    ModuleComponentIdentifier importedId = DefaultModuleComponentIdentifier.newId(parentOrganisation, parentModule, parentRevision);
    LocallyAvailableExternalResource externalResource = parseContext.getMetaDataArtifact(importedId, ArtifactType.IVY_DESCRIPTOR);

    return parseModuleDescriptor(externalResource, externalResource.getLocalResource().getFile().toURI().toURL());
}
项目:Reer    文件:DisconnectedDescriptorParseContext.java   
public LocallyAvailableExternalResource getMetaDataArtifact(ModuleComponentIdentifier moduleComponentIdentifier, ArtifactType artifactType) {
    throw new UnsupportedOperationException();
}
项目:Reer    文件:StartParameterResolutionOverride.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    result.failed(new ArtifactResolveException(component.getComponentId(), "No cached version available for offline mode"));
}
项目:Reer    文件:NoRepositoriesResolver.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    throw new UnsupportedOperationException();
}
项目:Reer    文件:InMemoryArtifactsCache.java   
public void newArtifacts(ComponentIdentifier component, ArtifactType type, BuildableArtifactSetResolveResult result) {
    if (result.isSuccessful()) {
        this.typedArtifacts.put(new TypedArtifactsKey(component, type), ImmutableSet.copyOf(result.getResult()));
    }
}
项目:Reer    文件:InMemoryArtifactsCache.java   
public TypedArtifactsKey(ComponentIdentifier componentId, ArtifactType type) {
    this.componentId = componentId;
    this.type = type;
}
项目:Reer    文件:CachingModuleComponentRepository.java   
private String cacheKey(ArtifactType artifactType) {
    return "artifacts:" + artifactType.name();
}
项目:Reer    文件:LocalModuleComponentRepository.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
}
项目:Reer    文件:BaseModuleComponentRepositoryAccess.java   
@Override
public void resolveArtifactsWithType(ComponentResolveMetadata component, ArtifactType artifactType, BuildableArtifactSetResolveResult result) {
    delegate.resolveArtifactsWithType(component, artifactType, result);
}
项目:Reer    文件:CachedModuleDescriptorParseContext.java   
public LocallyAvailableExternalResource getMetaDataArtifact(ModuleComponentIdentifier componentIdentifier, ArtifactType artifactType) {
    throw new UnsupportedOperationException();
}
项目:Reer    文件:DefaultArtifactResolutionQuery.java   
private <T extends Artifact> ArtifactType convertType(Class<T> requestedType) {
    return componentTypeRegistry.getComponentRegistration(componentType).getArtifactType(requestedType);
}