|
1 | 1 |
|
2 | | -import com.vanniktech.maven.publish.SonatypeHost |
3 | | -import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi |
4 | | -import org.jetbrains.kotlin.gradle.dsl.JvmTarget |
5 | 2 | import java.util.* |
6 | 3 |
|
7 | 4 | plugins { |
8 | | - alias(libs.plugins.kotlin.multiplatform) |
9 | | - alias(libs.plugins.android.library) |
10 | | - alias(libs.plugins.ktlint) |
11 | | - alias(libs.plugins.detekt) |
12 | 5 | 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) |
115 | 7 |
|
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) |
117 | 10 |
|
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 |
143 | 14 | } |
144 | 15 |
|
145 | 16 | // checks to see if a release is "stable," meaning we don't have to worry about rc versions polluting a dependencyUpdates check |
|
0 commit comments