Search in sources :

Example 1 with DefaultBuildCancellationToken

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

Example 2 with DefaultBuildCancellationToken

use of org.gradle.initialization.DefaultBuildCancellationToken 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)

Example 3 with DefaultBuildCancellationToken

use of org.gradle.initialization.DefaultBuildCancellationToken in project gradle by gradle.

the class DaemonStateCoordinator method updateCancellationToken.

private void updateCancellationToken() {
    cancellationToken = new DefaultBuildCancellationToken();
    cancellationToken.addCallback(onCancelCommand);
}
Also used : DefaultBuildCancellationToken(org.gradle.initialization.DefaultBuildCancellationToken)

Aggregations

DefaultBuildCancellationToken (org.gradle.initialization.DefaultBuildCancellationToken)3 ProviderBuildResult (org.gradle.tooling.internal.provider.connection.ProviderBuildResult)2 ProviderOperationParameters (org.gradle.tooling.internal.provider.connection.ProviderOperationParameters)2