Skip to content

Commit

Permalink
Update to JFX 21.0.2 (#104)
Browse files Browse the repository at this point in the history
* Monocle for JDK 8.0.372

* Enable GitHub actions

* Set JDK to 8.0.372

* Fix gradle build for JDK 8

* Fix gradle build for JDK 8

* Initial release script

* Initial bundle script

* Include gradle script to publish a pom

* Gradle build for Maven artifacts

* Gradle build for Maven artifacts

* Add engineer notes

* Update developer notes

* Start work on Monocle 11 build

* Fix build for Java 11

* Fix pom for Java 11

* Update to version 17.0.10

* Update gradle, script and configuration

* Fix build configuration

* Fix build configuration

* Update to JFX 21.0.2

* Update to JFX 21.0.2

* Update to JFX 21.0.2
  • Loading branch information
mvsoder authored Feb 16, 2024
1 parent c66c32b commit 29a2343
Show file tree
Hide file tree
Showing 77 changed files with 3,769 additions and 284 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/entry.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
---
name: TestFX 4 CI
name: Monocle CI

on:
workflow_dispatch:
pull_request:
branches:
- 'master'
push:
branches:
- 'master'

permissions:
actions: read
Expand All @@ -34,6 +30,6 @@ jobs:
uses: ./.github/workflows/build.yml
with:
os: ubuntu-22.04
jdk: 11
openjfx: 11
jdk: 21.0.2
openjfx: 21
secrets: inherit
143 changes: 74 additions & 69 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,113 +1,118 @@
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}

dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
classpath 'org.openjfx:javafx-plugin:0.0.7'
}
//buildscript {
// repositories {
// mavenCentral()
// maven {
// url "https://plugins.gradle.org/m2/"
// }
// }
//}

plugins {
id "java"
id "maven-publish"
}

apply plugin: 'org.openjfx.javafxplugin'

// print welcome message.
apply from: rootProject.file("gradle/welcome.gradle")
//apply from: rootProject.file("gradle/welcome.gradle")
//
//wrapper {
// gradleVersion = '6.5.1'
// distributionUrl = "https://services.gradle.org/distributions/" +
// "gradle-${gradleVersion}-bin.zip"
//}
//
//// task to print gradle and groovy versions.
//task("versions", group: "help").doLast {
// println "Java version: ${System.properties["java.version"]}"
// println "Gradle version: ${gradle.gradleVersion}"
// println "Groovy version: ${GroovySystem.version}"
//}
//
//// task to create main and test source directories.
//task("initSourceDirs", group: "build setup").doLast {
// // ignore source directories for projects without source sets.
// if (!project.hasProperty("sourceSets")) { return }
//
// // list all source directories.
// def sourceSets = project.sourceSets as SourceSetContainer
// def sourceDirs = sourceSets*.allSource.srcDirs.flatten() as List<File>
//
// // create source directories, for those who not exists.
// for (sourceDir in sourceDirs) { sourceDir.mkdirs() }
//}

