use of org.gradle.api.internal.artifacts.configurations.ConfigurationInternal in project gradle by gradle.
the class DefaultArtifactResolutionQuery method execute.
@Override
public ArtifactResolutionResult execute() {
if (componentType == null) {
throw new IllegalStateException("Must specify component type and artifacts to query.");
}
List<? extends ResolutionAwareRepository> repositories = repositoriesSupplier.get();
ConfigurationInternal detachedConfiguration = configurationContainer.detachedConfiguration();
ResolutionStrategyInternal resolutionStrategy = detachedConfiguration.getResolutionStrategy();
ComponentResolvers componentResolvers = ivyFactory.create(detachedConfiguration.getName(), resolutionStrategy, repositories, metadataHandler.getComponentMetadataProcessorFactory(), ImmutableAttributes.EMPTY, null, attributesFactory, componentMetadataSupplierRuleExecutor);
ComponentMetaDataResolver componentMetaDataResolver = componentResolvers.getComponentResolver();
ArtifactResolver artifactResolver = new ErrorHandlingArtifactResolver(componentResolvers.getArtifactResolver());
return createResult(componentMetaDataResolver, artifactResolver);
}
use of org.gradle.api.internal.artifacts.configurations.ConfigurationInternal in project gradle by gradle.
the class DefaultArtifactPublisher method publish.
@Override
public void publish(final Iterable<? extends PublicationAwareRepository> repositories, final Module module, final Configuration configuration, final File descriptor) throws PublishException {
Set<ConfigurationInternal> allConfigurations = Cast.uncheckedCast(configuration.getAll());
Set<ConfigurationInternal> configurationsToPublish = Cast.uncheckedCast(configuration.getHierarchy());
// Will create `ivy.xml` even for Maven publishing! (as long as `Upload.uploadDescriptor == true`)
if (descriptor != null) {
// Convert once, in order to write the Ivy descriptor with _all_ configurations
DefaultIvyModulePublishMetadata publishMetaData = toPublishMetaData(module, allConfigurations, false);
ivyModuleDescriptorWriter.write(publishMetaData, descriptor);
}
// Convert a second time with only the published configurations: this ensures that the correct artifacts are included
DefaultIvyModulePublishMetadata publishMetaData = toPublishMetaData(module, configurationsToPublish, true);
if (descriptor != null) {
IvyArtifactName artifact = new DefaultIvyArtifactName("ivy", "ivy", "xml");
publishMetaData.addArtifact(artifact, descriptor);
}
for (PublicationAwareRepository repository : repositories) {
ModuleVersionPublisher publisher = repository.createPublisher();
LOGGER.info("Publishing to {}", publisher);
publisher.publish(publishMetaData);
}
}
use of org.gradle.api.internal.artifacts.configurations.ConfigurationInternal in project gradle by gradle.
the class DefaultArtifactPublisher method addConfigurations.
private void addConfigurations(DefaultIvyModulePublishMetadata metaData, Collection<? extends ConfigurationInternal> configurations, boolean validateArtifacts) {
for (ConfigurationInternal configuration : configurations) {
BuildableLocalConfigurationMetadata configurationMetadata = addConfiguration(metaData, configuration);
dependenciesConverter.addDependenciesAndExcludes(configurationMetadata, configuration);
OutgoingVariant outgoingVariant = configuration.convertToOutgoingVariant();
for (PublishArtifact publishArtifact : outgoingVariant.getArtifacts()) {
if (!validateArtifacts || isValidToPublish(publishArtifact)) {
metaData.addArtifact(configuration.getName(), publishArtifact);
}
}
}
}
Aggregations