-
Notifications
You must be signed in to change notification settings - Fork 81
/
build.gradle.kts
69 lines (61 loc) · 2.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
plugins {
`kord-multiplatform-module`
`kord-publishing`
alias(libs.plugins.buildconfig)
}
kotlin {
sourceSets {
commonMain {
dependencies {
api(libs.kotlinx.coroutines.core)
api(libs.kotlinx.serialization.json)
api(libs.kotlinx.datetime)
api(libs.ktor.client.core)
compileOnly(projects.kspAnnotations)
}
}
jvmMain {
dependencies {
api(libs.ktor.client.okhttp)
}
}
nonJvmMain {
dependencies {
implementation(libs.bignum)
implementation(libs.stately.collections)
}
}
jsMain {
dependencies {
api(libs.ktor.client.js)
// workaround for https://youtrack.jetbrains.com/issue/KT-43500 /
// https://youtrack.jetbrains.com/issue/KT-64109#focus=Comments-27-10064206.0-0 /
// https://youtrack.jetbrains.com/issue/KT-61096 (intended to be compileOnly in commonMain only)
implementation(projects.kspAnnotations)
}
}
jvmTest {
dependencies {
implementation(libs.kbson)
}
}
}
}
/*
This will generate a file named "BuildConfigGenerated.kt" that looks like:
package dev.kord.common
internal const val BUILD_CONFIG_GENERATED_LIBRARY_VERSION: String = "<version>"
internal const val BUILD_CONFIG_GENERATED_COMMIT_HASH: String = "<commit hash>"
internal const val BUILD_CONFIG_GENERATED_SHORT_COMMIT_HASH: String = "<short commit hash>"
*/
buildConfig {
packageName = "dev.kord.common"
className = "BuildConfigGenerated"
useKotlinOutput {
topLevelConstants = true
internalVisibility = true
}
buildConfigField("BUILD_CONFIG_GENERATED_LIBRARY_VERSION", libraryVersion)
buildConfigField("BUILD_CONFIG_GENERATED_COMMIT_HASH", commitHash)
buildConfigField("BUILD_CONFIG_GENERATED_SHORT_COMMIT_HASH", shortCommitHash)
}