-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #218 from alkum/jpackager
Add initial version of building binary
- Loading branch information
Showing
3 changed files
with
124 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ plugins { | |
id 'application' | ||
/* id 'distribution'*/ //todo as long we dont need a jar we leave that out, speeds up build | ||
alias(libs.plugins.openjfx) | ||
alias(libs.plugins.jpackage) | ||
alias(libs.plugins.shadow) | ||
} | ||
|
||
apply from: '../buildSrc/bisq-version.gradle' | ||
|
@@ -76,3 +78,101 @@ dependencies { | |
implementation 'org.fxmisc.richtext:richtextfx:0.10.9' | ||
|
||
} | ||
|
||
distZip.enabled = false | ||
distTar.enabled = false | ||
shadowDistZip.enabled = false | ||
shadowDistTar.enabled = false | ||
|
||
tasks.jpackage { | ||
dependsOn rootProject.clean | ||
dependsOn tasks.clean // Ensure fresh buildDir for every jpackager binary build | ||
dependsOn tasks.jar, tasks.shadowJar | ||
|
||
// The jpackageTempDir stores temp files used by jpackage for building the installers | ||
// It can be inspected in order to troubleshoot the packaging process | ||
File jpackageTempDir = new File(buildDir, "jpackage-temp") | ||
|
||
appName = "Bisq 2" | ||
// Remove the -SNAPSHOT suffix from the version string (originally defined in build.gradle) | ||
// Having it in would have resulted in an invalid version property for several platforms (mac, linux/rpm) | ||
appVersion = version.replaceAll("-SNAPSHOT", "") | ||
copyright = 'Copyright (c) 2013-2022 The Bisq developers' | ||
appDescription = 'A decentralized bitcoin exchange network.' | ||
vendor = 'Bisq' | ||
mainClass = "bisq.desktopapp.Main" | ||
mainJar = jar.archiveFileName.get() | ||
verbose = false | ||
// arguments = --arguments <main class arguments> | ||
destination = "$buildDir/$distsDirName" | ||
input = "$buildDir/$libsDirName" | ||
licenseFile = "../LICENSE" | ||
// resourceDir = --resource-dir <resource dir path> // TODO | ||
runtimeImage = System.getProperty("java.home") | ||
temp = jpackageTempDir | ||
// launchers = --add-launcher <name>=<property file> // TODO add multiple launchers? desktopapp / satoshiapp | ||
|
||
winMenu = true | ||
winDirChooser = true | ||
// winUpgradeUuid = win-upgrade-uuid <id string> // TODO | ||
// winMenuGroup = --win-menu-group <menu group name> // TODO | ||
winShortcut = true | ||
winPerUserInstall = true | ||
winConsole = false | ||
|
||
// macPackageIdentifier = --mac-package-identifier <ID string> // TODO | ||
// macPackageName = --mac-package-name <name string> // TODO | ||
// macPackageSigningPrefix = --mac-package-signing-prefix <prefix string> // TODO | ||
macSign = false | ||
// macSigningKeychain = --mac-signing-keychain <file path> // TODO | ||
// macSigningKeyUserName = --mac-signing-key-user-name <team name> // TODO | ||
|
||
linuxPackageName = 'bisq2' | ||
linuxDebMaintainer = '[email protected]' | ||
linuxMenuGroup = 'Network' | ||
linuxRpmLicenseType = 'AGPLv3' // https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses | ||
// This represents the linux package version (revision) | ||
// By convention, this is part of the deb/rpm package names, in addition to the software version | ||
linuxAppRelease = '1' | ||
// linuxAppCategory = --linux-app-category <category value> // TODO | ||
linuxShortcut = true | ||
|
||
mac { | ||
// Avoid error "The first number in an app-version cannot be zero or negative." | ||
appVersion = appVersion.startsWith('0') ? '1.0.0' : appVersion | ||
// icon = "icons/icons.icns" // TODO | ||
} | ||
|
||
linux { | ||
// Setting runtimeImage to java.home failed when using JDK from package manager (user vs root ownership of files?) | ||
// runtimeImage can alternatively be set to a downloaded and extracted JDK | ||
// Worked well when using IntelliJ IDEA SDKs (File > Project Structure > SDKs > + > Download JDK) | ||
runtimeImage = "/home/user/.jdks/openjdk-17.0.2" | ||
// icon = "icons/icons.ico" // TODO | ||
} | ||
|
||
additionalParameters = ['--verbose'] | ||
|
||
// TODO Choose sane defaults | ||
javaOptions = [ | ||
'-Dfile.encoding=UTF-8', | ||
'-Dbisq.application.appName=bisq_Alice', | ||
'-Dbisq.networkServiceConfig.supportedTransportTypes.0=CLEAR', | ||
'-Dbisq.networkServiceConfig.seedAddressByTransportType.clear.0=127.0.0.1:8000', | ||
'-Dbisq.networkServiceConfig.seedAddressByTransportType.clear.1=127.0.0.1:8001' | ||
] | ||
|
||
doFirst() { | ||
jpackageTempDir.mkdirs() | ||
} | ||
|
||
doLast() { | ||
File binariesFolderPath = new File("$buildDir/$distsDirName") | ||
ant.checksum(algorithm: 'SHA-256') { | ||
ant.fileset(dir: "${binariesFolderPath}") | ||
} | ||
println "The binaries and checksums are ready:" | ||
FileCollection collection = layout.files { binariesFolderPath.listFiles() } | ||
collection.collect { it.path }.sort().each { println it } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters