Search in sources :

Example 6 with IncludedBuild

use of org.gradle.api.initialization.IncludedBuild in project gradle by gradle.

the class CompositeBuildTaskDelegate method executeTasksInOtherBuild.

@TaskAction
public void executeTasksInOtherBuild() {
    IncludedBuilds includedBuilds = getServices().get(IncludedBuilds.class);
    IncludedBuildExecuter builder = getServices().get(IncludedBuildExecuter.class);
    IncludedBuild includedBuild = includedBuilds.getBuild(build);
    BuildIdentifier buildId = new DefaultBuildIdentifier(includedBuild.getName());
    // sourceBuild is currently always root build in a composite
    builder.execute(new DefaultBuildIdentifier(":", true), buildId, tasks);
}
Also used : DefaultBuildIdentifier(org.gradle.api.internal.artifacts.component.DefaultBuildIdentifier) BuildIdentifier(org.gradle.api.artifacts.component.BuildIdentifier) DefaultBuildIdentifier(org.gradle.api.internal.artifacts.component.DefaultBuildIdentifier) IncludedBuildExecuter(org.gradle.initialization.IncludedBuildExecuter) IncludedBuilds(org.gradle.initialization.IncludedBuilds) IncludedBuild(org.gradle.api.initialization.IncludedBuild) TaskAction(org.gradle.api.tasks.TaskAction)

Example 7 with IncludedBuild

use of org.gradle.api.initialization.IncludedBuild in project gradle by gradle.

the class IdeaModelBuilder method applyIdeaPlugin.

private void applyIdeaPlugin(Project root) {
    Set<Project> allProjects = root.getAllprojects();
    for (Project p : allProjects) {
        p.getPluginManager().apply(IdeaPlugin.class);
    }
    for (IncludedBuild includedBuild : root.getGradle().getIncludedBuilds()) {
        IncludedBuildInternal includedBuildInternal = (IncludedBuildInternal) includedBuild;
        applyIdeaPlugin(includedBuildInternal.getConfiguredBuild().getRootProject());
    }
}
Also used : IdeaProject(org.gradle.plugins.ide.idea.model.IdeaProject) DefaultGradleProject(org.gradle.tooling.internal.gradle.DefaultGradleProject) Project(org.gradle.api.Project) DefaultIdeaProject(org.gradle.plugins.ide.internal.tooling.idea.DefaultIdeaProject) IncludedBuildInternal(org.gradle.composite.internal.IncludedBuildInternal) IncludedBuild(org.gradle.api.initialization.IncludedBuild)

Aggregations

IncludedBuild (org.gradle.api.initialization.IncludedBuild)7 IncludedBuildInternal (org.gradle.composite.internal.IncludedBuildInternal)4 Project (org.gradle.api.Project)3 DefaultGradleProject (org.gradle.tooling.internal.gradle.DefaultGradleProject)2 File (java.io.File)1 LinkedHashMap (java.util.LinkedHashMap)1 BuildCancelledException (org.gradle.api.BuildCancelledException)1 BuildIdentifier (org.gradle.api.artifacts.component.BuildIdentifier)1 GradleInternal (org.gradle.api.internal.GradleInternal)1 DefaultBuildIdentifier (org.gradle.api.internal.artifacts.component.DefaultBuildIdentifier)1 Gradle (org.gradle.api.invocation.Gradle)1 TaskAction (org.gradle.api.tasks.TaskAction)1 ProjectConfigurer (org.gradle.execution.ProjectConfigurer)1 IncludedBuildExecuter (org.gradle.initialization.IncludedBuildExecuter)1 IncludedBuildFactory (org.gradle.initialization.IncludedBuildFactory)1 IncludedBuilds (org.gradle.initialization.IncludedBuilds)1 IdeaProject (org.gradle.plugins.ide.idea.model.IdeaProject)1 DefaultEclipseProject (org.gradle.plugins.ide.internal.tooling.eclipse.DefaultEclipseProject)1 DefaultIdeaProject (org.gradle.plugins.ide.internal.tooling.idea.DefaultIdeaProject)1 BasicGradleProject (org.gradle.tooling.internal.gradle.BasicGradleProject)1