-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
103 lines (90 loc) · 2.82 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
plugins {
kotlin("multiplatform") version "1.8.10"
kotlin("plugin.serialization") version "1.8.10"
`maven-publish`
}
group = "me.zodd"
version = "1.7.2"
val mavenPublishingUrl = "https://repo.zodd.me/releases"
repositories {
mavenCentral()
}
kotlin {
jvm {
compilations.all {
kotlinOptions {
jvmTarget = "17"
}
}
withJava()
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
afterEvaluate {
configure<PublishingExtension> {
val mavenPublication = this as? MavenPublication
mavenPublication?.artifactId = "${project.name}${
"-$name".takeUnless {
"kotlinMultiplatform" in name
}.orEmpty()
}"
}
//May be ok to delete.
tasks.named("generateMetadataFileForMavenPublishPublication") {
dependsOn("metadataJar")
}
}
publishing {
publications {
create<MavenPublication>("mavenPublish") {
artifactId = "KsonMulti"
groupId = project.group as String
version = project.version.toString()
repositories {
maven {
setUrl(mavenPublishingUrl)
credentials {
username = project.properties["mavenUser"] as String?
password = project.properties["mavenPassword"] as String?
}
authentication {
create<BasicAuthentication>("basic")
}
}
}
}
}
}
sourceSets {
//COMMON
val commonMain by getting {
dependencies {
api("io.ktor:ktor-client-serialization:2.3.1")
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
api("io.ktor:ktor-client-core:2.3.1")
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.1")
implementation("io.ktor:ktor-client-content-negotiation:2.3.1")
}
}
val commonTest by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0")
implementation(kotlin("test"))
}
}
//JVM
val jvmMain by getting {
dependencies {
api(kotlin("stdlib-jdk8"))
api("io.ktor:ktor-client-cio:2.3.1")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.0")
api(kotlin("reflect"))
}
}
val jvmTest by getting {
dependencies {
}
}
}
}