private BuildResult run(Action<GradleExecutionResult> resultVerification) { if (projectDirectory == null) { throw new InvalidRunnerConfigurationException( "Please specify a project directory before executing the build"); } File testKitDir = createTestKitDir(testKitDirProvider); GradleDistribution effectiveDistribution = distribution == null ? findGradleInstallFromGradleRunner() : distribution; GradleExecutionResult execResult = gradleExecutor.run( new GradleExecutionParameters( effectiveDistribution, testKitDir, projectDirectory, arguments, jvmArguments, classpath, debug, standardOutput, standardError)); resultVerification.execute(execResult); return createBuildResult(execResult); }
private BuildResult run(Action<GradleExecutionResult> resultVerification) { if (projectDirectory == null) { throw new InvalidRunnerConfigurationException( "Please specify a project directory before executing the build"); } GradleExecutionResult execResult = gradleExecutor.run( gradleHome, gradleUserHomeDir, projectDirectory, arguments, jvmArguments); resultVerification.execute(execResult); return new DefaultBuildResult( execResult.getStandardOutput(), execResult.getStandardError(), execResult.getTasks()); }