Migrate to com.vanniktech.maven.publish publish plugin, update gradle, publish to maven central.

This commit is contained in:
2025-04-06 15:13:38 +02:00
parent 9e08601bb7
commit ab5689133f
5 changed files with 44 additions and 30 deletions

View File

@@ -10,51 +10,60 @@ plugins {
}
group = "nl.astraeus"
version = "1.2.5-SNAPSHOT"
version = "1.2.5"
repositories {
mavenCentral()
}
/*
tasks.withType<Test>(Test::class.java) {
useJUnitPlatform()
}
*/
kotlin {
js {
browser {
testTask {
useKarma {
useChromiumHeadless()
useChromeHeadless()
}
}
}
}
/*
wasmJs {
//moduleName = project.name
browser()
/* wasmJs {
//moduleName = project.name
browser()
mavenPublication {
groupId = group as String
pom { name = "${project.name}-wasm-js" }
}
}
*/
mavenPublication {
groupId = group as String
pom { name = "${project.name}-wasm-js" }
}
}*/
/*
@OptIn(ExperimentalKotlinGradlePluginApi::class)
applyDefaultHierarchyTemplate {
common {
group("jsCommon") {
withJs()
// TODO: switch to `withWasmJs()` after upgrade to Kotlin 2.0
withWasm()
/*
@OptIn(ExperimentalKotlinGradlePluginApi::class)
applyDefaultHierarchyTemplate {
common {
group("jsCommon") {
withJs()
// TODO: switch to `withWasmJs()` after upgrade to Kotlin 2.0
withWasm()
}
}
}
}
*/
*/
sourceSets {
val commonMain by getting {
dependencies {
api("org.jetbrains.kotlinx:kotlinx-html:0.11.0")
api("org.jetbrains.kotlinx:kotlinx-html:0.12.0")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jsMain by getting
@@ -128,8 +137,8 @@ publishing {
setUrl("https://gitea.astraeus.nl/api/packages/rnentjes/maven")
credentials() {
val giteaUsername: kotlin.String? by project
val giteaPassword: kotlin.String? by project
val giteaUsername: String? by project
val giteaPassword: String? by project
username = giteaUsername
password = giteaPassword
@@ -175,3 +184,7 @@ tasks.withType<AbstractPublishToMaven> {
signing {
sign(publishing.publications)
}
tasks.withType<PublishToMavenRepository> {
dependsOn(tasks.withType<Sign>())
}