Skip to content

Commit

Permalink
Merge pull request #78 from carldea/feature/upgrade-gradle-8.4-jdk-21…
Browse files Browse the repository at this point in the history
….0.1-jfx-21.0.1

Upgraded to Gradle 8.4 JDK 21.0.1 & OpenJFX 21.0.1
  • Loading branch information
JonathanGiles authored Jan 16, 2024
2 parents e34de63 + a28968e commit 46d48dd
Show file tree
Hide file tree
Showing 11 changed files with 255 additions and 162 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
java: [11.0.15]
java: ['17.0.9', '21.0.1']
fail-fast: false
max-parallel: 4
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
Expand Down
11 changes: 6 additions & 5 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ For more information about JavaFX 11, see https://openjfx.io/openjfx-docs/.

### How to build

Install a valid Java 11 version, and set `JAVA_HOME` accordingly.
Install a valid Java 17+ version, and set `JAVA_HOME` accordingly.

The project is managed by gradle, so is not necessary to download the JavaFX 11 SDK.
The project is managed by gradle, so is not necessary to download the JavaFX 21.0.1 SDK.

To build the project, type:

Expand All @@ -54,7 +54,7 @@ You can also create a zipped version of that image for distribution:

Download the Scenic View custom image for your platform from the above links. Unzip and then run:

cd scenicview/bin
cd build/scenicview/bin
./scenicView

Also, you can clone or download this project, and run Scenic View as stand-alone application:
Expand All @@ -71,7 +71,7 @@ Then run a JavaFX application and it will be detected by Scenic View.
Alternatively, you can also run the `scenicview.jar` in any platform, providing that JDK 11 and JavaFX SDK 11 are installed:

cd build/libs/
java --module-path /path-to/javafx-11-sdk/lib --add-modules javafx.web,javafx.fxml,javafx.swing -jar scenicview.jar
java --module-path /path-to/javafx-21.0.1-sdk/lib --add-modules javafx.web,javafx.fxml,javafx.swing -jar scenicview.jar

##### Notes

Expand All @@ -90,7 +90,7 @@ For instance, if you are running a gradle project, add the jar to a `libs` folde

plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.7'
id 'org.openjfx.javafxplugin' version '0.1.0'
}

repositories {
Expand All @@ -102,6 +102,7 @@ For instance, if you are running a gradle project, add the jar to a `libs` folde
}

javafx {
version = '21.0.1'
modules = ['javafx.web', 'javafx.fxml', 'javafx.swing']
}

Expand Down
30 changes: 18 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.7'
id 'org.beryx.jlink' version '2.6.5'
id 'org.openjfx.javafxplugin' version '0.1.0'
id 'org.beryx.jlink' version '3.0.1'
}

mainClassName = "org.scenicview.scenicview/org.scenicview.ScenicView"
application {
mainModule = "org.scenicview.scenicview"
mainClass = "org.scenicview.ScenicView"
}
group = 'org.scenic-view'
version = '11.0.2'
version = '21.0.1'

defaultTasks 'install'

sourceCompatibility = '1.9'
targetCompatibility = '1.9'
java {
sourceCompatibility = '11'
targetCompatibility = '11'
}

repositories {
mavenCentral()
Expand All @@ -29,6 +34,7 @@ sourceSets {
}

javafx {
version = '21.0.1'
modules = ['javafx.web', 'javafx.fxml', 'javafx.swing']
}

Expand All @@ -41,7 +47,7 @@ jar {
'Automatic-Module-Name': 'org.scenicview.scenicview'
)
}
archiveName = 'scenicview.jar'
archiveFileName = 'scenicview.jar'
}

run {
Expand All @@ -55,18 +61,18 @@ artifacts {
ext.platform = osdetector.os == 'osx' ? 'mac' : osdetector.os == 'windows' ? 'win' : osdetector.os

jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
options = ['--strip-debug', '--no-header-files', '--no-man-pages']
launcher {
name = 'scenicView'
}
imageDir = file("${buildDir}/scenicview")
imageZip = file("${buildDir}/dist/scenicview-${platform}.zip")
imageDir = layout.buildDirectory.dir("scenicview")
imageZip = layout.buildDirectory.file("dist/scenicview-${platform}.zip")
}

tasks.jlink.doLast {
// Copy scenicView.jar to lib, it is required as loading Agent
copy {
from "${buildDir}/libs/scenicview.jar"
into "${buildDir}/scenicview/lib"
from layout.buildDirectory.file("libs/scenicview.jar")
into layout.buildDirectory.dir("scenicview/lib")
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 46d48dd

Please sign in to comment.