Search in sources :

Example 1 with IncludedBuildSpec

use of org.gradle.initialization.IncludedBuildSpec in project gradle by gradle.

the class CompositeBuildSettingsLoader method findAndLoadSettings.

@Override
public SettingsInternal findAndLoadSettings(GradleInternal gradle) {
    SettingsInternal settings = delegate.findAndLoadSettings(gradle);
    // Add included builds defined in settings
    List<IncludedBuildSpec> includedBuilds = settings.getIncludedBuilds();
    if (!includedBuilds.isEmpty()) {
        for (IncludedBuildSpec includedBuildSpec : includedBuilds) {
            // TODO: Allow builds to inject into explicitly included builds
            IncludedBuildInternal includedBuild = includedBuildRegistry.addExplicitBuild(BuildDefinition.fromStartParameterForBuild(gradle.getStartParameter(), includedBuildSpec.rootDir, DefaultPluginRequests.EMPTY), nestedBuildFactory);
            includedBuildSpec.configurer.execute(includedBuild.getModel());
        }
    }
    // Add all included builds from the command-line
    for (File rootDir : gradle.getStartParameter().getIncludedBuilds()) {
        // TODO: Allow builds to inject into explicitly included builds
        includedBuildRegistry.addExplicitBuild(BuildDefinition.fromStartParameterForBuild(gradle.getStartParameter(), rootDir, DefaultPluginRequests.EMPTY), nestedBuildFactory);
    }
    // Lock-in explicitly included builds
    includedBuildRegistry.validateExplicitIncludedBuilds(settings);
    return settings;
}
Also used : SettingsInternal(org.gradle.api.internal.SettingsInternal) IncludedBuildInternal(org.gradle.composite.internal.IncludedBuildInternal) IncludedBuildSpec(org.gradle.initialization.IncludedBuildSpec) File(java.io.File)

Aggregations

File (java.io.File)1 SettingsInternal (org.gradle.api.internal.SettingsInternal)1 IncludedBuildInternal (org.gradle.composite.internal.IncludedBuildInternal)1 IncludedBuildSpec (org.gradle.initialization.IncludedBuildSpec)1