Search in sources :

Example 1 with ProjectDescriptor

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

the class InstantiatingBuildLoader method addProjects.

private void addProjects(ProjectInternal parent, ProjectDescriptor parentProjectDescriptor, GradleInternal gradle, ClassLoaderScope buildRootClassLoaderScope) {
    for (ProjectDescriptor childProjectDescriptor : parentProjectDescriptor.getChildren()) {
        ProjectInternal childProject = projectFactory.createProject(childProjectDescriptor, parent, gradle, parent.getClassLoaderScope().createChild("project-" + childProjectDescriptor.getName()), buildRootClassLoaderScope);
        addProjects(childProject, childProjectDescriptor, gradle, buildRootClassLoaderScope);
    }
}
Also used : ProjectDescriptor(org.gradle.api.initialization.ProjectDescriptor) ProjectInternal(org.gradle.api.internal.project.ProjectInternal)

Example 2 with ProjectDescriptor

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

the class DefaultSettingsLoader method findAndLoadSettings.

@Override
public SettingsInternal findAndLoadSettings(GradleInternal gradle) {
    StartParameter startParameter = gradle.getStartParameter();
    SettingsInternal settings = findSettingsAndLoadIfAppropriate(gradle, startParameter);
    ProjectSpec spec = ProjectSpecs.forStartParameter(startParameter, settings);
    if (spec.containsProject(settings.getProjectRegistry())) {
        setDefaultProject(spec, settings);
        return settings;
    }
    // Try again with empty settings
    StartParameter noSearchParameter = startParameter.newInstance();
    noSearchParameter.useEmptySettings();
    settings = findSettingsAndLoadIfAppropriate(gradle, noSearchParameter);
    // Set explicit build file, if required
    if (noSearchParameter.getBuildFile() != null) {
        ProjectDescriptor rootProject = settings.getRootProject();
        rootProject.setBuildFileName(noSearchParameter.getBuildFile().getName());
    }
    setDefaultProject(spec, settings);
    return settings;
}
Also used : SettingsInternal(org.gradle.api.internal.SettingsInternal) StartParameter(org.gradle.StartParameter) ProjectDescriptor(org.gradle.api.initialization.ProjectDescriptor)

Aggregations

ProjectDescriptor (org.gradle.api.initialization.ProjectDescriptor)2 StartParameter (org.gradle.StartParameter)1 SettingsInternal (org.gradle.api.internal.SettingsInternal)1 ProjectInternal (org.gradle.api.internal.project.ProjectInternal)1