-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
144 lines (118 loc) · 4.72 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
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
alias(libs.plugins.buildconfig)
alias(libs.plugins.compose)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.detekt)
alias(libs.plugins.kotlin)
}
group = "com.russellbanks"
version = "1.13.0"
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
maven("https://oss.sonatype.org/content/repositories/snapshots")
}
dependencies {
implementation(compose.desktop.currentOs)
// Aurora - https://github.com/kirill-grouchnikov/aurora
implementation(libs.aurora.component)
implementation(libs.aurora.theming)
implementation(libs.aurora.window)
// Kotlin Coroutines - https://github.com/Kotlin/kotlinx.coroutines
implementation(libs.coroutines.core)
// Crypto - https://github.com/appmattus/crypto
implementation(libs.crypto.cryptohash)
// Flow Extensions - https://github.com/hoc081098/FlowExt
implementation(libs.flowext)
// GitHub API - https://github.com/hub4j/github-api
implementation(libs.github.api)
// Java Native Access - https://github.com/java-native-access/jna
implementation(libs.jna)
implementation(libs.jna.platform)
// Klogging - https://github.com/klogging/klogging
implementation(libs.klogging.jvm)
// Detekt Formatting Plugin - https://github.com/detekt/detekt
detektPlugins(libs.detekt.formatting)
// KotlinX DateTime - https://github.com/Kotlin/kotlinx-datetime
implementation(libs.kotlinx.datetime)
// jSystemThemeDetector - https://github.com/Dansoftowner/jSystemThemeDetector
implementation(libs.jsystemthemedetector)
// Kotlin CSV - https://github.com/doyaaaaaken/kotlin-csv
implementation(libs.kotlincsv)
// Ktor - https://github.com/ktorio/ktor
implementation(libs.ktor.client.java)
// LWJGL - https://github.com/LWJGL/lwjgl3
implementation(libs.lwjgl.core)
implementation(libs.lwjgl.tinyfd)
runtimeOnly(variantOf(libs.lwjgl.core) { classifier(lwjglNatives) })
runtimeOnly(variantOf(libs.lwjgl.tinyfd) { classifier(lwjglNatives) })
// SLF4J No-operation implementation - https://www.slf4j.org
implementation(libs.slf4j.nop)
// Voyager - https://github.com/adrielcafe/voyager
implementation(libs.voyager.navigator)
implementation(libs.voyager.screenmodel)
implementation(libs.voyager.tabNavigator)
// Window Styler - https://github.com/MayakaApps/ComposeWindowStyler
implementation(libs.windowstyler)
}
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JVM_21)
freeCompilerArgs.set(listOf("-opt-in=kotlin.RequiresOptIn"))
}
}
java {
sourceCompatibility = JavaVersion.current()
targetCompatibility = JavaVersion.VERSION_21
}
compose.desktop {
application {
mainClass = "MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Exe, TargetFormat.Msi, TargetFormat.Deb, TargetFormat.Rpm)
modules("java.instrument", "java.management", "java.prefs", "jdk.unsupported")
System.getenv("JAVA_HOME")?.let { javaHome = it }
packageName = project.name
packageVersion = project.version.toString()
description = "A Multiplatform GUI for Hashing"
vendor = "Russell Banks"
licenseFile.set(project.file("src/main/resources/gpl-3.0.rst"))
linux {
iconFile.set(project.file("src/main/resources/logo.png"))
menuGroup = project.name
}
macOS {
iconFile.set(project.file("src/main/resources/logo.icns"))
bundleID = "${project.group}.${project.name.lowercase()}"
}
windows {
iconFile.set(project.file("src/main/resources/logo.ico"))
menuGroup = project.name
dirChooser = true
upgradeUuid = "1A4C2D6B-AC84-47D4-A6EE-407A4AA8DED8"
}
}
}
}
detekt {
ignoreFailures = true
}
buildConfig {
buildConfigField("String", "appName", "\"${project.name}\"")
buildConfigField("String", "appVersion", provider { "\"${project.version}\"" })
}
val lwjglNatives = Pair(
System.getProperty("os.name")!!,
System.getProperty("os.arch")!!
).let { (name, _) ->
when {
arrayOf("Linux", "FreeBSD", "SunOS", "Unit").any(name::startsWith) -> "natives-linux"
arrayOf("Mac OS X", "Darwin").any(name::startsWith) -> "natives-macos"
name.startsWith("Windows") -> "natives-windows"
else -> throw Error("Unrecognized or unsupported platform. Please set \"lwjglNatives\" manually")
}
}