Skip to content

Commit

Permalink
Simplified publication (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankoppier authored Dec 5, 2024
1 parent bad1861 commit a9d0406
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 92 deletions.
8 changes: 8 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
changelog:
categories:
- title: New Features and Changes
labels:
- enhancement
- title: Bug Fixes
labels:
- bug
38 changes: 18 additions & 20 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,31 @@ jreleaser {
}
release {
github {
repoOwner = "Mr-Mappie"
name = "mappie"
username = "stefankoppier"
token = properties["release.github.token"] as? String
draft = true
releaseNotes {
enabled = true
configurationFile = ".github/release.yml"
}
}
}
deploy {
maven {
mavenCentral {
active = org.jreleaser.model.Active.ALWAYS
create("mappie-api") {
active = org.jreleaser.model.Active.ALWAYS
url = "https://central.sonatype.com/api/v1/publisher"
stagingRepository(project(":mappie-api").layout.buildDirectory.dir("staging-deploy").get().toString())
username = properties["mavenCentralUsername"] as? String
password = properties["mavenCentralPassword"] as? String
applyMavenCentralRules = true
verifyPom = false
retryDelay = 20
}
create("compiler-plugin") {
active = org.jreleaser.model.Active.ALWAYS
url = "https://central.sonatype.com/api/v1/publisher"
stagingRepository(project(":compiler-plugin").layout.buildDirectory.dir("staging-deploy").get().toString())
username = properties["mavenCentralUsername"] as? String
password = properties["mavenCentralPassword"] as? String
applyMavenCentralRules = true
verifyPom = false
retryDelay = 20
listOf("mappie-api", "compiler-plugin").forEach {
create(it) {
active = org.jreleaser.model.Active.ALWAYS
url = "https://central.sonatype.com/api/v1/publisher"
stagingRepository(project(":$it").layout.buildDirectory.dir("staging-deploy").get().toString())
username = properties["mavenCentralUsername"] as? String
password = properties["mavenCentralPassword"] as? String
applyMavenCentralRules = true
verifyPom = false
retryDelay = 20
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
`kotlin-dsl`
}
11 changes: 11 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pluginManagement {
repositories {
gradlePluginPortal()
}
}

dependencyResolutionManagement {
repositories {
mavenCentral()
}
}
33 changes: 33 additions & 0 deletions buildSrc/src/main/kotlin/Util.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import org.gradle.api.publish.maven.MavenPublication

fun MavenPublication.mappiePom(name: String) =
pom {
this.name.set(name)
description.set("Kotlin Compiler Plugin for generating object mappers")
url.set("https://github.com/Mr-Mappie/mappie")

developers {
developer {
id.set("stefankoppier")
this.name.set("Stefan Koppier")
}
}

scm {
connection.set("scm:git:git://github.com/Mr-Mappie/mappie.git")
developerConnection.set("scm:git:git://github.com/Mr-Mappie/mappie.git")
url.set("https://github.com/Mr-Mappie/mappie/tree/main")
}

licenses {
license {
this.name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}

issueManagement {
system.set("GitHub")
url.set("https://github.com/Mr-Mappie/mappie/issues")
}
}
31 changes: 1 addition & 30 deletions compiler-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,36 +40,7 @@ publishing {
withVariantsFromConfiguration(configurations["testFixturesRuntimeElements"]) { skip() }
})

pom {
name = "tech.mappie:compiler-plugin"
description = "Kotlin Compiler Plugin for generating object mappers"
url = "https://github.com/Mr-Mappie/mappie"

developers {
developer {
id = "stefankoppier"
name = "Stefan Koppier"
}
}

scm {
connection = "scm:git:git://github.com/Mr-Mappie/mappie.git"
developerConnection = "scm:git:git://github.com/Mr-Mappie/mappie.git"
url = "https://github.com/Mr-Mappie/mappie/tree/main"
}

licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}

issueManagement {
system = "GitHub"
url = "https://github.com/Mr-Mappie/mappie/issues"
}
}
mappiePom(name = "tech.mappie:compiler-plugin")
}
}

Expand Down
44 changes: 2 additions & 42 deletions mappie-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
@file:OptIn(ExperimentalWasmDsl::class)

import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.dokka)
Expand Down Expand Up @@ -34,6 +30,7 @@ kotlin {
nodejs()
}

@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
wasmJs {
browser()
nodejs()
Expand All @@ -57,11 +54,6 @@ tasks.register<Jar>("javadocJar") {
dependsOn(dokkaHtml)
}

tasks.register<Jar>("emptyJar") {
group = "build"
description = "Assemble an empty jar."
}

publishing {
repositories {
maven {
Expand All @@ -72,40 +64,8 @@ publishing {
publications.configureEach {
if (this is MavenPublication) {
artifact(tasks["javadocJar"])
// jreleaser workaround
if (name != "jvm" && name != "kotlinMultiplatform") {
artifact(tasks["emptyJar"])
}
pom {
name = "tech.mappie:compiler-plugin"
description = "Kotlin Compiler Plugin for generating object mappers"
url = "https://github.com/Mr-Mappie/mappie"

developers {
developer {
id = "stefankoppier"
name = "Stefan Koppier"
}
}

scm {
connection = "scm:git:git://github.com/Mr-Mappie/mappie.git"
developerConnection = "scm:git:git://github.com/Mr-Mappie/mappie.git"
url = "https://github.com/Mr-Mappie/mappie/tree/main"
}

licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}

issueManagement {
system = "GitHub"
url = "https://github.com/Mr-Mappie/mappie/issues"
}
}
mappiePom(name = "tech.mappie:compiler-plugin")
}
}
}

0 comments on commit a9d0406

Please sign in to comment.