-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
152 lines (137 loc) · 5.13 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
plugins {
id 'java'
id 'idea'
id 'eclipse'
id 'application'
id 'org.beryx.jlink' version '3.0.1'
id 'org.openjfx.javafxplugin' version '0.1.0'
}
group 'com.codedead'
version '1.4.0'
def currentOS = DefaultNativePlatform.currentOperatingSystem
java {
targetCompatibility = JavaVersion.VERSION_22
sourceCompatibility = JavaVersion.VERSION_22
}
application {
mainModule = 'Opal'
mainClass = 'com.codedead.opal.OpalApplication'
}
javafx {
version = '22.0.1'
configuration = 'implementation'
modules = ['javafx.base', 'javafx.controls', 'javafx.fxml', 'javafx.media']
}
jlink {
options = ['--strip-debug', '--compress', 'zip-9', '--no-header-files', '--no-man-pages']
forceMerge('log4j-api', 'jackson')
launcher {
name = 'Opal'
}
mergedModule {
additive = true
uses 'org.apache.logging.log4j.util.PropertySource'
uses 'org.apache.logging.log4j.spi.Provider'
uses 'org.apache.logging.log4j.message.ThreadDumpMessage.ThreadInfoFactory'
}
if (currentOS.isWindows()) {
jpackage {
installerType = 'msi'
icon = "${project.rootDir}/.msi/opal.ico"
installerOptions = [
'--win-menu',
'--win-menu-group', 'CodeDead',
'--win-shortcut-prompt',
'--win-upgrade-uuid', '876c5464-9a66-4913-89a4-c63a4b8b4bb9',
'--win-help-url', 'https://codedead.com/contact',
'--win-dir-chooser',
'--copyright', 'Copyright (c) 2024 CodeDead',
'--description', 'Opal is a free and open-source JavaFX application that can play relaxing music in the background',
'--vendor', 'CodeDead',
'--license-file', 'LICENSE',
'--app-version', "${project.version.toString()}",
'--about-url', 'https://codedead.com'
]
}
} else if (currentOS.isLinux()) {
jpackage {
installerType = 'rpm'
icon = "${project.rootDir}/src/main/resources/images/opal.png"
installerOptions = [
'--linux-shortcut',
'--linux-package-name', 'opal-codedead',
'--linux-rpm-license-type', 'GPLv3',
'--copyright', 'Copyright (c) 2024 CodeDead',
'--description', 'Opal is a free and open-source JavaFX application that can play relaxing music in the background',
'--vendor', 'CodeDead',
'--license-file', 'LICENSE',
'--app-version', "${project.version.toString()}",
'--about-url', 'https://codedead.com'
]
}
} else if (currentOS.isMacOsX()) {
jpackage {
installerType = 'dmg'
icon = "${project.rootDir}/src/main/resources/images/opal.png"
installerOptions = [
'--mac-package-name', 'Opal',
'--mac-package-identifier', 'com.codedead.opal',
'--mac-app-category', 'public.app-category.music',
'--copyright', 'Copyright (c) 2024 CodeDead',
'--description', 'Opal is a free and open-source JavaFX application that can play relaxing music in the background',
'--vendor', 'CodeDead',
'--license-file', 'LICENSE',
'--app-version', "${project.version.toString()}",
'--about-url', 'https://codedead.com'
]
}
}
}
tasks.register('AppImage') {
dependsOn jpackageImage
doLast {
copy {
from '.AppImage/.AppDir'
into layout.buildDirectory.dir("AppImage/Opal.AppDir")
}
copy {
from layout.buildDirectory.dir("jpackage/Opal/")
into layout.buildDirectory.dir("AppImage/Opal.AppDir/usr/")
}
copy {
from '.AppImage/.AppDir/Opal.png'
into layout.buildDirectory.dir("AppImage/Opal.AppDir/usr/lib")
}
exec {
commandLine 'sh', "${project.rootDir}/.AppImage/createAppImage.sh", "${project.version.toString()}"
}
delete layout.buildDirectory.dir("AppImage/Opal.AppDir")
}
}
configure(AppImage) {
group = 'build'
description = 'Create an AppImage after creating the image of the application'
}
def homeConfig = System.properties['user.home'] + '/.config/com.codedead.opal'
clean.doFirst {
delete 'default.properties'
delete 'license.pdf'
delete 'help.pdf'
delete 'logs'
delete '.com.codedead.opal'
delete "$homeConfig"
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.apache.logging.log4j:log4j-core:2.23.1'
implementation 'io.github.mkpaz:atlantafx-base:2.0.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3'
}
tasks.named('test') {
useJUnitPlatform()
}