package aQute.bnd.gradle

import org.gradle.api.JavaVersion
import org.gradle.testkit.runner.GradleRunner

class TestHelper {

  private TestHelper() { }

  public static GradleRunner getGradleRunner() {
    return GradleRunner.create()
            .withGradleVersion(JavaVersion.current().isJava9Compatible() ? "4.2.1" : "4.0")
  }
}

package aQute.bnd.gradle

import org.gradle.api.JavaVersion
import org.gradle.testkit.runner.GradleRunner

class TestHelper {

  private TestHelper() { }

  public static GradleRunner getGradleRunner() {
    return GradleRunner.create()
            .withGradleVersion(gradleVersion())
  }

  private static String gradleVersion() {
    if (JavaVersion.current().isJava10Compatible()) {
      return '4.5'
    }
    if (JavaVersion.current().isJava9Compatible()) {
      return '4.2.1'
    }
    return '4.0'
  }
}

Use gradle 4.5 as base gradle version for Java 10 testing
gradle: Use gradle 4.5 as base gradle version for Java 10 testing

Signed-off-by: BJ Hargrave <3d26bb3930946e3370762d769a073cece444c2d8@bjhargrave.com>
