Search in sources :

Example 11 with BuildState

use of org.gradle.internal.build.BuildState in project gradle by gradle.

the class CompositeAwareTaskSelector method getSelection.

@Override
public TaskSelection getSelection(@Nullable String projectPath, @Nullable File root, String path) {
    if (gradle.isRootBuild()) {
        Path taskPath = Path.path(path);
        if (taskPath.isAbsolute()) {
            BuildState build = findIncludedBuild(taskPath);
            if (build != null) {
                return getSelectorForChildBuild(build).getSelection(projectPath, root, taskPath.removeFirstSegments(1).toString());
            }
            build = findIncludedBuild(root);
            if (build != null) {
                return getSelectorForChildBuild(build).getSelection(projectPath, root, path);
            }
        }
    }
    return getUnqualifiedBuildSelector().getSelection(projectPath, root, path);
}
Also used : Path(org.gradle.util.Path) BuildState(org.gradle.internal.build.BuildState) IncludedBuildState(org.gradle.internal.build.IncludedBuildState)

Aggregations

BuildState (org.gradle.internal.build.BuildState)11 IncludedBuildState (org.gradle.internal.build.IncludedBuildState)8 IncludedBuildInternal (org.gradle.internal.composite.IncludedBuildInternal)5 GradleInternal (org.gradle.api.internal.GradleInternal)4 RootBuildState (org.gradle.internal.build.RootBuildState)4 ArrayList (java.util.ArrayList)2 Project (org.gradle.api.Project)2 DefaultGradleProject (org.gradle.plugins.ide.internal.tooling.model.DefaultGradleProject)2 Task (org.gradle.api.Task)1 TaskInternal (org.gradle.api.internal.TaskInternal)1 ProjectState (org.gradle.api.internal.project.ProjectState)1 ExportedTaskNode (org.gradle.internal.build.ExportedTaskNode)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 DefaultGradleBuild (org.gradle.plugins.ide.internal.tooling.model.DefaultGradleBuild)1 GradleBuildIdentity (org.gradle.tooling.internal.gradle.GradleBuildIdentity)1 GradleProjectIdentity (org.gradle.tooling.internal.gradle.GradleProjectIdentity)1 EclipseWorkspaceProject (org.gradle.tooling.model.eclipse.EclipseWorkspaceProject)1 Path (org.gradle.util.Path)1