@@ -4,13 +4,6 @@ import com.codingfeline.buildkonfig.compiler.FieldSpec
44
55group = " dev.zxilly"
66
7- // val props: Properties = Properties().apply {
8- // val file = File(rootProject.rootDir, "local.properties")
9- // if (file.exists()) {
10- // load(FileInputStream(file))
11- // }
12- // }
13-
147fun isCI () = System .getenv(" CI" ) != null
158fun isPublish () = gradle.startParameter.taskNames.any { it.contains(" publish" ) }
169
@@ -19,21 +12,6 @@ repositories {
1912 mavenCentral()
2013}
2114
22- // afterEvaluate {
23- // // Remove log pollution until Android support in KMP improves.
24- // project.extensions.findByType<KotlinMultiplatformExtension>()?.let { kmpExt ->
25- // val sourceSetsToRemove = setOf(
26- // "androidTestFixtures",
27- // "androidTestFixturesDebug",
28- // "androidTestFixturesRelease",
29- // "androidAndroidTestRelease"
30- // )
31- // kmpExt.sourceSets.removeAll {
32- // sourceSetsToRemove.contains(it.name)
33- // }
34- // }
35- // }
36-
3715plugins {
3816 kotlin(" multiplatform" ) version " 1.8.0"
3917 kotlin(" plugin.serialization" ) version " 1.8.0"
@@ -79,7 +57,9 @@ kotlin {
7957 browser()
8058 }
8159
82- android()
60+ android {
61+ publishAllLibraryVariants()
62+ }
8363 linuxX64()
8464 macosX64()
8565 mingwX64()
@@ -172,39 +152,6 @@ buildkonfig {
172152 }
173153}
174154
175- // val hostOs: String = System.getProperty("os.name")
176- // val isMacosX64 = hostOs == "Mac OS X"
177- // val isLinuxX64 = hostOs == "Linux"
178- //
179- // fun tryDisableMacosNative(task: Task) {
180- // if (task.name.contains("macos", true)) {
181- // task.enabled = false
182- // task.onlyIf { false }
183- // }
184- // }
185- //
186- // fun tryDisableLinuxNative(task: Task) {
187- // if (task.name.contains("linux", true)) {
188- // task.enabled = false
189- // task.onlyIf { false }
190- // }
191- // }
192-
193- // project.gradle.taskGraph.whenReady {
194- // project.tasks.forEach {
195- // if (it.name.contains("lint")) {
196- // it.enabled = false
197- // }
198- // if (System.getenv("TEST") != null) {
199- // if (isMacosX64) {
200- // tryDisableLinuxNative(it)
201- // } else if (isLinuxX64) {
202- // tryDisableMacosNative(it)
203- // }
204- // }
205- // }
206- // }
207-
208155android {
209156 compileSdk = 33
210157 sourceSets[" main" ].manifest.srcFile(" src/androidMain/AndroidManifest.xml" )
@@ -229,10 +176,6 @@ android {
229176 }
230177}
231178
232- // fun String.mapToEnv(): String {
233- // return this.toUpperCase().replace(".", "_")
234- // }
235-
236179val mavenCentralUser = secret.get(" maven.user" )
237180val mavenCentralPassword = secret.get(" maven.password" )
238181val releasesRepoUrl = uri(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" )
@@ -246,10 +189,6 @@ val githubToken = secret.get("github.token")
246189
247190val githubPackageRegistryUrl = uri(" https://maven.pkg.github.com/ZNotify/kt-sdk" )
248191
249- // val javadocJar by tasks.registering(Jar::class) {
250- // archiveClassifier.set("javadoc")
251- // }
252-
253192nexusStaging {
254193 serverUrl = " https://s01.oss.sonatype.org/service/local/"
255194 username = mavenCentralUser
0 commit comments