Skip to content

Commit 2539ef4

Browse files
committed
build: also release android
1 parent 5110335 commit 2539ef4

File tree

1 file changed

+3
-64
lines changed

1 file changed

+3
-64
lines changed

build.gradle.kts

Lines changed: 3 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@ import com.codingfeline.buildkonfig.compiler.FieldSpec
44

55
group = "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-
147
fun isCI() = System.getenv("CI") != null
158
fun 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-
3715
plugins {
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-
208155
android {
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-
236179
val mavenCentralUser = secret.get("maven.user")
237180
val mavenCentralPassword = secret.get("maven.password")
238181
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
@@ -246,10 +189,6 @@ val githubToken = secret.get("github.token")
246189

247190
val 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-
253192
nexusStaging {
254193
serverUrl = "https://s01.oss.sonatype.org/service/local/"
255194
username = mavenCentralUser

0 commit comments

Comments
 (0)