Skip to content

Commit 111bac4

Browse files
8263760: Update gradle to version 7.0.1
8240336: JavaFX build uses deprecated features that will be removed in gradle 7 Reviewed-by: sykora, arapte
1 parent 485b242 commit 111bac4

13 files changed

+142
-102
lines changed

build.gradle

+64-62
Original file line numberDiff line numberDiff line change
@@ -1819,15 +1819,15 @@ void addJCov(p, test) {
18191819
"exclude=\"**.*Test\"," +
18201820
"file=build/reports/jcov/report.xml," +
18211821
"merge=merge";
1822-
test.jvmArgs("-javaagent:${p.configurations.testCompile.files.find { it.name.startsWith('jcov') }}=$jcovJVMArgument");
1822+
test.jvmArgs("-javaagent:${p.configurations.testClasspath.files.find { it.name.startsWith('jcov') }}=$jcovJVMArgument");
18231823
p.mkdir p.file("build/reports/jcov")
18241824
}
18251825
test.doLast {
18261826
def reportFile = p.file("build/reports/jcov/report.xml")
18271827
if (reportFile.exists()) {
18281828
p.javaexec {
18291829
workingDir = p.file("build/reports/jcov")
1830-
classpath = p.files(p.configurations.testCompile.files.find { it.name.startsWith('jcov') })
1830+
classpath = p.files(p.configurations.testClasspath.files.find { it.name.startsWith('jcov') })
18311831
main = "com.sun.tdk.jcov.Helper"
18321832
args = [
18331833
"RepGen",
@@ -1940,9 +1940,9 @@ allprojects {
19401940
// By default all of our projects require junit for testing so we can just
19411941
// setup this dependency here.
19421942
dependencies {
1943-
testCompile group: "junit", name: "junit", version: "4.8.2"
1943+
testImplementation group: "junit", name: "junit", version: "4.8.2"
19441944
if (BUILD_CLOSED && DO_JCOV) {
1945-
testCompile name: "jcov"
1945+
testImplementation name: "jcov"
19461946
}
19471947
}
19481948

@@ -2029,9 +2029,9 @@ project(":base") {
20292029
}
20302030

20312031
dependencies {
2032-
testCompile group: "junit", name: "junit", version: "4.8.2"
2033-
testCompile sourceSets.main.output
2034-
testCompile sourceSets.shims.output
2032+
testImplementation group: "junit", name: "junit", version: "4.8.2"
2033+
testImplementation sourceSets.main.output
2034+
testImplementation sourceSets.shims.output
20352035
}
20362036

20372037
commonModuleSetup(project, [ 'base' ])
@@ -2105,11 +2105,11 @@ project(":graphics") {
21052105
}
21062106

21072107
dependencies {
2108-
stubCompile group: "junit", name: "junit", version: "4.8.2"
2108+
stubImplementation group: "junit", name: "junit", version: "4.8.2"
21092109

21102110
antlr group: "org.antlr", name: "antlr4", version: "4.7.2", classifier: "complete"
2111-
testCompile project(":base").sourceSets.test.output
2112-
compile project(':base')
2111+
testImplementation project(":base").sourceSets.test.output
2112+
implementation project(':base')
21132113
}
21142114

21152115
project.ext.moduleSourcePath = defaultModuleSourcePath_GraphicsOne
@@ -2191,7 +2191,7 @@ project(":graphics") {
21912191
project.task("compileFullJava", type: JavaCompile, dependsOn: processShaders) {
21922192
description = "Compile all of the graphics java classes - main and shaders"
21932193

2194-
classpath = configurations.compile
2194+
classpath = configurations.compileClasspath
21952195

21962196
source = project.sourceSets.main.java.srcDirs
21972197
source += "$buildDir/gensrc/java"
@@ -2360,7 +2360,7 @@ project(":graphics") {
23602360
executable = JAVA
23612361
workingDir = project.projectDir
23622362
main = settings.generator
2363-
classpath = configurations.compile + configurations.antlr
2363+
classpath = configurations.compileClasspath + configurations.antlr
23642364
classpath += files(project.sourceSets.jslc.java.outputDir)
23652365

23662366
classpath += files("${project.projectDir}/src/jslc/resources")
@@ -2449,7 +2449,7 @@ project(":graphics") {
24492449
executable = JAVA
24502450
workingDir = project.projectDir
24512451
main = "CompileJSL"
2452-
classpath = configurations.compile + configurations.antlr
2452+
classpath = configurations.compileClasspath + configurations.antlr
24532453
classpath += files(project.sourceSets.jslc.java.outputDir)
24542454
classpath += files(project.sourceSets.jslc.resources)
24552455
classpath += files("$buildDir/classes/jsl-compilers/prism",
@@ -2504,7 +2504,7 @@ project(":graphics") {
25042504
}
25052505
if (allLibsPresent) return;
25062506

2507-
for (File f : [configurations.compile.files, configurations.antlr.files].flatten()) {
2507+
for (File f : [configurations.compileClasspath.files, configurations.antlr.files].flatten()) {
25082508
copy {
25092509
into libsDir
25102510
from f.getParentFile()
@@ -2548,10 +2548,10 @@ project(":controls") {
25482548
commonModuleSetup(project, [ 'base', 'graphics', 'controls' ])
25492549

25502550
dependencies {
2551-
testCompile project(":graphics").sourceSets.test.output
2552-
testCompile project(":base").sourceSets.test.output
2553-
compile project(':base')
2554-
compile project(':graphics')
2551+
testImplementation project(":graphics").sourceSets.test.output
2552+
testImplementation project(":base").sourceSets.test.output
2553+
implementation project(':base')
2554+
implementation project(':graphics')
25552555
}
25562556

25572557
test {
@@ -2627,8 +2627,8 @@ project(":swing") {
26272627
commonModuleSetup(project, [ 'base', 'graphics', 'swing' ])
26282628

26292629
dependencies {
2630-
compile project(":base")
2631-
compile project(":graphics")
2630+
implementation project(":base")
2631+
implementation project(":graphics")
26322632
}
26332633

26342634
test {
@@ -2653,7 +2653,7 @@ project(":swt") {
26532653
commonModuleSetup(project, [ 'base', 'graphics' ])
26542654

26552655
dependencies {
2656-
compile name: SWT_FILE_NAME
2656+
implementation name: SWT_FILE_NAME
26572657
}
26582658

26592659
classes {
@@ -2666,7 +2666,7 @@ project(":swt") {
26662666
// Skip copy if file is present.
26672667
if (swtLib.exists()) return;
26682668

2669-
for (File f : configurations.compile.files) {
2669+
for (File f : configurations.compileClasspath.files) {
26702670
// Have to rename the swt jar because it is some platform specific name but
26712671
// for the sake of the IDEs we need to have a single stable name that works
26722672
// on every platform
@@ -2732,10 +2732,10 @@ project(":fxml") {
27322732

27332733

27342734
dependencies {
2735-
testCompile project(":graphics").sourceSets.test.output
2736-
testCompile project(":base").sourceSets.test.output
2737-
compile project(":base")
2738-
compile project(":graphics")
2735+
testImplementation project(":graphics").sourceSets.test.output
2736+
testImplementation project(":base").sourceSets.test.output
2737+
implementation project(":base")
2738+
implementation project(":graphics")
27392739
}
27402740

27412741
test {
@@ -2784,8 +2784,8 @@ project(":media") {
27842784
media name: "ffmpeg-3.3.3", ext: "tar.gz"
27852785
media name: "ffmpeg-4.0.2", ext: "tar.gz"
27862786
}
2787-
compile project(":base")
2788-
compile project(":graphics")
2787+
implementation project(":base")
2788+
implementation project(":graphics")
27892789
}
27902790

27912791
compileJava.dependsOn updateCacheIfNeeded
@@ -3391,10 +3391,10 @@ project(":web") {
33913391
if (IS_COMPILE_WEBKIT) {
33923392
icu name: "icu4c-${icuVersion}-data-bin-l", ext: "zip"
33933393
}
3394-
compile project(":base")
3395-
compile project(":graphics")
3396-
compile project(":controls")
3397-
compile project(":media")
3394+
implementation project(":base")
3395+
implementation project(":graphics")
3396+
implementation project(":controls")
3397+
implementation project(":media")
33983398
}
33993399

34003400
compileJava.dependsOn updateCacheIfNeeded
@@ -3403,8 +3403,8 @@ project(":web") {
34033403
from (project.file("$projectDir/src/test/resources/test/html")) {
34043404
include "**/archive-*.*"
34053405
}
3406-
archiveName = "webArchiveJar.jar"
3407-
destinationDir = file("$buildDir/testing/resources")
3406+
archiveFileName = "webArchiveJar.jar"
3407+
destinationDirectory = file("$buildDir/testing/resources")
34083408
}
34093409

34103410
def gensrcDir = "${buildDir}/gensrc/java"
@@ -3589,7 +3589,7 @@ project(":web") {
35893589
def compileJavaDOMBindingTask = task("compileJavaDOMBinding${t.capital}", type: JavaCompile,
35903590
dependsOn: [compileJava, compileNativeTask, copyNativeTask]) {
35913591
destinationDir = file("$buildDir/classes/java/main")
3592-
classpath = configurations.compile
3592+
classpath = configurations.compileClasspath
35933593
source = project.sourceSets.main.java.srcDirs
35943594
options.compilerArgs.addAll([
35953595
'-implicit:none',
@@ -3607,8 +3607,8 @@ project(":web") {
36073607

36083608
def drtClasses = "**/com/sun/javafx/webkit/drt/**"
36093609
task drtJar(type: Jar, dependsOn: compileJava) {
3610-
archiveName = "drt.jar"
3611-
destinationDir = file("$buildDir/test")
3610+
archiveFileName = "drt.jar"
3611+
destinationDirectory = file("$buildDir/test")
36123612
from "$buildDir/classes/java/main/javafx.web/"
36133613
include drtClasses
36143614
includeEmptyDirs = false
@@ -3668,10 +3668,10 @@ project(":systemTests") {
36683668
project.ext.moduleName = "systemTests"
36693669

36703670
dependencies {
3671-
testCompile project(":graphics").sourceSets.test.output
3672-
testCompile project(":base").sourceSets.test.output
3673-
testCompile project(":controls").sourceSets.test.output
3674-
testCompile project(":swing").sourceSets.test.output
3671+
testImplementation project(":graphics").sourceSets.test.output
3672+
testImplementation project(":base").sourceSets.test.output
3673+
testImplementation project(":controls").sourceSets.test.output
3674+
testImplementation project(":swing").sourceSets.test.output
36753675
}
36763676

36773677
def dependentProjects = [ 'base', 'graphics', 'controls', 'media', 'web', 'swing', 'fxml' ]
@@ -3726,8 +3726,8 @@ project(":systemTests") {
37263726
dependsOn compileTestapp1Java
37273727
enabled = IS_FULL_TEST
37283728

3729-
destinationDir = file("$buildDir/testapp1")
3730-
archiveName = testapp1JarName
3729+
destinationDirectory = file("$buildDir/testapp1")
3730+
archiveFileName = testapp1JarName
37313731
includeEmptyDirs = false
37323732
from project.sourceSets.testapp1.java.outputDir
37333733
include("testapp/**")
@@ -3747,8 +3747,8 @@ project(":systemTests") {
37473747
dependsOn compileTestapp1Java
37483748
enabled = IS_FULL_TEST
37493749

3750-
destinationDir = file("$buildDir/testapp1")
3751-
archiveName = "jar2.jar";
3750+
destinationDirectory = file("$buildDir/testapp1")
3751+
archiveFileName = "jar2.jar";
37523752
includeEmptyDirs = false
37533753
from project.sourceSets.testapp1.java.outputDir
37543754
include("pkg2/**")
@@ -4188,8 +4188,8 @@ compileTargets { t ->
41884188
enabled = COMPILE_SWT
41894189
group = "Basic"
41904190
description = "Creates the javafx-swt.jar for the $t.name target"
4191-
destinationDir = file("${project(":swt").buildDir}/libs")
4192-
archiveName = "javafx-swt.jar"
4191+
destinationDirectory = file("${project(":swt").buildDir}/libs")
4192+
archiveFileName = "javafx-swt.jar"
41934193
includeEmptyDirs = false
41944194
from("${project(":swt").buildDir}/classes/java/main");
41954195
include("**/javafx/embed/swt/**")
@@ -4209,7 +4209,9 @@ compileTargets { t ->
42094209
dependsOn(javafxSwtTask)
42104210

42114211
doLast() {
4212-
ant.jar (update: true, index: true, destfile: "${javafxSwtTask.destinationDir}/${javafxSwtTask.archiveName}")
4212+
def destDir = javafxSwtTask.destinationDirectory.get()
4213+
def afName = javafxSwtTask.archiveFileName.get()
4214+
ant.jar (update: true, index: true, destfile: "${destDir}/${afName}")
42134215
}
42144216
}
42154217

@@ -4376,17 +4378,17 @@ compileTargets { t ->
43764378
zipsTask.dependsOn(zipSdkTask)
43774379

43784380
def zipDocsTask = task("zipDocs$t.capital", type: Zip, dependsOn: zipSdkTask) {
4379-
destinationDir = file("${bundlesDir}")
4380-
archiveName = "${docsBundleName}.zip"
4381+
destinationDirectory = file("${bundlesDir}")
4382+
archiveFileName = "${docsBundleName}.zip"
43814383
includeEmptyDirs = false
43824384
from docsArtifactsDir
43834385
into "${docsBundleName}"
43844386
}
43854387
zipsTask.dependsOn(zipDocsTask)
43864388

43874389
def zipJmodsTask = task("zipJmods$t.capital", type: Zip, dependsOn: zipDocsTask) {
4388-
destinationDir = file("${bundlesDir}")
4389-
archiveName = "${jmodsBundleName}.zip"
4390+
destinationDirectory = file("${bundlesDir}")
4391+
archiveFileName = "${jmodsBundleName}.zip"
43904392
includeEmptyDirs = false
43914393
from jmodsArtifactsDir
43924394
into "${jmodsBundleName}"
@@ -4684,8 +4686,8 @@ compileTargets { t ->
46844686
def dstModularJarDir = "${standaloneLibDir}"
46854687
def modularJarName = "${moduleName}.jar"
46864688
def modularJarTask = project.task("modularJarStandalone$t.capital", type: Jar, dependsOn: project.assemble) {
4687-
destinationDir = file("${dstModularJarDir}")
4688-
archiveName = modularJarName
4689+
destinationDirectory = file("${dstModularJarDir}")
4690+
archiveFileName = modularJarName
46894691
includeEmptyDirs = false
46904692
from srcClassesDir
46914693
}
@@ -4741,8 +4743,8 @@ compileTargets { t ->
47414743
// and the standalone sdk should be independent of one another, but seems
47424744
// better than the alternatives.
47434745
def zipSourceFilesTask = project.task("zipSourceFilesStandalone$t.capital", type: Zip, dependsOn: buildModulesTask) {
4744-
destinationDir = file("${standaloneLibDir}")
4745-
archiveName = standaloneSrcZipName
4746+
destinationDirectory = file("${standaloneLibDir}")
4747+
archiveFileName = standaloneSrcZipName
47464748
includeEmptyDirs = false
47474749
from modulesSrcDir
47484750
include "**/*.java"
@@ -4767,14 +4769,14 @@ compileTargets { t ->
47674769

47684770
def modularEmptyPublicationJarName = "${moduleName}.jar"
47694771
def modularEmptyPublicationJarTask = project.task("moduleEmptyPublicationJar${t.capital}", type: Jar) {
4770-
destinationDir = file("${dstModularJarDir}")
4771-
archiveName = modularEmptyPublicationJarName
4772+
destinationDirectory = file("${dstModularJarDir}")
4773+
archiveFileName = modularEmptyPublicationJarName
47724774
}
47734775

47744776
def modularPublicationJarName = "${moduleName}-${t.name}.jar"
47754777
def modularPublicationJarTask = project.task("modularPublicationJar${t.capital}", type: Jar, dependsOn: modularEmptyPublicationJarTask) {
4776-
destinationDir = file("${dstModularJarDir}")
4777-
archiveName = modularPublicationJarName
4778+
destinationDirectory = file("${dstModularJarDir}")
4779+
archiveFileName = modularPublicationJarName
47784780
from srcLibsDir
47794781
from srcClassesDir
47804782
}
@@ -5108,8 +5110,8 @@ compileTargets { t ->
51085110
file("${rootProject.buildDir}/${jfxBundle}").delete()
51095111
}
51105112

5111-
archiveName = jfxBundle
5112-
destinationDir = file("${rootProject.buildDir}")
5113+
archiveFileName = jfxBundle
5114+
destinationDirectory = file("${rootProject.buildDir}")
51135115
includeEmptyDirs = false
51145116
from "${bundledSdkDir}"
51155117
}

build.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ jfx.build.jdk.buildnum.min=28
8484
# gradle/legal/gradle.md.
8585
# The jfx.gradle.version.min property defines the minimum version of gradle
8686
# that is supported. It must be <= jfx.gradle.version.
87-
jfx.gradle.version=6.3
88-
jfx.gradle.version.min=5.3
87+
jfx.gradle.version=7.0.1
88+
jfx.gradle.version.min=6.3
8989

9090
# Toolchains
9191
jfx.build.linux.gcc.version=gcc10.3.0-OL6.4+1.0

buildSrc/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ repositories {
7474
}
7575

7676
dependencies {
77-
testCompile group: "junit", name: "junit", version: "4.8.2"
77+
testImplementation group: "junit", name: "junit", version: "4.8.2"
7878
}
7979

8080
// At the moment the ASM library shipped with Gradle that is used to

buildSrc/src/main/groovy/com/sun/javafx/gradle/CCTask.groovy

+5-4
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@
2323
* questions.
2424
*/
2525

26+
import org.gradle.api.tasks.Input
2627
import org.gradle.api.tasks.InputDirectory
2728
import org.gradle.api.tasks.Optional
2829

2930
class CCTask extends NativeCompileTask {
30-
String compiler;
31-
@Optional List<String> linkerOptions = new ArrayList<String>();
31+
@Input String compiler;
32+
@Optional @Input List<String> linkerOptions = new ArrayList<String>();
3233
@Optional @InputDirectory File headers;
33-
@Optional Closure eachOutputFile; // will be given a File and must return a File
34-
@Optional boolean exe = false;
34+
@Optional @Input Closure eachOutputFile; // will be given a File and must return a File
35+
@Input boolean exe = false;
3536

3637
protected File outputFile(File sourceFile) {
3738
final String outFileName = sourceFile.getName().substring(0, sourceFile.getName().lastIndexOf("."));

buildSrc/src/main/groovy/com/sun/javafx/gradle/CompileResourceTask.groovy

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
* questions.
2424
*/
2525

26+
import org.gradle.api.tasks.Input
27+
2628
class CompileResourceTask extends NativeCompileTask {
27-
List<String> rcParams = new ArrayList<String>();
28-
String compiler;
29+
@Input List<String> rcParams = new ArrayList<String>();
30+
@Input String compiler;
2931

3032
protected File outputFile(File sourceFile) {
3133
final String outFileName = sourceFile.getName().substring(0, sourceFile.getName().lastIndexOf("."));

0 commit comments

Comments
 (0)