Search in sources :

Example 1 with GradleBuildIdentity

use of org.gradle.tooling.internal.gradle.GradleBuildIdentity in project gradle by gradle.

the class DefaultBuildController method getTargetProject.

private ProjectInternal getTargetProject(Object target) {
    ProjectInternal project;
    if (target == null) {
        project = gradle.getDefaultProject();
    } else if (target instanceof GradleProjectIdentity) {
        GradleProjectIdentity projectIdentity = (GradleProjectIdentity) target;
        GradleInternal build = findBuild(projectIdentity);
        project = findProject(build, projectIdentity);
    } else if (target instanceof GradleBuildIdentity) {
        GradleBuildIdentity buildIdentity = (GradleBuildIdentity) target;
        project = findBuild(buildIdentity).getDefaultProject();
    } else {
        throw new IllegalArgumentException("Don't know how to build models for " + target);
    }
    return project;
}
Also used : GradleInternal(org.gradle.api.internal.GradleInternal) GradleBuildIdentity(org.gradle.tooling.internal.gradle.GradleBuildIdentity) ProjectInternal(org.gradle.api.internal.project.ProjectInternal) GradleProjectIdentity(org.gradle.tooling.internal.gradle.GradleProjectIdentity)

Aggregations

GradleInternal (org.gradle.api.internal.GradleInternal)1 ProjectInternal (org.gradle.api.internal.project.ProjectInternal)1 GradleBuildIdentity (org.gradle.tooling.internal.gradle.GradleBuildIdentity)1 GradleProjectIdentity (org.gradle.tooling.internal.gradle.GradleProjectIdentity)1