Esempio n. 1
0
 /**
  * This method was used by consumers 1.0-rc-1 through to 1.1. Later consumers use {@link
  * #configure(org.gradle.tooling.internal.protocol.ConnectionParameters)} instead.
  */
 public void configureLogging(final boolean verboseLogging) {
   ProviderConnectionParameters providerConnectionParameters =
       adapter.adapt(
           ProviderConnectionParameters.class,
           new VerboseLoggingOnlyConnectionParameters(verboseLogging));
   connection.configure(providerConnectionParameters);
 }
Esempio n. 2
0
 /** This is used by consumers 1.8-rc-1 and later. */
 public <T> BuildResult<T> run(InternalBuildAction<T> action, BuildParameters operationParameters)
     throws BuildExceptionVersion1, InternalUnsupportedBuildArgumentException,
         IllegalStateException {
   validateCanRun();
   ProviderOperationParameters providerParameters = toProviderParameters(operationParameters);
   Object results = connection.run(action, new FixedBuildCancellationToken(), providerParameters);
   return new ProviderBuildResult<T>((T) results);
 }
Esempio n. 3
0
 private <T> T run(Class<T> type, BuildOperationParametersVersion1 parameters) {
   String modelName = new ModelMapping().getModelNameFromProtocolType(type);
   return (T)
       connection.run(
           modelName,
           new FixedBuildCancellationToken(),
           new AdaptedOperationParameters(parameters));
 }
Esempio n. 4
0
 /** This is used by consumers 1.8-rc-1 and later. */
 public <T> BuildResult<T> run(ClientBuildAction<T> action, BuildParameters operationParameters)
     throws BuildExceptionVersion1, InternalUnsupportedBuildArgumentException,
         IllegalStateException {
   logTargetVersion();
   ProviderOperationParameters providerParameters = toProviderParameters(operationParameters);
   Object results = connection.run(action, providerParameters);
   return new ProviderBuildResult<T>((T) results);
 }
Esempio n. 5
0
 /** This is used by consumers 1.6-rc-1 and later */
 public BuildResult<?> getModel(
     ModelIdentifier modelIdentifier, BuildParameters operationParameters)
     throws UnsupportedOperationException, IllegalStateException {
   logTargetVersion();
   ProviderOperationParameters providerParameters = toProviderParameters(operationParameters);
   Object result = connection.run(modelIdentifier.getName(), providerParameters);
   return new ProviderBuildResult<Object>(result);
 }
Esempio n. 6
0
 /** This is used by consumers 1.2-rc-1 to 1.5 */
 @Deprecated
 public <T> BuildResult<T> run(Class<T> type, BuildParameters buildParameters)
     throws UnsupportedOperationException, IllegalStateException {
   validateCanRun();
   ProviderOperationParameters providerParameters = toProviderParameters(buildParameters);
   String modelName = new ModelMapping().getModelNameFromProtocolType(type);
   T result = (T) connection.run(modelName, new FixedBuildCancellationToken(), providerParameters);
   return new ProviderBuildResult<T>(result);
 }
Esempio n. 7
0
 /** This is used by consumers 1.0-milestone-3 to 1.1. */
 @Deprecated
 public void executeBuild(
     BuildParametersVersion1 buildParameters,
     BuildOperationParametersVersion1 operationParameters) {
   logTargetVersion();
   connection.run(
       ModelIdentifier.NULL_MODEL,
       new AdaptedOperationParameters(operationParameters, buildParameters.getTasks()));
 }
Esempio n. 8
0
 /** This is used by consumers 1.6-rc-1 and later */
 public BuildResult<?> getModel(
     ModelIdentifier modelIdentifier, BuildParameters operationParameters)
     throws UnsupportedOperationException, IllegalStateException {
   validateCanRun();
   ProviderOperationParameters providerParameters = toProviderParameters(operationParameters);
   Object result =
       connection.run(
           modelIdentifier.getName(), new FixedBuildCancellationToken(), providerParameters);
   return new ProviderBuildResult<Object>(result);
 }
Esempio n. 9
0
 /** 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 {
   validateCanRun();
   ProviderOperationParameters providerParameters = toProviderParameters(operationParameters);
   BuildCancellationToken buildCancellationToken =
       new BuildCancellationTokenAdapter(cancellationToken);
   Object result =
       connection.run(modelIdentifier.getName(), buildCancellationToken, providerParameters);
   return new ProviderBuildResult<Object>(result);
 }
Esempio n. 10
0
 /** This is used by consumers 1.2-rc-1 and later. */
 public void configure(ConnectionParameters parameters) {
   ProviderConnectionParameters providerConnectionParameters =
       adapter.adapt(ProviderConnectionParameters.class, parameters);
   connection.configure(providerConnectionParameters);
 }
Esempio n. 11
0
 /** This is used by consumers 1.0-milestone-3 and later */
 public void stop() {
   connection.stop();
 }