Commit a9c683b3 authored by Nikolay Igotti's avatar Nikolay Igotti

Revert "Make publications comply with Maven Central requirements (#267)"

This reverts commit 71e2477d.
parent 839ae5e2
......@@ -2,12 +2,10 @@ import de.undercouch.gradle.tasks.download.Download
import org.gradle.crypto.checksum.Checksum
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
import java.util.Locale
plugins {
kotlin("multiplatform") version "1.5.31" // "1.6.0-M1"
`maven-publish`
signing
id("org.gradle.crypto.checksum") version "1.1.0"
id("de.undercouch.download") version "4.1.1"
}
......@@ -952,14 +950,6 @@ afterEvaluate {
}
}
val emptySourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
}
val emptyJavadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}
publishing {
repositories {
configureEach {
......@@ -983,81 +973,34 @@ publishing {
}
}
publications {
val pomNameForPublication = HashMap<String, String>()
pomNameForPublication["kotlinMultiplatform"] = "Skiko MPP"
kotlin.targets.forEach {
pomNameForPublication[it.name] = "Skiko ${toTitleCase(it.name)}"
}
configureEach {
this as MavenPublication
groupId = "org.jetbrains.skiko"
if (skiko.signArtifacts) {
signing.sign(this)
}
// Necessary for publishing to Maven Central
artifact(emptyJavadocJar)
pom {
name.set("Skiko")
description.set("Kotlin Skia bindings")
packaging = "jar"
url.set("http://www.github.com/JetBrains/skiko")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
val repoUrl = "https://www.github.com/JetBrains/skiko"
url.set(repoUrl)
scm {
url.set(repoUrl)
val repoConnection = "scm:git:$repoUrl.git"
connection.set(repoConnection)
developerConnection.set(repoConnection)
}
developers {
developer {
name.set("Compose Multiplatform Team")
organization.set("JetBrains")
organizationUrl.set("https://www.jetbrains.com")
}
}
}
}
create<MavenPublication>("skikoJvmRuntime") {
pomNameForPublication[name] = "Skiko JVM Runtime for ${targetOs.name} ${targetArch.name}"
artifactId = SkikoArtifacts.runtimeArtifactIdFor(targetOs, targetArch)
afterEvaluate {
artifact(skikoJvmRuntimeJar.map { it.archiveFile.get() })
var jvmSourcesArtifact: Any? = null
kotlin.jvm().mavenPublication {
jvmSourcesArtifact = artifacts.find { it.classifier == "sources" }
}
if (jvmSourcesArtifact == null) {
error("Could not find sources jar artifact for JVM target")
} else {
artifact(jvmSourcesArtifact)
}
}
}
if (supportWasm) {
create<MavenPublication>("skikoWasmRuntime") {
pomNameForPublication[name] = "Skiko WASM Runtime"
artifactId = SkikoArtifacts.jsWasmArtifactId
artifact(skikoWasmJar.get())
artifact(emptySourcesJar)
}
}
val publicationsWithoutPomNames = publications.filter { it.name !in pomNameForPublication }
if (publicationsWithoutPomNames.isNotEmpty()) {
error("Publications with unknown POM names: ${publicationsWithoutPomNames.joinToString { "'$it'" }}")
}
configureEach {
this as MavenPublication
pom.name.set(pomNameForPublication[name]!!)
}
}
}
......
......@@ -127,9 +127,6 @@ class SkikoProperties(private val myProject: Project) {
val isRelease: Boolean
get() = myProject.findProperty("deploy.release") == "true"
val signArtifacts: Boolean
get() = myProject.findProperty("deploy.sign") == "true"
val buildType: SkiaBuildType
get() = if (myProject.findProperty("skiko.debug") == "true") SkiaBuildType.DEBUG else SkiaBuildType.RELEASE
......
......@@ -2,7 +2,6 @@ import org.gradle.api.Task
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.TaskContainer
import org.gradle.kotlin.dsl.register
import java.util.*
// Utils, that are not needed in scripts can be placed to internal/utils
......@@ -16,7 +15,10 @@ inline fun <reified T : Task> TaskContainer.registerOrGetTask(
}
fun joinToTitleCamelCase(vararg parts: String): String =
parts.joinToString(separator = "") { toTitleCase(it) }
fun toTitleCase(s: String): String =
s.capitalize(Locale.ROOT)
\ No newline at end of file
parts.joinToString(separator = "") { part ->
if (part.isEmpty()) part
else buildString {
append(part.first().toTitleCase())
append(part.substring(1))
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment