Skip to content

Commit d6daec2

Browse files
committed
move kulid project into its own submodule
this helps clear the way for benchmarking
1 parent c1015b6 commit d6daec2

5 files changed

Lines changed: 153 additions & 136 deletions

File tree

build.gradle.kts

Lines changed: 6 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,145 +1,16 @@
11

2-
import com.vanniktech.maven.publish.SonatypeHost
3-
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
4-
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
52
import java.util.*
63

74
plugins {
8-
alias(libs.plugins.kotlin.multiplatform)
9-
alias(libs.plugins.android.library)
10-
alias(libs.plugins.ktlint)
11-
alias(libs.plugins.detekt)
125
alias(libs.plugins.versions)
13-
alias(libs.plugins.vanniktech.mavenPublish)
14-
alias(libs.plugins.kotlin.serialization)
15-
}
16-
17-
group = "dev.phillipslabs"
18-
version = "0.2.0"
19-
20-
kotlin {
21-
explicitApi()
22-
23-
jvm()
24-
jvmToolchain(11)
25-
26-
js {
27-
nodejs()
28-
browser()
29-
}
30-
31-
wasmJs {
32-
browser()
33-
nodejs()
34-
}
35-
36-
wasmWasi {
37-
nodejs()
38-
}
39-
40-
// TODO android!
41-
androidTarget {
42-
publishLibraryVariants("release")
43-
@OptIn(ExperimentalKotlinGradlePluginApi::class)
44-
compilerOptions {
45-
jvmTarget.set(JvmTarget.JVM_11)
46-
}
47-
}
48-
49-
// "tiers" here are taken from https://kotlinlang.org/docs/native-target-support.html
50-
// tier 1
51-
macosX64()
52-
macosArm64()
53-
iosSimulatorArm64()
54-
iosX64()
55-
iosArm64()
56-
57-
// tier 2
58-
linuxX64()
59-
linuxArm64()
60-
watchosSimulatorArm64()
61-
watchosX64()
62-
watchosArm32()
63-
watchosArm64()
64-
tvosSimulatorArm64()
65-
tvosX64()
66-
tvosArm64()
67-
68-
// tier 3
69-
androidNativeArm32()
70-
androidNativeArm64()
71-
androidNativeX86()
72-
androidNativeX64()
73-
mingwX64()
74-
watchosDeviceArm64()
75-
76-
sourceSets {
77-
commonMain {
78-
dependencies {
79-
implementation(libs.crypto.rand)
80-
// TODO we may eventually be able to replace this with a part of the standard library
81-
api(libs.kotlinx.datetime)
82-
api(libs.kotlinx.serialization.core)
83-
}
84-
}
85-
commonTest {
86-
dependencies {
87-
implementation(kotlin("test"))
88-
}
89-
}
90-
}
91-
}
92-
93-
android {
94-
namespace = "dev.phillipslabs.kulid"
95-
compileSdk =
96-
libs.versions.android.compileSdk
97-
.get()
98-
.toInt()
99-
defaultConfig {
100-
minSdk =
101-
libs.versions.android.minSdk
102-
.get()
103-
.toInt()
104-
}
105-
compileOptions {
106-
sourceCompatibility = JavaVersion.VERSION_11
107-
targetCompatibility = JavaVersion.VERSION_11
108-
}
109-
}
110-
111-
mavenPublishing {
112-
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
113-
114-
signAllPublications()
6+
alias(libs.plugins.ktlint)
1157

116-
coordinates(group.toString(), "kulid", version.toString())
8+
// TODO if we need to override any config we might need a build-logic plugin!
9+
alias(libs.plugins.detekt)
11710

118-
pom {
119-
name = "Kulid"
120-
description = "ULID implementation for Kotlin Multiplatform"
121-
inceptionYear = "2025"
122-
url = "https://github.com/daphil19/kulid"
123-
licenses {
124-
license {
125-
name.set("The Apache License, Version 2.0")
126-
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
127-
distribution.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
128-
}
129-
}
130-
developers {
131-
developer {
132-
id = "daphil19"
133-
name = "David Phillips"
134-
url = "https://github.com/daphil19"
135-
}
136-
}
137-
scm {
138-
url = "https://github.com/daphil19/kulid"
139-
connection = "scm:git:git://github.com/daphil19/kulid.git"
140-
developerConnection = "scm:git:ssh://git@github.com/daphil19/kulid.git"
141-
}
142-
}
11+
// these need to be defined for some of the other plugins to work correctly
12+
alias(libs.plugins.kotlin.multiplatform) apply false
13+
alias(libs.plugins.android.library) apply false
14314
}
14415

14516
// checks to see if a release is "stable," meaning we don't have to worry about rc versions polluting a dependencyUpdates check

kulid/build.gradle.kts

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
@file:OptIn(ExperimentalWasmDsl::class)
2+
3+
import com.vanniktech.maven.publish.SonatypeHost
4+
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
5+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
6+
7+
plugins {
8+
alias(libs.plugins.kotlin.multiplatform)
9+
alias(libs.plugins.android.library)
10+
alias(libs.plugins.ktlint)
11+
12+
// TODO if we need to override any config we might need a build-logic plugin!
13+
alias(libs.plugins.detekt)
14+
alias(libs.plugins.versions)
15+
alias(libs.plugins.vanniktech.mavenPublish)
16+
alias(libs.plugins.kotlin.serialization)
17+
}
18+
19+
group = "dev.phillipslabs"
20+
version = "0.2.0"
21+
22+
kotlin {
23+
explicitApi()
24+
25+
jvm()
26+
jvmToolchain(11)
27+
28+
js {
29+
nodejs()
30+
browser()
31+
}
32+
33+
wasmJs {
34+
browser()
35+
nodejs()
36+
}
37+
38+
wasmWasi {
39+
nodejs()
40+
}
41+
42+
// TODO android!
43+
androidTarget {
44+
publishLibraryVariants("release")
45+
compilerOptions {
46+
jvmTarget.set(JvmTarget.JVM_11)
47+
}
48+
}
49+
50+
// "tiers" here are taken from https://kotlinlang.org/docs/native-target-support.html
51+
// tier 1
52+
macosX64()
53+
macosArm64()
54+
iosSimulatorArm64()
55+
iosX64()
56+
iosArm64()
57+
58+
// tier 2
59+
linuxX64()
60+
linuxArm64()
61+
watchosSimulatorArm64()
62+
watchosX64()
63+
watchosArm32()
64+
watchosArm64()
65+
tvosSimulatorArm64()
66+
tvosX64()
67+
tvosArm64()
68+
69+
// tier 3
70+
androidNativeArm32()
71+
androidNativeArm64()
72+
androidNativeX86()
73+
androidNativeX64()
74+
mingwX64()
75+
watchosDeviceArm64()
76+
77+
sourceSets {
78+
commonMain {
79+
dependencies {
80+
implementation(libs.crypto.rand)
81+
// TODO we may eventually be able to replace this with a part of the standard library
82+
api(libs.kotlinx.datetime)
83+
api(libs.kotlinx.serialization.core)
84+
}
85+
}
86+
commonTest {
87+
dependencies {
88+
implementation(kotlin("test"))
89+
}
90+
}
91+
}
92+
}
93+
94+
android {
95+
namespace = "dev.phillipslabs.kulid"
96+
compileSdk =
97+
libs.versions.android.compileSdk
98+
.get()
99+
.toInt()
100+
defaultConfig {
101+
minSdk =
102+
libs.versions.android.minSdk
103+
.get()
104+
.toInt()
105+
}
106+
compileOptions {
107+
sourceCompatibility = JavaVersion.VERSION_11
108+
targetCompatibility = JavaVersion.VERSION_11
109+
}
110+
}
111+
112+
mavenPublishing {
113+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
114+
115+
signAllPublications()
116+
117+
coordinates(group.toString(), "kulid", version.toString())
118+
119+
pom {
120+
name = "Kulid"
121+
description = "ULID implementation for Kotlin Multiplatform"
122+
inceptionYear = "2025"
123+
url = "https://github.com/daphil19/kulid"
124+
licenses {
125+
license {
126+
name.set("The Apache License, Version 2.0")
127+
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
128+
distribution.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
129+
}
130+
}
131+
developers {
132+
developer {
133+
id = "daphil19"
134+
name = "David Phillips"
135+
url = "https://github.com/daphil19"
136+
}
137+
}
138+
scm {
139+
url = "https://github.com/daphil19/kulid"
140+
connection = "scm:git:git://github.com/daphil19/kulid.git"
141+
developerConnection = "scm:git:ssh://git@github.com/daphil19/kulid.git"
142+
}
143+
}
144+
}

src/commonMain/kotlin/dev/phillipslabs/kulid/ULID.kt renamed to kulid/src/commonMain/kotlin/dev/phillipslabs/kulid/ULID.kt

File renamed without changes.

src/commonTest/kotlin/dev/phillipslabs/kulid/TestULID.kt renamed to kulid/src/commonTest/kotlin/dev/phillipslabs/kulid/TestULID.kt

File renamed without changes.

settings.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pluginManagement {
77
}
88

99
plugins {
10-
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
10+
id("org.gradle.toolchains.foojay-resolver-convention") version "0.10.0"
1111
}
1212

1313
dependencyResolutionManagement {
@@ -18,3 +18,5 @@ dependencyResolutionManagement {
1818
}
1919

2020
rootProject.name = "Kulid"
21+
22+
include(":kulid")

0 commit comments

Comments
 (0)