Search in sources :

Example 1 with SettingsInternal

use of org.gradle.api.internal.SettingsInternal in project gradle by gradle.

the class DefaultIncludedBuildFactory method createBuild.

@Override
public ConfigurableIncludedBuild createBuild(File buildDirectory) {
    validateBuildDirectory(buildDirectory);
    Factory<GradleLauncher> factory = new ContextualGradleLauncherFactory(buildDirectory, nestedBuildFactory, startParameter);
    DefaultIncludedBuild includedBuild = instantiator.newInstance(DefaultIncludedBuild.class, buildDirectory, factory, moduleIdentifierFactory);
    SettingsInternal settingsInternal = includedBuild.getLoadedSettings();
    validateIncludedBuild(includedBuild, settingsInternal);
    return includedBuild;
}
Also used : SettingsInternal(org.gradle.api.internal.SettingsInternal) GradleLauncher(org.gradle.initialization.GradleLauncher)

Example 2 with SettingsInternal

use of org.gradle.api.internal.SettingsInternal in project gradle by gradle.

the class NotifyingSettingsLoader method findAndLoadSettings.

@Override
public SettingsInternal findAndLoadSettings(GradleInternal gradle) {
    SettingsInternal settings = settingsLoader.findAndLoadSettings(gradle);
    gradle.getBuildListenerBroadcaster().settingsEvaluated(settings);
    buildLoader.load(settings.getRootProject(), settings.getDefaultProject(), gradle, settings.getRootClassLoaderScope());
    gradle.getBuildListenerBroadcaster().projectsLoaded(gradle);
    return settings;
}
Also used : SettingsInternal(org.gradle.api.internal.SettingsInternal)

Example 3 with SettingsInternal

use of org.gradle.api.internal.SettingsInternal in project gradle by gradle.

the class RootBuildCacheControllerSettingsProcessor method process.

@Override
public SettingsInternal process(GradleInternal gradle, SettingsLocation settingsLocation, ClassLoaderScope buildRootClassLoaderScope, StartParameter startParameter) {
    SettingsInternal settings = delegate.process(gradle, settingsLocation, buildRootClassLoaderScope, startParameter);
    if (gradle.getParent() == null) {
        BuildCacheController rootController = gradle.getServices().get(BuildCacheController.class);
        RootBuildCacheControllerRef rootControllerRef = gradle.getServices().get(RootBuildCacheControllerRef.class);
        rootControllerRef.set(rootController);
    }
    return settings;
}
Also used : SettingsInternal(org.gradle.api.internal.SettingsInternal) RootBuildCacheControllerRef(org.gradle.caching.internal.controller.RootBuildCacheControllerRef) BuildCacheController(org.gradle.caching.internal.controller.BuildCacheController)

Example 4 with SettingsInternal

use of org.gradle.api.internal.SettingsInternal in project gradle by gradle.

the class ScriptEvaluatingSettingsProcessor method process.

public SettingsInternal process(GradleInternal gradle, SettingsLocation settingsLocation, ClassLoaderScope buildRootClassLoaderScope, StartParameter startParameter) {
    Timer settingsProcessingClock = Time.startTimer();
    Map<String, String> properties = propertiesLoader.mergeProperties(Collections.<String, String>emptyMap());
    SettingsInternal settings = settingsFactory.createSettings(gradle, settingsLocation.getSettingsDir(), settingsLocation.getSettingsScriptSource(), properties, startParameter, buildRootClassLoaderScope);
    applySettingsScript(settingsLocation, settings);
    LOGGER.debug("Timing: Processing settings took: {}", settingsProcessingClock.getElapsed());
    return settings;
}
Also used : SettingsInternal(org.gradle.api.internal.SettingsInternal) Timer(org.gradle.internal.time.Timer)

Example 5 with SettingsInternal

use of org.gradle.api.internal.SettingsInternal 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

SettingsInternal (org.gradle.api.internal.SettingsInternal)9 File (java.io.File)1 StartParameter (org.gradle.StartParameter)1 ProjectDescriptor (org.gradle.api.initialization.ProjectDescriptor)1 GradleInternal (org.gradle.api.internal.GradleInternal)1 BuildCacheController (org.gradle.caching.internal.controller.BuildCacheController)1 RootBuildCacheControllerRef (org.gradle.caching.internal.controller.RootBuildCacheControllerRef)1 IncludedBuildInternal (org.gradle.composite.internal.IncludedBuildInternal)1 GradleLauncher (org.gradle.initialization.GradleLauncher)1 IncludedBuildSpec (org.gradle.initialization.IncludedBuildSpec)1 CompositeBuildSettingsLoader (org.gradle.internal.composite.CompositeBuildSettingsLoader)1 Timer (org.gradle.internal.time.Timer)1