use of org.gradle.StartParameter in project gradle by gradle.
the class BuildSourceBuilder method buildGradleLauncher.
private GradleLauncher buildGradleLauncher(StartParameter startParameter) {
StartParameter startParameterArg = startParameter.newInstance();
startParameterArg.setProjectProperties(startParameter.getProjectProperties());
startParameterArg.setSearchUpwards(false);
startParameterArg.setProfile(startParameter.isProfile());
GradleLauncher gradleLauncher = nestedBuildFactory.nestedInstance(startParameterArg);
GradleInternal build = gradleLauncher.getGradle();
if (build.getParent().findIdentityPath() == null) {
// When nested inside a nested build, we need to synthesize a path for this build, as the root project is not yet known for the parent build
// Use the directory structure to do this. This means that the buildSrc build and its containing build may end up with different paths
Path path = build.getParent().getParent().getIdentityPath().child(startParameter.getCurrentDir().getParentFile().getName()).child(startParameter.getCurrentDir().getName());
build.setIdentityPath(path);
}
return gradleLauncher;
}
use of org.gradle.StartParameter in project gradle by gradle.
the class DefaultBuildConfigurer method maybeInformAboutIncubatingMode.
private void maybeInformAboutIncubatingMode(GradleInternal gradle) {
StartParameter startParameter = gradle.getStartParameter();
if (startParameter.isParallelProjectExecutionEnabled() && startParameter.isConfigureOnDemand()) {
SingleMessageLogger.incubatingFeatureUsed("Parallel execution with configuration on demand");
maybeInformAboutParallelLimitations(gradle);
} else if (startParameter.isParallelProjectExecutionEnabled()) {
SingleMessageLogger.incubatingFeatureUsed("Parallel execution");
maybeInformAboutParallelLimitations(gradle);
} else if (startParameter.isConfigureOnDemand()) {
SingleMessageLogger.incubatingFeatureUsed("Configuration on demand");
}
}
use of org.gradle.StartParameter in project gradle by gradle.
the class DefaultBuildConfigurer method maybeInformAboutParallelLimitations.
private void maybeInformAboutParallelLimitations(GradleInternal gradle) {
StartParameter startParameter = gradle.getStartParameter();
int childProjectCount = gradle.getRootProject().getChildProjects().size();
if (childProjectCount > 1 && startParameter.getTaskNames().size() > 1 && startParameter.getTaskNames().contains("clean")) {
LOGGER.warn("Using the 'clean' task in combination with parallel execution may lead to unexpected runtime behavior.");
}
}
use of org.gradle.StartParameter in project gradle by gradle.
the class ProviderConnection method run.
public Object run(InternalBuildAction<?> clientAction, BuildCancellationToken cancellationToken, ProviderOperationParameters providerParameters) {
List<String> tasks = providerParameters.getTasks();
SerializedPayload serializedAction = payloadSerializer.serialize(clientAction);
Parameters params = initParams(providerParameters);
StartParameter startParameter = new ProviderStartParameterConverter().toStartParameter(providerParameters, params.properties);
ProgressListenerConfiguration listenerConfig = ProgressListenerConfiguration.from(providerParameters);
BuildAction action = new ClientProvidedBuildAction(startParameter, serializedAction, tasks != null, listenerConfig.clientSubscriptions);
return run(action, cancellationToken, listenerConfig, providerParameters, params);
}
use of org.gradle.StartParameter in project gradle by gradle.
the class BuildDefinition method fromStartParameterForBuild.
public static BuildDefinition fromStartParameterForBuild(StartParameter startParameter, File buildRootDir, PluginRequests pluginRequests) {
StartParameter includedBuildStartParam = startParameter.newBuild();
includedBuildStartParam.setCurrentDir(buildRootDir);
includedBuildStartParam.setSearchUpwards(false);
includedBuildStartParam.setConfigureOnDemand(false);
includedBuildStartParam.setInitScripts(startParameter.getInitScripts());
return new BuildDefinition(buildRootDir, includedBuildStartParam, pluginRequests);
}
Aggregations