-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
200 lines (175 loc) · 6.89 KB
/
build.gradle.kts
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
import groovy.lang.Closure
import io.github.fvarrui.javapackager.gradle.PackageTask
import io.github.fvarrui.javapackager.model.MacConfig
import io.github.fvarrui.javapackager.model.MacStartup
import io.github.fvarrui.javapackager.model.SetupMode
import io.github.fvarrui.javapackager.model.WindowsConfig
import io.github.fvarrui.javapackager.model.Manifest
import org.gradle.internal.os.OperatingSystem
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("io.github.fvarrui:javapackager:1.7.2")
}
}
plugins {
kotlin("jvm") version "1.9.23"
id("org.openjfx.javafxplugin") version "0.1.0"
id("application")
}
apply(plugin = "io.github.fvarrui.javapackager.plugin")
val kotlinCoroutinesVersion = "1.8.1"
val tornadoFxVersion = "2.0.0-SNAPSHOT"
val log4jVersion = "2.23.1"
val slf4jVersion = "2.0.13"
val kotlinLoggingVersion = "3.0.5"
val testFxVersion = "4.0.18"
val junitVersion = "5.10.2"
val vlcjVersion = "4.8.2"
val humbleVersion = "0.3.0"
val flywayVersion = "10.14.0"
val controlsFxVersion = "11.2.1"
val defaultAppJvmArgs = listOf(
// Tornadofx
"--add-opens=javafx.controls/javafx.scene.control.skin=ALL-UNNAMED",
"--add-opens=javafx.graphics/javafx.scene=ALL-UNNAMED",
"--add-opens=javafx.controls/javafx.scene.control=ALL-UNNAMED",
// necessary for ControlsFX
"--add-opens=javafx.base/com.sun.javafx.event=ALL-UNNAMED",
"--add-opens=javafx.base/com.sun.javafx.collections=ALL-UNNAMED",
"--add-opens=javafx.base/com.sun.javafx.runtime=ALL-UNNAMED",
"--add-opens=javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED",
"--add-opens=javafx.graphics/com.sun.javafx.scene.traversal=ALL-UNNAMED",
"--add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED"
)
version = "0.19.2"
val appVersion: String = version as String
allprojects {
apply(plugin = "kotlin")
repositories {
mavenCentral()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}
dependencies {
// Align versions of all Kotlin components
implementation(platform(kotlin("bom")))
// Use the Kotlin JDK 8 standard library.
implementation(kotlin("stdlib"))
implementation("io.github.microutils:kotlin-logging-jvm:$kotlinLoggingVersion")
implementation("org.slf4j:slf4j-api:$slf4jVersion")
implementation("org.apache.logging.log4j:log4j-slf4j2-impl:$log4jVersion")
implementation("org.apache.logging.log4j:log4j-api:$log4jVersion")
implementation("org.apache.logging.log4j:log4j-core:$log4jVersion")
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(21))
vendor.set(JvmVendorSpec.ADOPTIUM)
}
}
}
tasks.withType<Test> {
useJUnitPlatform()
jvmArgs = defaultAppJvmArgs
}
dependencies {
implementation(project(":api-client"))
implementation("no.tornado:tornadofx:$tornadoFxVersion")
implementation("org.controlsfx:controlsfx:$controlsFxVersion")
implementation("no.tornado:tornadofx-controlsfx:0.1.1")
implementation("org.pdfsam.rxjava3:rxjavafx:3.0.3")
implementation("org.xerial:sqlite-jdbc:3.46.0.0")
implementation("de.jangassen:nsmenufx:3.1.0")
implementation("org.flywaydb:flyway-core:$flywayVersion")
implementation("com.github.davidmoten:rxjava3-jdbc:0.1.4") {
exclude("com.google.code.findbugs", "jsr305")
exclude("com.google.code.findbugs", "annotations")
exclude("net.jcip", "jcip-annotations")
}
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-javafx:$kotlinCoroutinesVersion")
// Players
val os = OperatingSystem.current()
implementation("io.humble:humble-video-noarch:$humbleVersion")
if (os.isMacOsX) {
implementation("io.humble:humble-video-arch-x86_64-apple-darwin18:$humbleVersion")
} else if (os.isWindows) {
implementation("io.humble:humble-video-arch-x86_64-w64-mingw32:$humbleVersion")
implementation("io.humble:humble-video-arch-i686-w64-mingw32:$humbleVersion")
} else if (os.isLinux) {
implementation("io.humble:humble-video-arch-i686-pc-linux-gnu6:$humbleVersion")
implementation("io.humble:humble-video-arch-x86_64-pc-linux-gnu6:$humbleVersion")
}
implementation("uk.co.caprica:vlcj:$vlcjVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testImplementation("org.testfx:testfx-core:$testFxVersion")
testImplementation("org.testfx:testfx-junit5:$testFxVersion")
testImplementation("org.hamcrest:hamcrest:2.2")
}
configurations {
all {
exclude(group = "net.java.dev.jna", module = "jna")
exclude(group = "net.java.dev.jna", module = "jna-platform")
exclude(group = "org.openjfx", module = "javafx-web")
exclude(group = "org.openjfx", module = "javafx-swing")
exclude(group = "org.openjfx", module = "javafx-fxml")
}
}
javafx {
version = "21.0.2"
modules = mutableListOf("javafx.base", "javafx.graphics", "javafx.controls", "javafx.media")
}
application {
mainClass.set("online.hudacek.fxradio.FxRadioKt")
applicationDefaultJvmArgs = defaultAppJvmArgs
}
task<PackageTask>("jfxNative") {
val outputDir = project.layout.buildDirectory.dir("jfx/native")
mainClass = "online.hudacek.fxradio.FxRadioKt"
appName = "FXRadio"
appDescription = "Internet Radio Directory"
assetsDir = File("${project.rootDir}/src/main/deploy/package")
outputDirectory = outputDir.get().asFile
displayName = "FXRadio"
version = appVersion
url = "https://hudacek.online/fxradio"
isCustomizedJre = false
organizationName = "FXRadio"
organizationUrl = "https://hudacek.online/fxradio"
organizationEmail = "[email protected]"
isCreateZipball = true
manifest(closureOf<Manifest> {
additionalEntries = mapOf(
"Implementation-Version" to appVersion
)
} as Closure<Manifest>)
macConfig(closureOf<MacConfig> {
macStartup = MacStartup.UNIVERSAL
isGeneratePkg = false
isCodesignApp = false
backgroundImage = File("src/main/deploy/package/mac/background.png")
} as Closure<MacConfig>)
winConfig(closureOf<WindowsConfig> {
isGenerateSetup = false
isGenerateMsi = true
setupMode = SetupMode.askTheUser
productVersion = appVersion
fileVersion = appVersion
isDisableDirPage = false
isDisableProgramGroupPage = false
isDisableWelcomePage = false
isDisableFinishedPage = false
isDisableRunAfterInstall = false
isRemoveOldLibs = true
} as Closure<WindowsConfig>)
dependsOn("jar")
vmArgs = listOf(
"-Xms256m",
"-Xmx1500m",
"-XX:+UnlockExperimentalVMOptions",
"-XX:+UseG1GC"
)
}