Skip to content

Commit

Permalink
8263760: Update gradle to version 7.0.1
Browse files Browse the repository at this point in the history
8240336: JavaFX build uses deprecated features that will be removed in gradle 7

Reviewed-by: sykora, arapte
  • Loading branch information
kevinrushforth committed May 19, 2021
1 parent 485b242 commit 111bac4
Show file tree
Hide file tree
Showing 13 changed files with 142 additions and 102 deletions.
126 changes: 64 additions & 62 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -1819,15 +1819,15 @@ void addJCov(p, test) {
"exclude=\"**.*Test\"," +
"file=build/reports/jcov/report.xml," +
"merge=merge";
test.jvmArgs("-javaagent:${p.configurations.testCompile.files.find { it.name.startsWith('jcov') }}=$jcovJVMArgument");
test.jvmArgs("-javaagent:${p.configurations.testClasspath.files.find { it.name.startsWith('jcov') }}=$jcovJVMArgument");
p.mkdir p.file("build/reports/jcov")
}
test.doLast {
def reportFile = p.file("build/reports/jcov/report.xml")
if (reportFile.exists()) {
p.javaexec {
workingDir = p.file("build/reports/jcov")
classpath = p.files(p.configurations.testCompile.files.find { it.name.startsWith('jcov') })
classpath = p.files(p.configurations.testClasspath.files.find { it.name.startsWith('jcov') })
main = "com.sun.tdk.jcov.Helper"
args = [
"RepGen",
Expand Down Expand Up @@ -1940,9 +1940,9 @@ allprojects {
// By default all of our projects require junit for testing so we can just
// setup this dependency here.
dependencies {
testCompile group: "junit", name: "junit", version: "4.8.2"
testImplementation group: "junit", name: "junit", version: "4.8.2"
if (BUILD_CLOSED && DO_JCOV) {
testCompile name: "jcov"
testImplementation name: "jcov"
}
}

Expand Down Expand Up @@ -2029,9 +2029,9 @@ project(":base") {
}

dependencies {
testCompile group: "junit", name: "junit", version: "4.8.2"
testCompile sourceSets.main.output
testCompile sourceSets.shims.output
testImplementation group: "junit", name: "junit", version: "4.8.2"
testImplementation sourceSets.main.output
testImplementation sourceSets.shims.output
}

commonModuleSetup(project, [ 'base' ])
Expand Down Expand Up @@ -2105,11 +2105,11 @@ project(":graphics") {
}

dependencies {
stubCompile group: "junit", name: "junit", version: "4.8.2"
stubImplementation group: "junit", name: "junit", version: "4.8.2"

antlr group: "org.antlr", name: "antlr4", version: "4.7.2", classifier: "complete"
testCompile project(":base").sourceSets.test.output
compile project(':base')
testImplementation project(":base").sourceSets.test.output
implementation project(':base')
}

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

classpath = configurations.compile
classpath = configurations.compileClasspath

source = project.sourceSets.main.java.srcDirs
source += "$buildDir/gensrc/java"
Expand Down Expand Up @@ -2360,7 +2360,7 @@ project(":graphics") {
executable = JAVA
workingDir = project.projectDir
main = settings.generator
classpath = configurations.compile + configurations.antlr
classpath = configurations.compileClasspath + configurations.antlr
classpath += files(project.sourceSets.jslc.java.outputDir)

classpath += files("${project.projectDir}/src/jslc/resources")
Expand Down Expand Up @@ -2449,7 +2449,7 @@ project(":graphics") {
executable = JAVA
workingDir = project.projectDir
main = "CompileJSL"
classpath = configurations.compile + configurations.antlr
classpath = configurations.compileClasspath + configurations.antlr
classpath += files(project.sourceSets.jslc.java.outputDir)
classpath += files(project.sourceSets.jslc.resources)
classpath += files("$buildDir/classes/jsl-compilers/prism",
Expand Down Expand Up @@ -2504,7 +2504,7 @@ project(":graphics") {
}
if (allLibsPresent) return;

for (File f : [configurations.compile.files, configurations.antlr.files].flatten()) {
for (File f : [configurations.compileClasspath.files, configurations.antlr.files].flatten()) {
copy {
into libsDir
from f.getParentFile()
Expand Down Expand Up @@ -2548,10 +2548,10 @@ project(":controls") {
commonModuleSetup(project, [ 'base', 'graphics', 'controls' ])

dependencies {
testCompile project(":graphics").sourceSets.test.output
testCompile project(":base").sourceSets.test.output
compile project(':base')
compile project(':graphics')
testImplementation project(":graphics").sourceSets.test.output
testImplementation project(":base").sourceSets.test.output
implementation project(':base')
implementation project(':graphics')
}

test {
Expand Down Expand Up @@ -2627,8 +2627,8 @@ project(":swing") {
commonModuleSetup(project, [ 'base', 'graphics', 'swing' ])

dependencies {
compile project(":base")
compile project(":graphics")
implementation project(":base")
implementation project(":graphics")
}

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

dependencies {
compile name: SWT_FILE_NAME
implementation name: SWT_FILE_NAME
}

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

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


dependencies {
testCompile project(":graphics").sourceSets.test.output
testCompile project(":base").sourceSets.test.output
compile project(":base")
compile project(":graphics")
testImplementation project(":graphics").sourceSets.test.output
testImplementation project(":base").sourceSets.test.output
implementation project(":base")
implementation project(":graphics")
}

test {
Expand Down Expand Up @@ -2784,8 +2784,8 @@ project(":media") {
media name: "ffmpeg-3.3.3", ext: "tar.gz"
media name: "ffmpeg-4.0.2", ext: "tar.gz"
}
compile project(":base")
compile project(":graphics")
implementation project(":base")
implementation project(":graphics")
}

compileJava.dependsOn updateCacheIfNeeded
Expand Down Expand Up @@ -3391,10 +3391,10 @@ project(":web") {
if (IS_COMPILE_WEBKIT) {
icu name: "icu4c-${icuVersion}-data-bin-l", ext: "zip"
}
compile project(":base")
compile project(":graphics")
compile project(":controls")
compile project(":media")
implementation project(":base")
implementation project(":graphics")
implementation project(":controls")
implementation project(":media")
}

compileJava.dependsOn updateCacheIfNeeded
Expand All @@ -3403,8 +3403,8 @@ project(":web") {
from (project.file("$projectDir/src/test/resources/test/html")) {
include "**/archive-*.*"
}
archiveName = "webArchiveJar.jar"
destinationDir = file("$buildDir/testing/resources")
archiveFileName = "webArchiveJar.jar"
destinationDirectory = file("$buildDir/testing/resources")
}

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

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

dependencies {
testCompile project(":graphics").sourceSets.test.output
testCompile project(":base").sourceSets.test.output
testCompile project(":controls").sourceSets.test.output
testCompile project(":swing").sourceSets.test.output
testImplementation project(":graphics").sourceSets.test.output
testImplementation project(":base").sourceSets.test.output
testImplementation project(":controls").sourceSets.test.output
testImplementation project(":swing").sourceSets.test.output
}

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

destinationDir = file("$buildDir/testapp1")
archiveName = testapp1JarName
destinationDirectory = file("$buildDir/testapp1")
archiveFileName = testapp1JarName
includeEmptyDirs = false
from project.sourceSets.testapp1.java.outputDir
include("testapp/**")
Expand All @@ -3747,8 +3747,8 @@ project(":systemTests") {
dependsOn compileTestapp1Java
enabled = IS_FULL_TEST

destinationDir = file("$buildDir/testapp1")
archiveName = "jar2.jar";
destinationDirectory = file("$buildDir/testapp1")
archiveFileName = "jar2.jar";
includeEmptyDirs = false
from project.sourceSets.testapp1.java.outputDir
include("pkg2/**")
Expand Down Expand Up @@ -4188,8 +4188,8 @@ compileTargets { t ->
enabled = COMPILE_SWT
group = "Basic"
description = "Creates the javafx-swt.jar for the $t.name target"
destinationDir = file("${project(":swt").buildDir}/libs")
archiveName = "javafx-swt.jar"
destinationDirectory = file("${project(":swt").buildDir}/libs")
archiveFileName = "javafx-swt.jar"
includeEmptyDirs = false
from("${project(":swt").buildDir}/classes/java/main");
include("**/javafx/embed/swt/**")
Expand All @@ -4209,7 +4209,9 @@ compileTargets { t ->
dependsOn(javafxSwtTask)

doLast() {
ant.jar (update: true, index: true, destfile: "${javafxSwtTask.destinationDir}/${javafxSwtTask.archiveName}")
def destDir = javafxSwtTask.destinationDirectory.get()
def afName = javafxSwtTask.archiveFileName.get()
ant.jar (update: true, index: true, destfile: "${destDir}/${afName}")
}
}

Expand Down Expand Up @@ -4376,17 +4378,17 @@ compileTargets { t ->
zipsTask.dependsOn(zipSdkTask)

def zipDocsTask = task("zipDocs$t.capital", type: Zip, dependsOn: zipSdkTask) {
destinationDir = file("${bundlesDir}")
archiveName = "${docsBundleName}.zip"
destinationDirectory = file("${bundlesDir}")
archiveFileName = "${docsBundleName}.zip"
includeEmptyDirs = false
from docsArtifactsDir
into "${docsBundleName}"
}
zipsTask.dependsOn(zipDocsTask)

def zipJmodsTask = task("zipJmods$t.capital", type: Zip, dependsOn: zipDocsTask) {
destinationDir = file("${bundlesDir}")
archiveName = "${jmodsBundleName}.zip"
destinationDirectory = file("${bundlesDir}")
archiveFileName = "${jmodsBundleName}.zip"
includeEmptyDirs = false
from jmodsArtifactsDir
into "${jmodsBundleName}"
Expand Down Expand Up @@ -4684,8 +4686,8 @@ compileTargets { t ->
def dstModularJarDir = "${standaloneLibDir}"
def modularJarName = "${moduleName}.jar"
def modularJarTask = project.task("modularJarStandalone$t.capital", type: Jar, dependsOn: project.assemble) {
destinationDir = file("${dstModularJarDir}")
archiveName = modularJarName
destinationDirectory = file("${dstModularJarDir}")
archiveFileName = modularJarName
includeEmptyDirs = false
from srcClassesDir
}
Expand Down Expand Up @@ -4741,8 +4743,8 @@ compileTargets { t ->
// and the standalone sdk should be independent of one another, but seems
// better than the alternatives.
def zipSourceFilesTask = project.task("zipSourceFilesStandalone$t.capital", type: Zip, dependsOn: buildModulesTask) {
destinationDir = file("${standaloneLibDir}")
archiveName = standaloneSrcZipName
destinationDirectory = file("${standaloneLibDir}")
archiveFileName = standaloneSrcZipName
includeEmptyDirs = false
from modulesSrcDir
include "**/*.java"
Expand All @@ -4767,14 +4769,14 @@ compileTargets { t ->

def modularEmptyPublicationJarName = "${moduleName}.jar"
def modularEmptyPublicationJarTask = project.task("moduleEmptyPublicationJar${t.capital}", type: Jar) {
destinationDir = file("${dstModularJarDir}")
archiveName = modularEmptyPublicationJarName
destinationDirectory = file("${dstModularJarDir}")
archiveFileName = modularEmptyPublicationJarName
}

def modularPublicationJarName = "${moduleName}-${t.name}.jar"
def modularPublicationJarTask = project.task("modularPublicationJar${t.capital}", type: Jar, dependsOn: modularEmptyPublicationJarTask) {
destinationDir = file("${dstModularJarDir}")
archiveName = modularPublicationJarName
destinationDirectory = file("${dstModularJarDir}")
archiveFileName = modularPublicationJarName
from srcLibsDir
from srcClassesDir
}
Expand Down Expand Up @@ -5108,8 +5110,8 @@ compileTargets { t ->
file("${rootProject.buildDir}/${jfxBundle}").delete()
}

archiveName = jfxBundle
destinationDir = file("${rootProject.buildDir}")
archiveFileName = jfxBundle
destinationDirectory = file("${rootProject.buildDir}")
includeEmptyDirs = false
from "${bundledSdkDir}"
}
Expand Down
4 changes: 2 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ jfx.build.jdk.buildnum.min=28
# gradle/legal/gradle.md.
# The jfx.gradle.version.min property defines the minimum version of gradle
# that is supported. It must be <= jfx.gradle.version.
jfx.gradle.version=6.3
jfx.gradle.version.min=5.3
jfx.gradle.version=7.0.1
jfx.gradle.version.min=6.3

# Toolchains
jfx.build.linux.gcc.version=gcc10.3.0-OL6.4+1.0
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ repositories {
}

dependencies {
testCompile group: "junit", name: "junit", version: "4.8.2"
testImplementation group: "junit", name: "junit", version: "4.8.2"
}

// At the moment the ASM library shipped with Gradle that is used to
Expand Down
9 changes: 5 additions & 4 deletions buildSrc/src/main/groovy/com/sun/javafx/gradle/CCTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@
* questions.
*/

import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputDirectory
import org.gradle.api.tasks.Optional

class CCTask extends NativeCompileTask {
String compiler;
@Optional List<String> linkerOptions = new ArrayList<String>();
@Input String compiler;
@Optional @Input List<String> linkerOptions = new ArrayList<String>();
@Optional @InputDirectory File headers;
@Optional Closure eachOutputFile; // will be given a File and must return a File
@Optional boolean exe = false;
@Optional @Input Closure eachOutputFile; // will be given a File and must return a File
@Input boolean exe = false;

protected File outputFile(File sourceFile) {
final String outFileName = sourceFile.getName().substring(0, sourceFile.getName().lastIndexOf("."));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
* questions.
*/

import org.gradle.api.tasks.Input

class CompileResourceTask extends NativeCompileTask {
List<String> rcParams = new ArrayList<String>();
String compiler;
@Input List<String> rcParams = new ArrayList<String>();
@Input String compiler;

protected File outputFile(File sourceFile) {
final String outFileName = sourceFile.getName().substring(0, sourceFile.getName().lastIndexOf("."));
Expand Down
Loading

0 comments on commit 111bac4

Please sign in to comment.