1
+ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
2
+
1
3
import java.time.Duration
2
4
3
5
/*
@@ -113,21 +115,13 @@ subprojects {
113
115
114
116
plugins. withType(JavaPlugin ) {
115
117
project. tasks. withType(JavaCompile ) { task ->
116
- if (JavaVersion . current(). isJava11Compatible()) {
117
- task. options. release = 8
118
- }
119
118
if (project. hasProperty(" showDeprecation" )) {
120
119
options. compilerArgs << " -Xlint:deprecation"
121
120
}
122
121
if (project. hasProperty(" showUnchecked" )) {
123
122
options. compilerArgs << " -Xlint:unchecked"
124
123
}
125
124
}
126
- project. tasks. withType(GroovyCompile ) { task ->
127
- if (JavaVersion . current(). isJava11Compatible()) {
128
- task. options. release = 8
129
- }
130
- }
131
125
}
132
126
133
127
repositories {
@@ -168,9 +162,6 @@ subprojects {
168
162
forkEvery = 10
169
163
minHeapSize = ' 128m'
170
164
maxHeapSize = ' 1024m'
171
- if (JavaVersion . current(). isJava8Compatible()) {
172
- jvmArgs ' -XX:-UseGCOverheadLimit'
173
- }
174
165
175
166
testLogging {
176
167
// events 'passed', 'failed', 'skipped', 'standard_out', 'standard_error'
@@ -199,9 +190,8 @@ configure(subprojects.findAll { !it.isDistribution() }) {
199
190
200
191
201
192
javadoc {
202
- // Oracle JDK8 likes to fail the build over spoiled HTML
193
+ // Oracle JDK11+ likes to fail the build over spoiled HTML
203
194
options. addStringOption(' Xdoclint:none' , ' -quiet' )
204
- options. source(' 8' )
205
195
}
206
196
}
207
197
@@ -210,6 +200,20 @@ configure(subprojects.findAll { !it.name.endsWith('-distribution') && ! it.name.
210
200
java {
211
201
withJavadocJar()
212
202
withSourcesJar()
203
+ toolchain {
204
+ languageVersion. set(JavaLanguageVersion . of(getToolchainVersion()))
205
+ }
213
206
}
214
207
215
208
}
209
+
210
+ // Windows workaround to fix invalid toolchain detection
211
+ def getToolchainVersion () {
212
+ if (DefaultNativePlatform . getCurrentOperatingSystem(). isWindows()) {
213
+ if (JavaVersion . current(). isCompatibleWith(JavaVersion . VERSION_19 ))
214
+ return 19
215
+ if (JavaVersion . current(). isCompatibleWith(JavaVersion . VERSION_17 ))
216
+ return 17
217
+ }
218
+ return 11
219
+ }
0 commit comments