-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
122 lines (98 loc) · 3.04 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
@file:Suppress("UnstableApiUsage")
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.compose.desktop)
alias(libs.plugins.detekt)
}
group = "com.charlesmuchene.prefeditor"
version = "1.1.0"
kotlin {
jvmToolchain {
vendor = JvmVendorSpec.JETBRAINS
languageVersion = 17
}
}
java {
toolchain {
vendor = JvmVendorSpec.JETBRAINS
languageVersion = 17
}
}
dependencies {
// Publish dependency to maven
implementation(files("libs/DatastorePreferencesParser-1.0-SNAPSHOT.jar"))
implementation(compose.desktop.currentOs) {
exclude(group = "org.jetbrains.compose.material") // we're jeweling up! :D
}
implementation(libs.immutable.collections)
implementation(libs.jewel.deco.window)
implementation(libs.jewel.standalone)
implementation(libs.rebugger)
implementation(libs.logging)
implementation(libs.kxml2)
runtimeOnly(libs.sl4j)
detektPlugins(libs.detekt.compose)
testImplementation(libs.mockk)
testImplementation(libs.turbine)
testImplementation(libs.kotlin.test)
testImplementation(libs.coroutines.test)
}
tasks.test {
useJUnitPlatform()
}
compose.desktop {
application {
mainClass = "com.charlesmuchene.prefeditor.App"
jvmArgs("-Dorg.jetbrains.jewel.debug=false")
buildTypes.release.proguard {
isEnabled = false
configurationFiles.from(file(path = "prefeditor.pro"))
}
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "Preferences Editor"
description = "View/Edit preferences"
vendor = "Charles Muchene"
licenseFile = rootProject.file("LICENSE")
modules("jdk.unsupported")
macOS {
dockName = "Preferences Editor"
bundleID = "com.charlesmuchene.prefeditor"
iconFile = file(path = "icons/prefeditor.icns")
}
windows {
iconFile = file(path = "icons/prefeditor.ico")
}
linux {
iconFile = file(path = "icons/prefeditor.png")
}
}
}
}
tasks.withType<JavaExec> {
afterEvaluate {
javaLauncher =
project.javaToolchains.launcherFor {
vendor = JvmVendorSpec.JETBRAINS
languageVersion = 17
}
setExecutable(javaLauncher.map { it.executablePath.asFile.absoluteFile }.get())
}
}
@Suppress("unused")
fun Property<JavaLanguageVersion>.assign(version: Int) = set(JavaLanguageVersion.of(version))
detekt {
config.from(file(path = "detekt.yaml"))
buildUponDefaultConfig = true
}
val versionTheRelease by tasks.registering {
description = "Write version file to resources"
doLast {
file("src/main/resources/version")
.writeText(text = "v$version")
}
}
val jar by tasks.existing(Jar::class) {
dependsOn(versionTheRelease)
}