-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
127 lines (102 loc) · 3.02 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
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.internal.KaptGenerateStubsTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val ktorVersion = "2.3.2"
val jvmVersion = "1.9.0"
plugins {
kotlin("jvm") version "1.9.0"
id("org.jetbrains.compose") version "1.5.0"
}
group = "com.zer0s2m.creeptenuous.desktop"
version = "0.0.1-SNAPSHOT"
repositories {
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}
fun parseEnvFile(): Map<String, String> {
val env = mutableMapOf<String, String>()
file(".env").readLines().forEach {
val obj = it.split("=").toMutableList()
if (obj[0].contains("export")) {
obj[0] = obj[0].replace("export", "")
}
env[obj[0].trim()] = obj[1].trim()
}
return env
}
fun runTasks() {
tasks.withType<JavaCompile> {
sourceCompatibility to JavaVersion.VERSION_17
targetCompatibility to JavaVersion.VERSION_17
}
tasks.withType<JavaExec> {
environment(parseEnvFile())
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget to JavaVersion.VERSION_17
}
compilerOptions {
jvmTarget to JavaVersion.VERSION_17
}
}
tasks.withType<KaptGenerateStubsTask> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget to JavaVersion.VERSION_17
}
compilerOptions {
jvmTarget to JavaVersion.VERSION_17
}
}
}
kotlin {
jvmToolchain(17)
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
allprojects {
runTasks()
apply(plugin = "org.jetbrains.kotlin.jvm")
group = "com.zer0s2m.creeptenuous.desktop"
version = "0.0.1-SNAPSHOT"
project.ext.set("ktorVersion", ktorVersion)
project.ext.set("jvmVersion", jvmVersion)
}
subprojects {
runTasks()
apply(plugin = "org.jetbrains.kotlin.jvm")
repositories {
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
google()
}
dependencies {
if (!project.name.contains("creep-tenuous-desktop-common")) {
implementation(project(":creep-tenuous-desktop-common"))
}
}
}
compose.desktop {
application {
mainClass = "com.zer0s2m.creeptenuous.desktop.app.MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "CreepTenuousDesktop"
packageVersion = "1.0.0"
}
}
}
dependencies {
implementation(project(":creep-tenuous-desktop-common"))
implementation(project(":creep-tenuous-desktop-core"))
implementation(project(":creep-tenuous-desktop-reactive"))
implementation(project(":creep-tenuous-desktop-ui"))
implementation(project(":creep-tenuous-desktop-app"))
implementation(compose.desktop.currentOs)
}