use of org.gradle.tooling.internal.provider.connection.ProviderOperationParameters in project gradle by gradle.
the class DefaultConnection method run.
/**
* This is used by consumers 1.8-rc-1 to 2.0
*/
public <T> BuildResult<T> run(InternalBuildAction<T> action, BuildParameters operationParameters) throws BuildExceptionVersion1, InternalUnsupportedBuildArgumentException, IllegalStateException {
ProviderOperationParameters providerParameters = validateAndConvert(operationParameters);
Object results = connection.run(action, new DefaultBuildCancellationToken(), providerParameters);
return new ProviderBuildResult<T>((T) results);
}
use of org.gradle.tooling.internal.provider.connection.ProviderOperationParameters in project gradle by gradle.
the class ProviderConnection method run.
public Object run(String modelName, BuildCancellationToken cancellationToken, ProviderOperationParameters providerParameters) {
List<String> tasks = providerParameters.getTasks();
if (modelName.equals(ModelIdentifier.NULL_MODEL) && tasks == null) {
throw new IllegalArgumentException("No model type or tasks specified.");
}
Parameters params = initParams(providerParameters);
Class<?> type = new ModelMapping().getProtocolTypeFromModelName(modelName);
if (type == InternalBuildEnvironment.class) {
// we don't really need to launch the daemon to acquire information needed for BuildEnvironment
if (tasks != null) {
throw new IllegalArgumentException("Cannot run tasks and fetch the build environment model.");
}
return new DefaultBuildEnvironment(new DefaultBuildIdentifier(providerParameters.getProjectDir()), params.gradleUserhome, GradleVersion.current().getVersion(), params.daemonParams.getEffectiveJvm().getJavaHome(), params.daemonParams.getEffectiveJvmArgs());
}
StartParameterInternal startParameter = new ProviderStartParameterConverter().toStartParameter(providerParameters, params.properties);
ProgressListenerConfiguration listenerConfig = ProgressListenerConfiguration.from(providerParameters);
BuildAction action = new BuildModelAction(startParameter, modelName, tasks != null, listenerConfig.clientSubscriptions);
return run(action, cancellationToken, listenerConfig, providerParameters, params);
}
use of org.gradle.tooling.internal.provider.connection.ProviderOperationParameters in project gradle by gradle.
the class ProviderConnection method runTests.
public Object runTests(ProviderInternalTestExecutionRequest testExecutionRequest, BuildCancellationToken cancellationToken, ProviderOperationParameters providerParameters) {
Parameters params = initParams(providerParameters);
StartParameterInternal startParameter = new ProviderStartParameterConverter().toStartParameter(providerParameters, params.properties);
ProgressListenerConfiguration listenerConfig = ProgressListenerConfiguration.from(providerParameters);
TestExecutionRequestAction action = TestExecutionRequestAction.create(listenerConfig.clientSubscriptions, startParameter, testExecutionRequest);
return run(action, cancellationToken, listenerConfig, providerParameters, params);
}
Aggregations