Search in sources :

Example 6 with Configuration

use of org.gradle.api.artifacts.Configuration in project gradle by gradle.

the class IdeaDependenciesProvider method getProjectDependencies.

private Set<Dependency> getProjectDependencies(IdeaModule ideaModule, GeneratedIdeaScope scope) {
    Collection<Configuration> plusConfigurations = getPlusConfigurations(ideaModule, scope);
    Collection<Configuration> minusConfigurations = getMinusConfigurations(ideaModule, scope);
    Collection<IdeProjectDependency> extractedDependencies = dependenciesExtractor.extractProjectDependencies(ideaModule.getProject(), plusConfigurations, minusConfigurations);
    Set<Dependency> dependencies = Sets.newLinkedHashSet();
    for (IdeProjectDependency ideProjectDependency : extractedDependencies) {
        dependencies.add(moduleDependencyBuilder.create(ideProjectDependency, scope.name()));
    }
    return dependencies;
}
Also used : IdeProjectDependency(org.gradle.plugins.ide.internal.resolver.model.IdeProjectDependency) Configuration(org.gradle.api.artifacts.Configuration) UnresolvedIdeRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.UnresolvedIdeRepoFileDependency) IdeLocalFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeLocalFileDependency) IdeProjectDependency(org.gradle.plugins.ide.internal.resolver.model.IdeProjectDependency) Dependency(org.gradle.plugins.ide.idea.model.Dependency) IdeExtendedRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeExtendedRepoFileDependency)

Example 7 with Configuration

use of org.gradle.api.artifacts.Configuration in project gradle by gradle.

the class IdeaDependenciesProvider method getExternalDependencies.

private Set<Dependency> getExternalDependencies(IdeaModule ideaModule, GeneratedIdeaScope scope) {
    if (ideaModule.isOffline()) {
        return Collections.emptySet();
    }
    Collection<Configuration> plusConfigurations = getPlusConfigurations(ideaModule, scope);
    Collection<Configuration> minusConfigurations = getMinusConfigurations(ideaModule, scope);
    Set<Dependency> dependencies = Sets.newLinkedHashSet();
    Collection<IdeExtendedRepoFileDependency> ideRepoFileDependencies = dependenciesExtractor.extractRepoFileDependencies(ideaModule.getProject().getDependencies(), plusConfigurations, minusConfigurations, ideaModule.isDownloadSources(), ideaModule.isDownloadJavadoc());
    for (IdeExtendedRepoFileDependency dependency : ideRepoFileDependencies) {
        dependencies.add(toLibraryDependency(dependency, ideaModule, scope));
    }
    return dependencies;
}
Also used : Configuration(org.gradle.api.artifacts.Configuration) IdeExtendedRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeExtendedRepoFileDependency) UnresolvedIdeRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.UnresolvedIdeRepoFileDependency) IdeLocalFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeLocalFileDependency) IdeProjectDependency(org.gradle.plugins.ide.internal.resolver.model.IdeProjectDependency) Dependency(org.gradle.plugins.ide.idea.model.Dependency) IdeExtendedRepoFileDependency(org.gradle.plugins.ide.internal.resolver.model.IdeExtendedRepoFileDependency)

Example 8 with Configuration

use of org.gradle.api.artifacts.Configuration in project gradle by gradle.

the class MavenPlugin method configureInstall.

private void configureInstall(Project project) {
    Upload installUpload = project.getTasks().create(INSTALL_TASK_NAME, Upload.class);
    Configuration configuration = project.getConfigurations().getByName(Dependency.ARCHIVES_CONFIGURATION);
    installUpload.setConfiguration(configuration);
    MavenRepositoryHandlerConvention repositories = new DslObject(installUpload.getRepositories()).getConvention().getPlugin(MavenRepositoryHandlerConvention.class);
    repositories.mavenInstaller();
    installUpload.setDescription("Installs the 'archives' artifacts into the local Maven repository.");
}
Also used : DefaultMavenRepositoryHandlerConvention(org.gradle.api.publication.maven.internal.DefaultMavenRepositoryHandlerConvention) Configuration(org.gradle.api.artifacts.Configuration) DslObject(org.gradle.api.internal.plugins.DslObject) Upload(org.gradle.api.tasks.Upload)

Example 9 with Configuration

use of org.gradle.api.artifacts.Configuration in project gradle by gradle.

the class DefaultConf2ScopeMappingContainerTest method createTestMappings.

private Map<Configuration, Conf2ScopeMapping> createTestMappings() {
    Map<Configuration, Conf2ScopeMapping> testMappings = new HashMap<Configuration, Conf2ScopeMapping>() {

        {
            Configuration configuration = context.mock(Configuration.class);
            put(configuration, new Conf2ScopeMapping(10, configuration, "scope"));
        }
    };
    return testMappings;
}
Also used : Configuration(org.gradle.api.artifacts.Configuration) HashMap(java.util.HashMap) Conf2ScopeMapping(org.gradle.api.artifacts.maven.Conf2ScopeMapping)

Example 10 with Configuration

use of org.gradle.api.artifacts.Configuration in project gradle by gradle.

the class CheckstylePlugin method configureTaskDefaults.

@Override
protected void configureTaskDefaults(Checkstyle task, final String baseName) {
    Configuration configuration = project.getConfigurations().getAt("checkstyle");
    configureDefaultDependencies(configuration);
    configureTaskConventionMapping(configuration, task);
    configureReportsConventionMapping(task, baseName);
}
Also used : Configuration(org.gradle.api.artifacts.Configuration)

Aggregations

Configuration (org.gradle.api.artifacts.Configuration)65 File (java.io.File)8 Project (org.gradle.api.Project)8 ConfigurationContainer (org.gradle.api.artifacts.ConfigurationContainer)8 Dependency (org.gradle.api.artifacts.Dependency)7 DependencySet (org.gradle.api.artifacts.DependencySet)7 Callable (java.util.concurrent.Callable)6 ConventionMapping (org.gradle.api.internal.ConventionMapping)5 IConventionAware (org.gradle.api.internal.IConventionAware)5 LinkedHashSet (java.util.LinkedHashSet)4 ResolvedConfiguration (org.gradle.api.artifacts.ResolvedConfiguration)4 ResolvedProjectConfiguration (org.gradle.api.internal.artifacts.ivyservice.resolveengine.projectresult.ResolvedProjectConfiguration)4 JavaScriptExtension (org.gradle.plugins.javascript.base.JavaScriptExtension)4 ModuleVersionIdentifier (org.gradle.api.artifacts.ModuleVersionIdentifier)3 PublishArtifact (org.gradle.api.artifacts.PublishArtifact)3 DependencyResult (org.gradle.api.artifacts.result.DependencyResult)3 FileCollection (org.gradle.api.file.FileCollection)3 ArchivePublishArtifact (org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact)3 DefaultArtifactPublicationSet (org.gradle.api.internal.plugins.DefaultArtifactPublicationSet)3 DslObject (org.gradle.api.internal.plugins.DslObject)3