Skip to content

Commit 722e6c4

Browse files
authored
Merge pull request #778 from DataDog/mar-kolya/some-java11-prep
Mar kolya/some java11 prep
2 parents e4dcabe + 75643fe commit 722e6c4

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

gradle/dependencies.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
def groovyVer = "2.5.2"
1+
def groovyVer = "2.5.3"
22
def spockGroovyVer = groovyVer.replaceAll(/\.\d+$/, '')
33

44
ext {
@@ -15,7 +15,7 @@ ext {
1515
logback : "1.2.3",
1616
lombok : "1.18.4",
1717
bytebuddy : "1.9.9",
18-
scala : "2.11.12",
18+
scala : "2.11.12", // Last version to support Java 7 (2.12+ require Java 8+)
1919
kotlin : "1.3.11",
2020
coroutines : "1.1.0"
2121
]

gradle/java.gradle

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ if (project.parent && project.parent.hasProperty("javaExecutableVersionCache"))
152152
project.ext.javaExecutableVersionCache = [:]
153153
}
154154

155-
def getJavaExecutableVersion(String path) {
155+
JavaVersion getJavaExecutableVersion(String path) {
156156
def cache = project.ext.javaExecutableVersionCache
157157

158158
if (cache.containsKey(path)) {
@@ -221,14 +221,25 @@ for (def env : System.getenv().entrySet()) {
221221
def javaPath = "$javaHome/bin/java"
222222
def javaVersion = getJavaExecutableVersion(javaPath)
223223

224+
// This is slightly complicated because we need to dereference symlinks to make sure
225+
// we are considering same JVM implementation
226+
def currentJavaHome = new File(System.getProperty("java.home")).toPath().toRealPath()
227+
if (currentJavaHome.endsWith("jre")) {
228+
currentJavaHome = currentJavaHome.parent
229+
}
230+
if (currentJavaHome == new File(javaHome).toPath().toRealPath()) {
231+
// Skip JVM implementation we are running gradle on
232+
continue
233+
}
234+
224235
def parentTask = task "testJava${javaName}"() {
225236
group = 'Verification'
226237
description = "Run tests for Java ${javaName}"
227238
}
228239
tasks.check.dependsOn parentTask
229240

230241
tasks.withType(Test).configureEach {
231-
// if (name.endsWith("Generated")) {
242+
//if (name.endsWith("Generated")) {
232243
if (!name.equals("test")) {
233244
// The way we're copying the test doesn't currently work with "test-sets" generated tests.
234245
return

gradle/test-with-scala.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
apply plugin: 'scala'
44

5+
configurations {
6+
all {
7+
if (it.name != "zinc") {
8+
resolutionStrategy {
9+
force deps.scala
10+
}
11+
}
12+
}
13+
}
14+
515
compileTestGroovy {
616
classpath = classpath.plus(files(compileTestScala.destinationDir))
717
dependsOn compileTestScala

0 commit comments

Comments
 (0)