restructure project to Kotlin Multiplatform

- custom POM location removed (there are now two POMs, one for the 'Kotlin Multiplatform' publication, and another for Kotlin/JVM, and more are on the way, which would lead to a cluttered build dir)
- renamed the directories (the directory name is how Kotlin Multiplatform chooses the published artifact ID, and there's no an easier way to change it.)
- updated README examples, and link to `-jvm` variant guide
This commit is contained in:
Adam 2023-06-06 00:04:26 +02:00
parent 4df6d3f599
commit dce203845e
16 changed files with 59 additions and 243 deletions

View file

@ -1,47 +0,0 @@
package buildsrc.conventions.lang
import buildsrc.utils.Rife2TestListener
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
/**
* Common configuration for Kotlin/JVM projects
*
* (this can be removed after Kotlin Multiplatform migration)
*/
plugins {
id("buildsrc.conventions.base")
kotlin("jvm")
id("io.gitlab.arturbosch.detekt")
id("org.jetbrains.kotlinx.kover")
}
java {
withSourcesJar()
}
kotlin {
jvmToolchain(11)
}
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}
tasks.withType<Test>().configureEach {
// useJUnitPlatform()
val testsBadgeApiKey = providers.gradleProperty("testsBadgeApiKey")
addTestListener(Rife2TestListener(testsBadgeApiKey))
testLogging {
exceptionFormat = TestExceptionFormat.FULL
events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
}
finalizedBy(tasks.matching { it.name == "koverXmlReport" })
}

View file

@ -89,6 +89,7 @@ signing {
!isSnapshotVersion() || gradle.taskGraph.hasTask("publish")
})
}
tasks.withType<Sign>().configureEach {
val signingRequiredPredicate = provider { signing.isRequired }
onlyIf { signingRequiredPredicate.get() }
@ -106,3 +107,9 @@ val javadocJar by tasks.registering(Jar::class) {
from(tasks.dokkaJavadoc)
archiveClassifier.set("javadoc")
}
publishing {
publications.withType<MavenPublication>().configureEach {
artifact(javadocJar)
}
}