-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
174 lines (149 loc) · 5.31 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
import org.jetbrains.kotlin.gradle.utils.loadPropertyFromResources
import java.net.URI
import java.util.*
plugins {
kotlin("multiplatform") version "2.0.0"
kotlin("plugin.serialization") version "2.0.0"
`maven-publish`
signing
}
group = "me.rahimklaber"
version = "0.0.4"
repositories {
mavenCentral()
maven("https://jitpack.io")
maven("https://repo.kotlin.link")
}
val ktor_version = "2.3.12"
val okioVersion = "3.6.0"
var encoding = "1.2.1"
val coroutinesVersion = "1.9.0-RC"
val serializationVersion = "1.7.1"
val datetimeVersion = "0.6.0"
val cryptoVersion = "0.9.2"
val localProperties = Properties()
try {
localProperties.load(File("local.properties").inputStream())
}catch (e: Throwable){}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class).all {
kotlinOptions.freeCompilerArgs = listOf("-Xcontext-receivers")
}
//
afterEvaluate {
extensions.findByType<PublishingExtension>()?.apply {
repositories {
mavenLocal()
// maven{
// url = URI.create("https://central.sonatype.org/")
// credentials {
// }
// }
}
publications.withType<MavenPublication>().configureEach {
val publication = this
val javadocJar = tasks.register("${publication.name}JavadocJar", Jar::class) {
archiveClassifier.set("javadoc")
archiveAppendix.set(name)
}
artifact(javadocJar)
pom {
name = "Kotlin Multiplatform Stellar SDK"
description = "A multiplatform SDK for the Stellar Blockchain"
url = "https://github.com/rahimklaber/stellar_kt"
developers {
developer {
id = "rahim"
name = "Rahim Klabér"
email = "[email protected]"
}
}
licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
scm {
url = "https://github.com/rahimklaber/stellar_kt"
}
}
}
// extensions.findByType<SigningExtension>()!!.apply sc@{
// val publishing = extensions.findByType<PublishingExtension>() ?: return@sc
// val key = localProperties["signingKey"]?.toString()?.replace("\\n", "\n")
// val password = localProperties["signingPassword"]?.toString()
//
// useInMemoryPgpKeys(key, password)
// sign(publishing.publications)
// }
}
}
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
testRuns["test"].executionTask.configure {
useJUnit()
}
}
js(IR) {
binaries.library()
browser {
// commonWebpackConfig {
// cssSupport.enabled = true
// }
}
nodejs()
}
val hostOs = System.getProperty("os.name")
val isMingwX64 = hostOs.startsWith("Windows")
// val nativeTarget = when {
// hostOs == "Mac OS X" -> macosX64("native")
// hostOs == "Linux" -> linuxX64("native")
// isMingwX64 -> mingwX64("native")
// else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
// }
sourceSets {
val commonMain by getting {
dependencies {
api("org.jetbrains.kotlinx:kotlinx-datetime:$datetimeVersion")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
api("io.ktor:ktor-client-core:$ktor_version")
implementation("io.ktor:ktor-client-content-negotiation:$ktor_version")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion")
api("com.squareup.okio:okio:$okioVersion")
implementation("com.ionspin.kotlin:multiplatform-crypto-libsodium-bindings:$cryptoVersion")
implementation("io.matthewnelson.kotlin-components:encoding-base16:$encoding")
implementation("io.matthewnelson.kotlin-components:encoding-base32:$encoding")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.1")
}
}
val jvmMain by getting {
dependencies {
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
// implementation("com.squareup:kotlinpoet:1.14.2")
// api("space.kscience:kmath-core:0.3.1")
}
}
val jvmTest by getting
val jsMain by getting {
dependencies {
implementation("io.ktor:ktor-client-js:$ktor_version")
}
}
val jsTest by getting
// val nativeMain by getting{
// dependencies {
// implementation("io.ktor:ktor-client-winhttp:$ktor_version")
// }
// }
// val nativeTest by getting
}
}