Search in sources :

Example 36 with Configuration

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

the class DefaultConfiguration method runDependencyActions.

public void runDependencyActions() {
    defaultDependencyActions.execute(dependencies);
    withDependencyActions.execute(dependencies);
    // Discard actions after execution
    defaultDependencyActions = ImmutableActionSet.empty();
    withDependencyActions = ImmutableActionSet.empty();
    for (Configuration superConfig : extendsFrom) {
        ((ConfigurationInternal) superConfig).runDependencyActions();
    }
}
Also used : ResolvedConfiguration(org.gradle.api.artifacts.ResolvedConfiguration) ResolvedProjectConfiguration(org.gradle.api.internal.artifacts.ivyservice.resolveengine.projectresult.ResolvedProjectConfiguration) DefaultLenientConfiguration(org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration) Configuration(org.gradle.api.artifacts.Configuration)

Example 37 with Configuration

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

the class DefaultDependencyHandler method doAdd.

private Dependency doAdd(Configuration configuration, Object dependencyNotation, Closure configureClosure) {
    if (dependencyNotation instanceof Configuration) {
        Configuration other = (Configuration) dependencyNotation;
        if (!configurationContainer.contains(other)) {
            throw new UnsupportedOperationException("Currently you can only declare dependencies on configurations from the same project.");
        }
        configuration.extendsFrom(other);
        return null;
    }
    Dependency dependency = create(dependencyNotation, configureClosure);
    configuration.getDependencies().add(dependency);
    return dependency;
}
Also used : Configuration(org.gradle.api.artifacts.Configuration) Dependency(org.gradle.api.artifacts.Dependency)

Example 38 with Configuration

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

the class ProjectOutcomesModelBuilder method addArtifacts.

private void addArtifacts(Project project, List<GradleFileBuildOutcome> outcomes) {
    Configuration configuration = project.getConfigurations().findByName(Dependency.ARCHIVES_CONFIGURATION);
    if (configuration != null) {
        for (PublishArtifact artifact : configuration.getArtifacts()) {
            GradleFileBuildOutcome outcome = artifactTransformer.transform(artifact, project);
            outcomes.add(outcome);
        }
    }
}
Also used : Configuration(org.gradle.api.artifacts.Configuration) GradleFileBuildOutcome(org.gradle.tooling.model.internal.outcomes.GradleFileBuildOutcome) PublishArtifact(org.gradle.api.artifacts.PublishArtifact)

Example 39 with Configuration

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

the class IdeaDependenciesProvider method visitDependencies.

private IdeaDependenciesVisitor visitDependencies(IdeaModule ideaModule, GeneratedIdeaScope scope) {
    DependencyHandler handler = ideaModule.getProject().getDependencies();
    Collection<Configuration> plusConfigurations = getPlusConfigurations(ideaModule, scope);
    Collection<Configuration> minusConfigurations = getMinusConfigurations(ideaModule, scope);
    IdeaDependenciesVisitor visitor = new IdeaDependenciesVisitor(ideaModule, scope.name());
    new IdeDependencySet(handler, plusConfigurations, minusConfigurations).visit(visitor);
    return visitor;
}
Also used : IdeDependencySet(org.gradle.plugins.ide.internal.resolver.IdeDependencySet) UnresolvedIdeDependencyHandler(org.gradle.plugins.ide.internal.resolver.UnresolvedIdeDependencyHandler) DependencyHandler(org.gradle.api.artifacts.dsl.DependencyHandler) Configuration(org.gradle.api.artifacts.Configuration)

Example 40 with Configuration

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

the class JacocoPlugin method addJacocoConfigurations.

/**
 * Creates the configurations used by plugin.
 */
private void addJacocoConfigurations() {
    Configuration agentConf = project.getConfigurations().create(AGENT_CONFIGURATION_NAME);
    agentConf.setVisible(false);
    agentConf.setTransitive(true);
    agentConf.setDescription("The Jacoco agent to use to get coverage data.");
    Configuration antConf = project.getConfigurations().create(ANT_CONFIGURATION_NAME);
    antConf.setVisible(false);
    antConf.setTransitive(true);
    antConf.setDescription("The Jacoco ant tasks to use to get execute Gradle tasks.");
}
Also used : Configuration(org.gradle.api.artifacts.Configuration)

Aggregations

Configuration (org.gradle.api.artifacts.Configuration)85 Project (org.gradle.api.Project)11 ConfigurationContainer (org.gradle.api.artifacts.ConfigurationContainer)11 File (java.io.File)10 Dependency (org.gradle.api.artifacts.Dependency)10 Callable (java.util.concurrent.Callable)9 ResolvedConfiguration (org.gradle.api.artifacts.ResolvedConfiguration)9 ResolvedProjectConfiguration (org.gradle.api.internal.artifacts.ivyservice.resolveengine.projectresult.ResolvedProjectConfiguration)9 DependencySet (org.gradle.api.artifacts.DependencySet)8 DefaultLenientConfiguration (org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration)7 LinkedHashSet (java.util.LinkedHashSet)6 Usage (org.gradle.api.attributes.Usage)6 Action (org.gradle.api.Action)5 ConventionMapping (org.gradle.api.internal.ConventionMapping)5 PublishArtifact (org.gradle.api.artifacts.PublishArtifact)4 IConventionAware (org.gradle.api.internal.IConventionAware)4 ArchivePublishArtifact (org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact)4 DefaultUsageContext (org.gradle.language.cpp.internal.DefaultUsageContext)4 Set (java.util.Set)3 FileCollectionDependency (org.gradle.api.artifacts.FileCollectionDependency)3