Skip to content

Commit d5a747f

Browse files
committed
Java 21, build cleanup
- Minimum macOS now 11/Big Sur
1 parent d385dc3 commit d5a747f

36 files changed

+44
-836
lines changed

.gitattributes

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Declare files that will always have CRLF line endings on checkout.
2-
gpl-3.0.txt text eol=lf
3-
LICENSE_windows.txt text eol=crlf
4-
libraries_used.txt text eol=lf
5-
libraries_used_windows.txt text eol=crlf
2+
/dist/windows/files/LICENSE text eol=crlf
3+
/libraries_used.txt text eol=lf
4+
/dist/windows/files/libraries_used.txt text eol=crlf
65
gradlew.bat text eol=crlf
76
gradlew text eol=lf
87

98
# Tell GitHub’s linguist which files to ignore
10-
gradle/InnoSetup6/* linguist-vendored
119
gradlew linguist-vendored
1210
gradlew.bat linguist-vendored

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up JDK
1616
uses: actions/setup-java@v3
1717
with:
18-
java-version: '20'
18+
java-version: '21'
1919
distribution: 'zulu'
2020
- name: Install Linux dependencies
2121
run: sudo apt-get install libplist-dev libimobiledevice-dev libirecovery-1.0-dev
@@ -24,6 +24,7 @@ jobs:
2424
uses: gradle/gradle-build-action@v2
2525
with:
2626
arguments: build --no-daemon --scan
27+
dependency-graph: generate-and-submit
2728
- uses: initdc/upload-artifact@feat/artifact-per-file
2829
with:
2930
artifact-per-file: true

.idea/compiler.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Main__Linux_.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Main__Windows_.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Main__macOS_.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ bugs/problems or have a feature request.
2929

3030
## Built With
3131

32-
- JDK 20
32+
- JDK 21
3333
- [IntelliJ Idea](https://www.jetbrains.com/idea/)
3434
- [Gradle](https://gradle.org/)
3535
- [JLink Plugin](https://github.com/beryx/badass-jlink-plugin)

build.gradle

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
2121

2222
plugins {
2323
id 'application'
24-
id 'com.github.ben-manes.versions' version '0.46.0'
25-
id 'org.beryx.jlink' version '2.26.0'
24+
id 'com.github.ben-manes.versions' version '0.48.0'
25+
id 'org.beryx.jlink' version '3.0.0'
2626
id 'org.openjfx.javafxplugin' version '0.1.0'
27-
id 'org.javamodularity.moduleplugin' version '1.8.12'
2827

2928
id 'idea'
3029
}
@@ -37,11 +36,11 @@ version = '3.5.2'
3736
description = 'A cross-platform GUI and CLI app for saving SHSH blobs'
3837
String appIdentifier = 'airsquared.blobsaver.app'
3938
String copyright = 'Copyright (c) 2023 airsquared'
40-
def os = DefaultNativePlatform.currentOperatingSystem
39+
var os = DefaultNativePlatform.currentOperatingSystem
4140

4241
startScripts.enabled = distZip.enabled = distTar.enabled = false
4342

44-
java.toolchain.languageVersion = JavaLanguageVersion.of(20)
43+
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
4544

4645
repositories {
4746
mavenCentral()
@@ -57,43 +56,42 @@ dependencies {
5756
implementation 'info.picocli:picocli:4.7.5'
5857

5958
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0'
59+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
6060
testImplementation 'org.testfx:openjfx-monocle:jdk-12.0.1+2'
6161
}
6262

6363
javafx {
64-
version = '20'
64+
version = '21'
6565
modules = [ 'javafx.controls', 'javafx.fxml' ]
6666
}
6767

68-
def addExports = ['--add-exports=javafx.graphics/com.sun.javafx.css=airsquared.blobsaver', '--add-exports=java.base/jdk.internal.misc=airsquared.blobsaver']
68+
var addExports = '--add-exports=javafx.graphics/com.sun.javafx.css=airsquared.blobsaver'
6969

7070
compileJava {
71-
options.compilerArgs.addAll addExports
71+
options.compilerArgs.add addExports
7272
}
7373

7474
application {
7575
mainModule = 'airsquared.blobsaver'
7676
mainClass = 'airsquared.blobsaver.app.Main'
77-
applicationDefaultJvmArgs.addAll addExports
77+
applicationDefaultJvmArgs.add addExports
7878
}
7979

8080
private String getJarDirectory() {
81-
String dir = ''
81+
var dir = ''
8282
if (DefaultNativePlatform.currentOperatingSystem.isMacOsX()) dir = 'macos/Contents'
8383
else if (DefaultNativePlatform.currentOperatingSystem.isWindows()) dir = 'windows/files'
8484
else if (DefaultNativePlatform.currentOperatingSystem.isLinux()) dir = 'linux'
8585
return "${projectDir}/dist/${dir}"
8686
}
8787

8888
run {
89-
systemProperty 'jar.directory', getJarDirectory()
89+
systemProperty 'jar.directory', jarDirectory
9090
}
9191

9292
test {
9393
useJUnitPlatform()
94-
systemProperty 'jar.directory', getJarDirectory()
95-
jvmArgs addExports
96-
jvmArgs '--add-exports=javafx.graphics/com.sun.glass.ui=org.testfx.monocle'
94+
systemProperty 'jar.directory', jarDirectory
9795
}
9896

9997
jlink {
@@ -102,8 +100,7 @@ jlink {
102100
'--dedup-legal-notices=error-if-not-same-content'
103101
}
104102
launcher {
105-
jvmArgs = [ '-Djar.directory={{BIN_DIR}}' ]
106-
jvmArgs.addAll addExports
103+
jvmArgs = [ '-Djar.directory={{BIN_DIR}}', addExports ]
107104
if (findProperty('noConsole') != 'false') {
108105
noConsole = true
109106
}
@@ -116,48 +113,36 @@ jlink {
116113

117114
if (os.isMacOsX()) {
118115
installerType = 'dmg'
119-
String arch = DefaultNativePlatform.currentArchitecture.amd64 ? 'intel' : 'arm'
116+
var arch = DefaultNativePlatform.currentArchitecture.amd64 ? 'intel' : 'arm'
120117
installerName = "${name}-${arch}"
121-
imageOptions.addAll '--mac-package-identifier', appIdentifier
118+
//noinspection GroovyAssignabilityCheck
119+
imageOptions.addAll '--mac-package-identifier', appIdentifier,
120+
'--app-content', "${projectDir}/dist/macos/Contents/Frameworks," +
121+
"${projectDir}/dist/macos/Contents/MacOS"
122122
icon = "${projectDir}/dist/macos/Contents/Resources/blob.icns"
123123
} else if (os.isWindows()) {
124124
installerOptions.addAll '--win-dir-chooser', '--win-menu', '--win-shortcut'
125125
icon = "${projectDir}/dist/windows/blob.ico"
126+
imageOptions.addAll '--app-content', fileTree("${projectDir}/dist/windows/files").join(',')
126127
} else {
127128
installerOptions.addAll '--linux-shortcut', '--linux-menu-group', 'Utility;Archiving;Java',
128129
'--linux-rpm-license-type', 'GPLv3'
129-
icon = "${projectDir}/src/main/resources/airsquared/blobsaver/app/blob_emoji.png"
130+
icon = "${projectDir}/src/main/resources/airsquared/blobsaver/app/blob.png"
131+
imageOptions.addAll '--app-content', fileTree("${projectDir}/dist/linux").join(',') + ',' +
132+
"${projectDir}/LICENSE,${projectDir}/libraries_used.txt"
130133
}
131134
if (findProperty('installerType') != null) {
132135
installerType = findProperty('installerType')
133136
}
134137
}
135138
if (os.isMacOsX()) jpackageImage.doLast {
136-
copy {
137-
from "${projectDir}/dist/macos/Contents/MacOS" into layout.buildDirectory.dir('jpackage/blobsaver.app/Contents/MacOS')
138-
}
139-
copy {
140-
from "${projectDir}/dist/macos/Contents/Frameworks" into layout.buildDirectory.dir('jpackage/blobsaver.app/Contents/Frameworks')
141-
}
142139
copy {
143140
from "${projectDir}/LICENSE", "${projectDir}/libraries_used.txt"
144141
into layout.buildDirectory.dir('jpackage/blobsaver.app/Contents/Resources')
145142
}
146143
exec { // needed to prevent "application is damaged" error when opening quarantined app
147144
commandLine 'codesign', '--force', '--deep', '--sign', '-', "${layout.buildDirectory.get()}/jpackage/blobsaver.app"
148145
}
149-
} else if (os.isWindows()) jpackageImage.doLast {
150-
copy {
151-
from "${projectDir}/dist/windows/files", layout.buildDirectory.dir('jpackage/blobsaver/runtime/bin/zip.dll')
152-
rename 'LICENSE_windows', 'LICENSE'
153-
rename 'libraries_used_windows.txt', 'libraries_used.txt'
154-
into layout.buildDirectory.dir('jpackage/blobsaver')
155-
}
156-
} else jpackageImage.doLast {
157-
copy {
158-
from "${projectDir}/dist/linux", "${projectDir}/LICENSE", "${projectDir}/libraries_used.txt"
159-
into layout.buildDirectory.dir('jpackage/blobsaver/lib')
160-
}
161146
}
162147
}
163148

File renamed without changes.

0 commit comments

Comments
 (0)