Пример #1
0
 private Object run(
     BuildAction<? extends BuildActionResult> action,
     BuildCancellationToken cancellationToken,
     ProviderOperationParameters operationParameters,
     Map<String, String> properties) {
   BuildActionExecuter<ProviderOperationParameters> executer = createExecuter(operationParameters);
   ConfiguringBuildAction<BuildActionResult> configuringAction =
       new ConfiguringBuildAction<BuildActionResult>(operationParameters, action, properties);
   BuildActionResult result =
       executer.execute(configuringAction, cancellationToken, operationParameters);
   if (result.failure != null) {
     throw (RuntimeException) payloadSerializer.deserialize(result.failure);
   }
   return payloadSerializer.deserialize(result.result);
 }
Пример #2
0
 public <T> T execute(
     BuildAction<T> action,
     BuildCancellationToken cancellationToken,
     ProviderOperationParameters actionParameters) {
   BuildActionParameters parameters =
       new DefaultBuildActionParameters(
           new GradleLauncherMetaData(),
           actionParameters.getStartTime(),
           this.parameters.getEffectiveSystemProperties(),
           System.getenv(),
           SystemProperties.getCurrentDir(),
           actionParameters.getBuildLogLevel());
   try {
     return executer.execute(action, cancellationToken, parameters);
   } catch (ReportedException e) {
     throw new BuildExceptionVersion1(e.getCause());
   }
 }