mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-05-24 10:52:00 +00:00
updated jpackage for x86_64 distributions
This commit is contained in:
parent
3f0e878694
commit
2b096e661c
79
build.gradle
79
build.gradle
@ -13,6 +13,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
import com.github.jk1.license.render.*
|
import com.github.jk1.license.render.*
|
||||||
|
import java.nio.file.Files
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
springBootVersion = "3.4.4"
|
springBootVersion = "3.4.4"
|
||||||
@ -22,6 +23,7 @@ ext {
|
|||||||
bouncycastleVersion = "1.80"
|
bouncycastleVersion = "1.80"
|
||||||
springSecuritySamlVersion = "6.4.4"
|
springSecuritySamlVersion = "6.4.4"
|
||||||
openSamlVersion = "4.3.2"
|
openSamlVersion = "4.3.2"
|
||||||
|
tempJrePath = null // shared variable between tasks
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "stirling.software"
|
group = "stirling.software"
|
||||||
@ -109,6 +111,8 @@ def getMacVersion(String version) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jpackage {
|
jpackage {
|
||||||
|
dependsOn("downloadTempJre")
|
||||||
|
|
||||||
input = "build/libs"
|
input = "build/libs"
|
||||||
destination = "${projectDir}/build/jpackage"
|
destination = "${projectDir}/build/jpackage"
|
||||||
mainJar = "Stirling-PDF-${project.version}.jar"
|
mainJar = "Stirling-PDF-${project.version}.jar"
|
||||||
@ -160,7 +164,7 @@ jpackage {
|
|||||||
icon = "src/main/resources/static/favicon.icns"
|
icon = "src/main/resources/static/favicon.icns"
|
||||||
type = "dmg"
|
type = "dmg"
|
||||||
macPackageIdentifier = "com.stirling.software.pdf"
|
macPackageIdentifier = "com.stirling.software.pdf"
|
||||||
macPackageName = "Stirling-PDF"
|
macPackageName = "Stirling-PDF_aarch64"
|
||||||
macAppCategory = "public.app-category.productivity"
|
macAppCategory = "public.app-category.productivity"
|
||||||
macSign = false // Enable signing
|
macSign = false // Enable signing
|
||||||
macAppStore = false // Not targeting App Store initially
|
macAppStore = false // Not targeting App Store initially
|
||||||
@ -178,6 +182,38 @@ jpackage {
|
|||||||
//macEntitlements = "entitlements.plist" // You'll need to create this file
|
//macEntitlements = "entitlements.plist" // You'll need to create this file
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
def jrePath = project.ext.tempJrePath
|
||||||
|
|
||||||
|
if (!jrePath) {
|
||||||
|
throw new GradleException("JRE path not found. Did 'downloadTempJre' run?")
|
||||||
|
}
|
||||||
|
|
||||||
|
mac {
|
||||||
|
appVersion = getMacVersion(project.version.toString())
|
||||||
|
runtimeImage = file(jrePath)
|
||||||
|
icon = "src/main/resources/static/favicon.icns"
|
||||||
|
type = "dmg"
|
||||||
|
macPackageIdentifier = "com.stirling.software.pdf"
|
||||||
|
macPackageName = "Stirling-PDF_x86_64"
|
||||||
|
macAppCategory = "public.app-category.productivity"
|
||||||
|
macSign = false // Enable signing
|
||||||
|
macAppStore = false // Not targeting App Store initially
|
||||||
|
|
||||||
|
//installDir = "Applications"
|
||||||
|
|
||||||
|
// Add license and other documentation to DMG
|
||||||
|
/*macDmgContent = [
|
||||||
|
"README.md",
|
||||||
|
"LICENSE",
|
||||||
|
"CHANGELOG.md"
|
||||||
|
]*/
|
||||||
|
|
||||||
|
// Enable Mac-specific entitlements
|
||||||
|
//macEntitlements = "entitlements.plist" // You'll need to create this file
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Linux-specific configuration
|
// Linux-specific configuration
|
||||||
linux {
|
linux {
|
||||||
appVersion = project.version
|
appVersion = project.version
|
||||||
@ -221,6 +257,47 @@ jpackage {
|
|||||||
licenseFile = "LICENSE"
|
licenseFile = "LICENSE"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register('downloadTempJre') {
|
||||||
|
group = 'distribution'
|
||||||
|
description = 'Downloads and extracts a temporary JRE'
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
def jreUrl = 'https://cdn.azul.com/zulu/bin/zulu17.56.15-ca-jre17.0.14-macosx_x64.tar.gz'
|
||||||
|
def tmpDir = Files.createTempDirectory('zulu-jre').toFile()
|
||||||
|
def jreArchive = new File(tmpDir, 'jre.tar.gz')
|
||||||
|
def jreDir = new File(tmpDir, 'jre')
|
||||||
|
|
||||||
|
println "🔽 Downloading JRE to $jreArchive..."
|
||||||
|
jreArchive.withOutputStream { out ->
|
||||||
|
new URL(jreUrl).withInputStream { from -> out << from }
|
||||||
|
}
|
||||||
|
|
||||||
|
println "📦 Extracting JRE to $jreDir..."
|
||||||
|
jreDir.mkdirs()
|
||||||
|
providers.exec {
|
||||||
|
commandLine 'tar', '-xzf', jreArchive.absolutePath, '-C', jreDir.absolutePath, '--strip-components=1'
|
||||||
|
}.result.get()
|
||||||
|
|
||||||
|
println "✅ JRE ready at: $jreDir"
|
||||||
|
ext.tempJrePath = jreDir.absolutePath
|
||||||
|
project.ext.tempJrePath = jreDir.absolutePath // store globally for next task
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register('cleanTempJre') {
|
||||||
|
dependsOn(jpackage)
|
||||||
|
group = 'distribution'
|
||||||
|
description = 'Deletes the downloaded temporary JRE'
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
def path = project.ext.tempJrePath
|
||||||
|
if (path && new File(path).exists()) {
|
||||||
|
println "🧹 Cleaning up temporary JRE: $path"
|
||||||
|
new File(path).parentFile.deleteDir()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
launch4j {
|
launch4j {
|
||||||
icon = "${projectDir}/src/main/resources/static/favicon.ico"
|
icon = "${projectDir}/src/main/resources/static/favicon.ico"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user