use of org.gradle.api.artifacts.Configuration in project gradle by gradle.
the class ArtifactRepositoriesPluginResolver method exists.
/*
* Checks whether the plugin marker artifact exists in the backing artifacts repositories.
*/
private boolean exists(ModuleDependency dependency) {
ConfigurationContainer configurations = resolution.getConfigurationContainer();
Configuration configuration = configurations.detachedConfiguration(dependency);
configuration.setTransitive(false);
return !configuration.getResolvedConfiguration().hasError();
}
use of org.gradle.api.artifacts.Configuration in project gradle by gradle.
the class JavaPlugin method addDependsOnTaskInOtherProjects.
/**
* Adds a dependency on tasks with the specified name in other projects. The other projects are determined from
* project lib dependencies using the specified configuration name. These may be projects this project depends on or
* projects that depend on this project based on the useDependOn argument.
*
* @param task Task to add dependencies to
* @param useDependedOn if true, add tasks from projects this project depends on, otherwise use projects that depend on this one.
* @param otherProjectTaskName name of task in other projects
* @param configurationName name of configuration to use to find the other projects
*/
private void addDependsOnTaskInOtherProjects(final Task task, boolean useDependedOn, String otherProjectTaskName, String configurationName) {
Project project = task.getProject();
final Configuration configuration = project.getConfigurations().getByName(configurationName);
task.dependsOn(configuration.getTaskDependencyFromProjectDependency(useDependedOn, otherProjectTaskName));
}
use of org.gradle.api.artifacts.Configuration in project gradle by gradle.
the class DefaultCppSharedLibrary method getUsages.
@Override
public Set<? extends UsageContext> getUsages() {
Configuration linkElements = getLinkElements().get();
Configuration runtimeElements = getRuntimeElements().get();
return Sets.newHashSet(new DefaultUsageContext(getIdentity().getLinkUsageContext(), linkElements.getAllArtifacts(), linkElements), new DefaultUsageContext(getIdentity().getRuntimeUsageContext(), runtimeElements.getAllArtifacts(), runtimeElements));
}
use of org.gradle.api.artifacts.Configuration in project gradle by gradle.
the class DefaultSwiftStaticLibrary method getUsages.
@Override
public Set<? extends UsageContext> getUsages() {
Configuration linkElements = getLinkElements().get();
Configuration runtimeElements = getRuntimeElements().get();
return Sets.newHashSet(// TODO: Does a static library have runtime elements?
new DefaultUsageContext(getIdentity().getLinkUsageContext(), linkElements.getAllArtifacts(), linkElements), new DefaultUsageContext(getIdentity().getRuntimeUsageContext(), runtimeElements.getAllArtifacts(), runtimeElements));
}
use of org.gradle.api.artifacts.Configuration in project meecrowave by apache.
the class MeecrowaveTask method createLoader.
private ClassLoader createLoader(final ClassLoader parent) {
final Collection<URL> urls = new LinkedHashSet<>(64);
addFiles(modules, urls);
for (final Configuration cc : getProject().getConfigurations()) {
if (applicationScopes.contains(cc.getName())) {
addFiles(cc.getFiles(), urls);
}
}
addFiles(classpath.getFiles(), urls);
// use JVM loader to avoid the noise of gradle and its plugins
return new URLClassLoader(urls.toArray(new URL[urls.size()]), new FilterGradleClassLoader(parent, classloaderFilteredPackages));
}
Aggregations