Search in sources :

Example 6 with ProviderBuildResult

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);
}
Also used : ProviderOperationParameters(org.gradle.tooling.internal.provider.connection.ProviderOperationParameters) ProviderBuildResult(org.gradle.tooling.internal.provider.connection.ProviderBuildResult) DefaultBuildCancellationToken(org.gradle.initialization.DefaultBuildCancellationToken) BuildCancellationToken(org.gradle.initialization.BuildCancellationToken)

Example 7 with ProviderBuildResult

use of org.gradle.tooling.internal.provider.connection.ProviderBuildResult 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);
}
Also used : DefaultBuildCancellationToken(org.gradle.initialization.DefaultBuildCancellationToken) ProviderOperationParameters(org.gradle.tooling.internal.provider.connection.ProviderOperationParameters) ProviderBuildResult(org.gradle.tooling.internal.provider.connection.ProviderBuildResult)

Aggregations

ProviderBuildResult (org.gradle.tooling.internal.provider.connection.ProviderBuildResult)7 DefaultBuildCancellationToken (org.gradle.initialization.DefaultBuildCancellationToken)6 ProviderOperationParameters (org.gradle.tooling.internal.provider.connection.ProviderOperationParameters)6 BuildCancellationToken (org.gradle.initialization.BuildCancellationToken)5 BuildCancelledException (org.gradle.api.BuildCancelledException)1 ProjectInternal (org.gradle.api.internal.project.ProjectInternal)1 InternalUnsupportedModelException (org.gradle.tooling.internal.protocol.InternalUnsupportedModelException)1 ProviderInternalTestExecutionRequest (org.gradle.tooling.internal.provider.test.ProviderInternalTestExecutionRequest)1 ParameterizedToolingModelBuilder (org.gradle.tooling.provider.model.ParameterizedToolingModelBuilder)1 ToolingModelBuilder (org.gradle.tooling.provider.model.ToolingModelBuilder)1 UnknownModelException (org.gradle.tooling.provider.model.UnknownModelException)1