use of org.gradle.tooling.internal.provider.connection.ProviderBuildResult in project gradle by gradle.
the class DefaultBuildController method getModel.
public BuildResult<?> getModel(Object target, ModelIdentifier modelIdentifier) throws BuildExceptionVersion1, InternalUnsupportedModelException {
BuildCancellationToken cancellationToken = gradle.getServices().get(BuildCancellationToken.class);
if (cancellationToken.isCancellationRequested()) {
throw new BuildCancelledException(String.format("Could not build '%s' model. Build cancelled.", modelIdentifier.getName()));
}
ProjectInternal project = getTargetProject(target);
ToolingModelBuilder builder = getToolingModelBuilder(project, modelIdentifier);
Object model = builder.buildAll(modelIdentifier.getName(), project);
return new ProviderBuildResult<Object>(model);
}
use of org.gradle.tooling.internal.provider.connection.ProviderBuildResult in project gradle by gradle.
the class DefaultConnection method getModel.
/**
* This is used by consumers 1.6-rc-1 to 2.0
*/
public BuildResult<?> getModel(ModelIdentifier modelIdentifier, BuildParameters operationParameters) throws UnsupportedOperationException, IllegalStateException {
ProviderOperationParameters providerParameters = validateAndConvert(operationParameters);
Object result = connection.run(modelIdentifier.getName(), new DefaultBuildCancellationToken(), providerParameters);
return new ProviderBuildResult<Object>(result);
}
use of org.gradle.tooling.internal.provider.connection.ProviderBuildResult in project gradle by gradle.
the class DefaultConnection method run.
/**
* This is used by consumers 2.1-rc-1 and later.
*/
public <T> BuildResult<T> run(InternalBuildAction<T> action, InternalCancellationToken cancellationToken, BuildParameters operationParameters) throws BuildExceptionVersion1, InternalUnsupportedBuildArgumentException, IllegalStateException {
ProviderOperationParameters providerParameters = validateAndConvert(operationParameters);
BuildCancellationToken buildCancellationToken = new InternalCancellationTokenAdapter(cancellationToken);
Object results = connection.run(action, buildCancellationToken, providerParameters);
return new ProviderBuildResult<T>((T) results);
}
use of org.gradle.tooling.internal.provider.connection.ProviderBuildResult in project gradle by gradle.
the class DefaultConnection method runTests.
/**
* This is used by consumers 2.6-rc-1 and later
*/
public BuildResult<?> runTests(InternalTestExecutionRequest testExecutionRequest, InternalCancellationToken cancellationToken, BuildParameters operationParameters) throws BuildExceptionVersion1, InternalUnsupportedBuildArgumentException, IllegalStateException {
ProviderOperationParameters providerParameters = validateAndConvert(operationParameters);
ProviderInternalTestExecutionRequest testExecutionRequestVersion2 = adapter.adapt(ProviderInternalTestExecutionRequest.class, testExecutionRequest);
BuildCancellationToken buildCancellationToken = new InternalCancellationTokenAdapter(cancellationToken);
Object results = connection.runTests(testExecutionRequestVersion2, buildCancellationToken, providerParameters);
return new ProviderBuildResult<Object>(results);
}
use of org.gradle.tooling.internal.provider.connection.ProviderBuildResult in project gradle by gradle.
the class DefaultConnection method getModel.
/**
* This is used by consumers 2.1-rc-1 and later
*/
public BuildResult<?> getModel(ModelIdentifier modelIdentifier, InternalCancellationToken cancellationToken, BuildParameters operationParameters) throws BuildExceptionVersion1, InternalUnsupportedModelException, InternalUnsupportedBuildArgumentException, IllegalStateException {
ProviderOperationParameters providerParameters = validateAndConvert(operationParameters);
BuildCancellationToken buildCancellationToken = new InternalCancellationTokenAdapter(cancellationToken);
Object result = connection.run(modelIdentifier.getName(), buildCancellationToken, providerParameters);
return new ProviderBuildResult<Object>(result);
}
Aggregations