Skip to content

Commit 767a30b

Browse files
committed
refactor: moved to kmp structure
1 parent 3b38019 commit 767a30b

File tree

25 files changed

+2287
-151
lines changed

25 files changed

+2287
-151
lines changed

build.gradle.kts

Lines changed: 20 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,30 @@
1-
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2-
31
plugins {
4-
kotlin("jvm") version "2.3.0"
2+
id("com.eignex.kmp") version "1.0.0"
53
kotlin("plugin.serialization") version "2.3.0"
6-
id("org.jetbrains.dokka") version "2.1.0"
7-
id("org.jetbrains.kotlinx.kover") version "0.9.5"
8-
`maven-publish`
9-
signing
10-
11-
id("io.github.sgtsilvio.gradle.maven-central-publishing") version "0.4.1"
12-
}
13-
14-
group = "com.eignex"
15-
version = findProperty("ciVersion") as String? ?: "SNAPSHOT"
16-
17-
repositories { mavenCentral() }
18-
19-
kotlin {
20-
jvmToolchain(21)
21-
compilerOptions { jvmTarget.set(JvmTarget.JVM_21) }
22-
}
23-
24-
java {
25-
withSourcesJar()
26-
withJavadocJar()
27-
}
28-
29-
dependencies {
30-
testImplementation(kotlin("test"))
31-
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-core:1.10.0")
32-
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.10.0")
33-
testImplementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.10.0")
34-
testImplementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.10.0")
35-
testImplementation("org.bouncycastle:bcprov-jdk18on:1.83")
364
}
375

38-
tasks.test { useJUnitPlatform() }
39-
40-
tasks.named<Jar>("javadocJar") {
41-
dependsOn(tasks.named("dokkaGenerate"))
42-
from(layout.buildDirectory.dir("dokka/html"))
6+
eignexPublish {
7+
description.set("ASCII-safe encodings and ultra-small binary serialization for Kotlin, optimized for URLs, file names, and Kubernetes labels. Generates short, predictable payloads within tight character limits.")
8+
githubRepo.set("Eignex/kencode")
439
}
4410

45-
publishing {
46-
publications {
47-
create<MavenPublication>("mavenJava") {
48-
from(components["java"])
49-
pom {
50-
name.set("kencode")
51-
description.set("ASCII-safe encodings and ultra-small binary serialization for Kotlin, optimized for URLs, file names, and Kubernetes labels. Generates short, predictable payloads within tight character limits.")
52-
url.set("https://github.com/Eignex/kencode")
53-
licenses {
54-
license {
55-
name.set("Apache-2.0")
56-
url.set("https://www.apache.org/licenses/LICENSE-2.0")
57-
}
58-
}
59-
scm {
60-
url.set("https://github.com/Eignex/kpermute")
61-
connection.set("scm:git:https://github.com/Eignex/kpermute.git")
62-
developerConnection.set("scm:git:ssh://git@github.com/Eignex/kpermute.git")
63-
}
64-
developers {
65-
developer {
66-
id.set("rasros")
67-
name.set("Rasmus Ros")
68-
url.set("https://github.com/rasros")
69-
}
70-
}
71-
}
11+
kotlin {
12+
jvm()
13+
js(IR) { browser(); nodejs() }
14+
linuxX64(); macosX64(); macosArm64(); mingwX64()
15+
16+
sourceSets {
17+
commonMain.dependencies {
18+
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-core:1.10.0")
19+
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.10.0")
20+
implementation("com.ionspin.kotlin:bignum:0.3.10")
7221
}
73-
}
74-
75-
repositories {
76-
maven {
77-
name = "localStaging"
78-
url = uri(layout.buildDirectory.dir("staging-repo"))
22+
commonTest.dependencies {
23+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.10.0")
24+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.10.0")
25+
}
26+
jvmTest.dependencies {
27+
implementation("org.bouncycastle:bcprov-jdk18on:1.83")
7928
}
80-
}
81-
}
82-
83-
signing {
84-
val key = findProperty("signingKey") as String?
85-
val pass = findProperty("signingPassword") as String?
86-
87-
if (key != null && pass != null) {
88-
useInMemoryPgpKeys(key, pass)
89-
sign(publishing.publications["mavenJava"])
90-
} else {
91-
logger.lifecycle("Signing disabled: signingKey or signingPassword not defined.")
9229
}
9330
}

0 commit comments

Comments
 (0)