wrapper {
gradleVersion = '5.4.1'
distributionUrl = "https://services.gradle.org/distributions/" +
"gradle-${gradleVersion}-bin.zip"
repositories {
mavenCentral()
}

// task to print gradle and groovy versions.
task("versions", group: "help").doLast {
println "Java version: ${System.properties["java.version"]}"
println "Gradle version: ${gradle.gradleVersion}"
println "Groovy version: ${GroovySystem.version}"
static def getOSName() {
final String osName = System.getProperty("os.name").toLowerCase()
if (osName.contains("linux")) {
return ("linux")
} else if (osName.contains("mac os x") || osName.contains("darwin") || osName.contains("osx")) {
return ("mac")
} else if (osName.contains("windows")) {
return ("win")
}
return ""
}

// task to create main and test source directories.
task("initSourceDirs", group: "build setup").doLast {
// ignore source directories for projects without source sets.
if (!project.hasProperty("sourceSets")) { return }

// list all source directories.
def sourceSets = project.sourceSets as SourceSetContainer
def sourceDirs = sourceSets*.allSource.srcDirs.flatten() as List<File>
ext {
def buildTimeAndDate = new Date()
buildDate = buildTimeAndDate.format("yyyy-MM-dd")
buildTime = buildTimeAndDate.format("HH:mm:ss.SSSZ")

// create source directories, for those who not exists.
for (sourceDir in sourceDirs) { sourceDir.mkdirs() }
javaVersion = System.properties["java.version"]
javaVendor = System.properties["java.vendor"]
javaVmVersion = System.properties["java.vm.version"]
platform = getOSName()
}

// provide java tasks.
apply plugin: "java"

repositories {
jcenter()
}
// java language level.
sourceCompatibility = "21"
targetCompatibility = "21"

javafx {
modules = [ 'javafx.controls', 'javafx.graphics' ]
version = '12.0.1'
dependencies {
implementation "org.openjfx:javafx-base:21.0.2:${platform}"
implementation "org.openjfx:javafx-graphics:21.0.2:${platform}"
}

// java language level.
sourceCompatibility = "9"
targetCompatibility = "9"

// configure publish tasks.
apply from: rootProject.file("gradle/publish-bintray.gradle")
apply from: rootProject.file("gradle/publish-pom.gradle")

// task to create jar with source code.
task("sourceJar", type: Jar) {
group "Build"
description "An archive of the source code"
classifier "sources"
group = "Build"
description = "An archive of the source code"
archiveClassifier = "sources"
from sourceSets.main.allJava
}

// task to create jar with javadocs.
task("javadocJar", type: Jar) {
group "Build"
description "An archive of the javadoc"
classifier "javadoc"
group = "Build"
description = "An archive of the javadoc"
archiveClassifier = "javadoc"
from javadoc
}

jar.finalizedBy generatePomFileForMavenPublication
jar.finalizedBy sourceJar
jar.finalizedBy javadocJar

artifacts {
archives jar
archives sourceJar
archives javadocJar
generatePomFileForMavenPublication
}

compileJava {
javadoc {
options.addStringOption("Xdoclint:none", "-quiet")
options.addMultilineStringsOption('-add-exports').setValue(['javafx.graphics/com.sun.glass.ui=ALL-UNNAMED',
'javafx.graphics/com.sun.glass.events=ALL-UNNAMED',
'javafx.graphics/com.sun.glass.ui.delegate=ALL-UNNAMED',
'javafx.graphics/com.sun.glass.utils=ALL-UNNAMED',
'javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED',])
}
}

ext {
def buildTimeAndDate = new Date()
buildDate = buildTimeAndDate.format("yyyy-MM-dd")
buildTime = buildTimeAndDate.format("HH:mm:ss.SSSZ")

javaVersion = System.properties["java.version"]
javaVendor = System.properties["java.vendor"]
javaVmVersion = System.properties["java.vm.version"]
}

jar {
manifest.attributes(
"Created-By": project.javaVersion +
Expand Down
8 changes: 6 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
group = org.testfx
version = jdk-12.0.1+2
artifact = monocle
version = 21.0.2

description = Headless graphics driver for JavaFX.
description = Headless graphics driver for JavaFX
vendor = The OpenJDK Community

pomName = OpenJFX Monocle
pomDependencyVersion = 21.0.2

url = https://github.com/TestFX/Monocle
sourceUrl = https://github.com/TestFX/Monocle
issuesUrl = https://github.com/TestFX/Monocle/issues
Expand Down
72 changes: 72 additions & 0 deletions gradle/publish-pom.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Copyright 2013-2014 SmartBear Software
* Copyright 2014-2023 The TestFX Contributors
*
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved by the
* European Commission - subsequent versions of the EUPL (the "Licence"); You may
* not use this work except in compliance with the Licence.
*
* You may obtain a copy of the Licence at:
* http://ec.europa.eu/idabc/eupl
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the Licence for the
* specific language governing permissions and limitations under the Licence.
*/

publishing {
publications {
maven(MavenPublication) {
pom {
name = "${project.pomName}"
description = "${project.description}"
url = "https://openjfx.io/"

licenses {
license {
name = "GNU General Public License, version 2, with the Classpath Exception"
url = "https://github.com/TestFX/Monocle/blob/main/LICENSE"
distribution = "repo"
}
}

scm {
url = "https://github.com/TestFX/Monocle"
}

developers {
developer {
name = "The OpenJDK Community"
}
}

withXml {
asNode().appendNode('dependencies')
.appendNode('dependency')
.appendNode('groupId', 'org.openjfx')
.parent()
.appendNode('artifactId', 'javafx-base')
.parent()
.appendNode('version', "${project.pomDependencyVersion}")
.parent()
.appendNode('scope', 'provided')
.parent()
.parent()
.appendNode('dependency')
.appendNode('groupId', 'org.openjfx')
.parent()
.appendNode('artifactId', 'javafx-graphics')
.parent()
.appendNode('version', "${project.pomDependencyVersion}")
.parent()
.appendNode('scope', 'provided')
}
}
}
}
}

tasks.named("generatePomFileForMavenPublication") {
destination = "$buildDir/libs/${project.name}-${project.version}.pom"
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 29a2343

Please sign in to comment.