Merge pull request #778 from DataDog/mar-kolya/some-java11-prep

Mar kolya/some java11 prep
This commit is contained in:
Nikolay Martynov 2019-03-27 12:55:52 -04:00 committed by GitHub
commit 722e6c4f68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 4 deletions

View File

@ -1,4 +1,4 @@
def groovyVer = "2.5.2"
def groovyVer = "2.5.3"
def spockGroovyVer = groovyVer.replaceAll(/\.\d+$/, '')
ext {
@ -15,7 +15,7 @@ ext {
logback : "1.2.3",
lombok : "1.18.4",
bytebuddy : "1.9.9",
scala : "2.11.12",
scala : "2.11.12", // Last version to support Java 7 (2.12+ require Java 8+)
kotlin : "1.3.11",
coroutines : "1.1.0"
]

View File

@ -152,7 +152,7 @@ if (project.parent && project.parent.hasProperty("javaExecutableVersionCache"))
project.ext.javaExecutableVersionCache = [:]
}
def getJavaExecutableVersion(String path) {
JavaVersion getJavaExecutableVersion(String path) {
def cache = project.ext.javaExecutableVersionCache
if (cache.containsKey(path)) {
@ -221,6 +221,17 @@ for (def env : System.getenv().entrySet()) {
def javaPath = "$javaHome/bin/java"
def javaVersion = getJavaExecutableVersion(javaPath)
// This is slightly complicated because we need to dereference symlinks to make sure
// we are considering same JVM implementation
def currentJavaHome = new File(System.getProperty("java.home")).toPath().toRealPath()
if (currentJavaHome.endsWith("jre")) {
currentJavaHome = currentJavaHome.parent
}
if (currentJavaHome == new File(javaHome).toPath().toRealPath()) {
// Skip JVM implementation we are running gradle on
continue
}
def parentTask = task "testJava${javaName}"() {
group = 'Verification'
description = "Run tests for Java ${javaName}"
@ -228,7 +239,7 @@ for (def env : System.getenv().entrySet()) {
tasks.check.dependsOn parentTask
tasks.withType(Test).configureEach {
// if (name.endsWith("Generated")) {
//if (name.endsWith("Generated")) {
if (!name.equals("test")) {
// The way we're copying the test doesn't currently work with "test-sets" generated tests.
return

View File

@ -2,6 +2,16 @@
apply plugin: 'scala'
configurations {
all {
if (it.name != "zinc") {
resolutionStrategy {
force deps.scala
}
}
}
}
compileTestGroovy {
classpath = classpath.plus(files(compileTestScala.destinationDir))
dependsOn compileTestScala