use of org.gradle.tooling.internal.gradle.GradleProjectIdentity 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;
}
use of org.gradle.tooling.internal.gradle.GradleProjectIdentity in project gradle by gradle.
the class DefaultBuildController method getTarget.
private ToolingModelScope getTarget(@Nullable Object target, ModelIdentifier modelIdentifier, boolean parameter) {
if (target == null) {
return controller.locateBuilderForDefaultTarget(modelIdentifier.getName(), parameter);
} else if (target instanceof GradleProjectIdentity) {
GradleProjectIdentity projectIdentity = (GradleProjectIdentity) target;
BuildState build = findBuild(projectIdentity);
ProjectState project = findProject(build, projectIdentity);
return controller.locateBuilderForTarget(project, modelIdentifier.getName(), parameter);
} else if (target instanceof GradleBuildIdentity) {
GradleBuildIdentity buildIdentity = (GradleBuildIdentity) target;
BuildState build = findBuild(buildIdentity);
return controller.locateBuilderForTarget(build, modelIdentifier.getName(), parameter);
} else {
throw new IllegalArgumentException("Don't know how to build models for " + target);
}
}
Aggregations