-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
107 lines (98 loc) · 3.25 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
plugins {
application
kotlin("multiplatform") version "1.7.0"
kotlin("plugin.serialization") version "1.7.0"
}
group = "com.github.thamid_gamer"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/")
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
}
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
js(IR) {
binaries.executable()
browser {
commonWebpackConfig {
cssSupport.enabled = true
}
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(libs.kotlinx.serialization.core)
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting {
dependencies {
implementation(libs.exposed)
implementation(libs.google.api.client)
implementation(libs.jsoup)
implementation(libs.kotlinx.html)
implementation(libs.kotlinx.serialization.json)
implementation(libs.ktor.client.apache)
implementation(libs.ktor.client.contentNegotiation)
implementation(libs.ktor.client.logging)
implementation(libs.ktor.serialization.kotlinx.json)
implementation(libs.ktor.server.contentNegotiation)
implementation(libs.ktor.server.logging)
implementation(libs.ktor.server.htmlBuilder)
implementation(libs.ktor.server.httpRedirect)
implementation(libs.ktor.server.netty)
implementation(libs.ktor.server.sessions)
implementation(libs.logback)
implementation(libs.sqlite)
}
}
val jvmTest by getting
val jsMain by getting {
dependencies {
implementation(libs.ktor.client.js)
implementation(libs.ktor.client.contentNegotiation)
implementation(libs.ktor.serialization.kotlinx.json)
implementation(libs.react)
implementation(libs.react.dom)
implementation(libs.react.router)
implementation(npm("react-helmet-async", "1.3.0"))
}
}
val jsTest by getting
}
}
application {
mainClass.set("$group.locatereborn.backend.server.ServerKt")
}
tasks.named<Copy>("jvmProcessResources") {
val jsBrowserDistribution = tasks.named("jsBrowserDistribution")
from(jsBrowserDistribution)
}
tasks.named<JavaExec>("run") {
dependsOn(tasks.named<Jar>("jvmJar"))
classpath(tasks.named<Jar>("jvmJar"))
workingDir = File("/run")
}
val cleanDistribution = tasks.register<Delete>("cleanDistribution") {
delete(
File(projectDir, "$/build/distributions/LocateReborn-1.0-SNAPSHOT.tar"),
File(projectDir, "$/build/distributions/LocateReborn-1.0-SNAPSHOT.zip")
)
}
tasks.named<Jar>("jvmJar") {
dependsOn(cleanDistribution)
}