Search in sources :

Example 16 with StartParameterInternal

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

the class BuildStateFactory method buildDefinitionFor.

public BuildDefinition buildDefinitionFor(File buildSrcDir, BuildState owner) {
    PublicBuildPath publicBuildPath = owner.getMutableModel().getServices().get(PublicBuildPath.class);
    StartParameterInternal buildSrcStartParameter = buildSrcStartParameterFor(buildSrcDir, owner.getMutableModel().getStartParameter());
    BuildDefinition buildDefinition = BuildDefinition.fromStartParameterForBuild(buildSrcStartParameter, BUILD_SRC, buildSrcDir, PluginRequests.EMPTY, Actions.doNothing(), publicBuildPath, true);
    @SuppressWarnings("deprecation") File customBuildFile = buildSrcStartParameter.getBuildFile();
    assert customBuildFile == null;
    return buildDefinition;
}
Also used : PublicBuildPath(org.gradle.internal.build.PublicBuildPath) StartParameterInternal(org.gradle.api.internal.StartParameterInternal) File(java.io.File) BuildDefinition(org.gradle.api.internal.BuildDefinition)

Example 17 with StartParameterInternal

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

the class DefaultSettingsLoader method createEmptySettings.

// StartParameter.setSettingsFile() and StartParameter.getBuildFile()
@SuppressWarnings("deprecation")
private SettingsInternal createEmptySettings(GradleInternal gradle, StartParameter startParameter, ClassLoaderScope classLoaderScope) {
    StartParameterInternal noSearchParameter = (StartParameterInternal) startParameter.newInstance();
    noSearchParameter.setSettingsFile(null);
    noSearchParameter.useEmptySettings();
    noSearchParameter.doNotSearchUpwards();
    BuildLayout layout = buildLayoutFactory.getLayoutFor(new BuildLayoutConfiguration(noSearchParameter));
    SettingsInternal settings = findSettingsAndLoadIfAppropriate(gradle, noSearchParameter, layout, classLoaderScope);
    // Set explicit build file, if required
    @SuppressWarnings("deprecation") File customBuildFile = noSearchParameter.getBuildFile();
    if (customBuildFile != null) {
        ProjectDescriptor rootProject = settings.getRootProject();
        rootProject.setBuildFileName(noSearchParameter.getBuildFile().getName());
    }
    return settings;
}
Also used : SettingsInternal(org.gradle.api.internal.SettingsInternal) ProjectDescriptor(org.gradle.api.initialization.ProjectDescriptor) BuildLayoutConfiguration(org.gradle.initialization.layout.BuildLayoutConfiguration) StartParameterInternal(org.gradle.api.internal.StartParameterInternal) File(java.io.File) BuildLayout(org.gradle.initialization.layout.BuildLayout)

Aggregations

StartParameterInternal (org.gradle.api.internal.StartParameterInternal)17 BuildActionParameters (org.gradle.launcher.exec.BuildActionParameters)6 BuildAction (org.gradle.internal.invocation.BuildAction)5 DaemonParameters (org.gradle.launcher.daemon.configuration.DaemonParameters)5 ProviderConnectionParameters (org.gradle.tooling.internal.provider.connection.ProviderConnectionParameters)4 ProviderOperationParameters (org.gradle.tooling.internal.provider.connection.ProviderOperationParameters)4 File (java.io.File)3 CommandLineParser (org.gradle.cli.CommandLineParser)3 BuildSessionState (org.gradle.internal.session.BuildSessionState)3 CrossBuildSessionState (org.gradle.internal.session.CrossBuildSessionState)3 ClientProvidedBuildAction (org.gradle.tooling.internal.provider.action.ClientProvidedBuildAction)3 HashMap (java.util.HashMap)2 Map (java.util.Map)2 BuildResult (org.gradle.BuildResult)2 CommandLineArgumentException (org.gradle.cli.CommandLineArgumentException)2 BuildRequestContext (org.gradle.initialization.BuildRequestContext)2 BuildRequestMetaData (org.gradle.initialization.BuildRequestMetaData)2 DefaultBuildRequestContext (org.gradle.initialization.DefaultBuildRequestContext)2 DefaultBuildRequestMetaData (org.gradle.initialization.DefaultBuildRequestMetaData)2 NoOpBuildEventConsumer (org.gradle.initialization.NoOpBuildEventConsumer)2