use of org.gradle.api.artifacts.Dependency in project gradle by gradle.
the class ArtifactRepositoryPluginResolver method exists.
/*
* Checks whether the implementation artifact exists in the backing artifact repository.
*/
private boolean exists(PluginRequestInternal request) {
Dependency dependency = resolution.getDependencyHandler().create(getMarkerDependency(request));
ConfigurationContainer configurations = resolution.getConfigurationContainer();
Configuration configuration = configurations.detachedConfiguration(dependency);
configuration.setTransitive(false);
return !configuration.getResolvedConfiguration().hasError();
}
use of org.gradle.api.artifacts.Dependency in project gradle by gradle.
the class DefaultIdeDependencyResolver method getIdeLocalFileDependencies.
/**
* Gets IDE local file dependencies.
*
* @param configuration Configuration
* @return IDE local file dependencies
*/
public List<IdeLocalFileDependency> getIdeLocalFileDependencies(Configuration configuration) {
List<SelfResolvingDependency> externalDependencies = new ArrayList<SelfResolvingDependency>();
findAllExternalDependencies(externalDependencies, new ArrayList<Dependency>(), configuration);
List<IdeLocalFileDependency> ideLocalFileDependencies = new ArrayList<IdeLocalFileDependency>();
for (SelfResolvingDependency externalDependency : externalDependencies) {
Set<File> resolvedFiles = externalDependency.resolve(configuration.isTransitive());
for (File resolvedFile : resolvedFiles) {
IdeLocalFileDependency ideLocalFileDependency = new IdeLocalFileDependency(resolvedFile);
ideLocalFileDependencies.add(ideLocalFileDependency);
}
}
return ideLocalFileDependencies;
}
use of org.gradle.api.artifacts.Dependency in project gradle by gradle.
the class DefaultConfigurationContainer method detachedConfiguration.
public ConfigurationInternal detachedConfiguration(Dependency... dependencies) {
String name = DETACHED_CONFIGURATION_DEFAULT_NAME + detachedConfigurationDefaultNameCounter++;
DetachedConfigurationsProvider detachedConfigurationsProvider = new DetachedConfigurationsProvider();
DefaultConfiguration detachedConfiguration = instantiator.newInstance(DefaultConfiguration.class, context.identityPath(name), context.projectPath(name), name, detachedConfigurationsProvider, resolver, listenerManager, dependencyMetaDataProvider, resolutionStrategyFactory, projectAccessListener, projectFinder, configurationComponentMetaDataBuilder, fileCollectionFactory, componentIdentifierFactory, buildOperationExecutor, instantiator, artifactNotationParser, attributesFactory, moduleIdentifierFactory);
DomainObjectSet<Dependency> detachedDependencies = detachedConfiguration.getDependencies();
for (Dependency dependency : dependencies) {
detachedDependencies.add(dependency.copy());
}
detachedConfigurationsProvider.setTheOnlyConfiguration(detachedConfiguration);
return detachedConfiguration;
}
use of org.gradle.api.artifacts.Dependency in project gradle by gradle.
the class JsHintPlugin method addConfiguration.
public Configuration addConfiguration(ConfigurationContainer configurations, final DependencyHandler dependencies, final JsHintExtension extension) {
Configuration configuration = configurations.create(JsHintExtension.CONFIGURATION_NAME);
configuration.defaultDependencies(new Action<DependencySet>() {
@Override
public void execute(DependencySet configDependencies) {
String notation = JsHintExtension.DEFAULT_DEPENDENCY_GROUP + ":" + JsHintExtension.DEFAULT_DEPENDENCY_MODULE + ":" + extension.getVersion() + "@js";
Dependency dependency = dependencies.create(notation);
configDependencies.add(dependency);
}
});
return configuration;
}
use of org.gradle.api.artifacts.Dependency in project gradle by gradle.
the class EnvJsPlugin method addConfiguration.
public Configuration addConfiguration(ConfigurationContainer configurations, final DependencyHandler dependencies, final EnvJsExtension extension) {
Configuration configuration = configurations.create(EnvJsExtension.CONFIGURATION_NAME);
configuration.defaultDependencies(new Action<DependencySet>() {
@Override
public void execute(DependencySet configDependencies) {
String notation = EnvJsExtension.DEFAULT_DEPENDENCY_GROUP + ":" + EnvJsExtension.DEFAULT_DEPENDENCY_MODULE + ":" + extension.getVersion() + "@js";
Dependency dependency = dependencies.create(notation);
configDependencies.add(dependency);
}
});
return configuration;
}
Aggregations