Skip to content

Commit

Permalink
Fix publication to not overwrite metadata marker (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Mashkov committed Nov 26, 2020
1 parent 01f0358 commit bea2f77
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 74 deletions.
97 changes: 24 additions & 73 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Copyright 2020-2020 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

import org.jetbrains.kotlin.gradle.dsl.*
import org.jetbrains.kotlin.utils.addToStdlib.*
import org.jmailen.gradle.kotlinter.*

Expand Down Expand Up @@ -39,38 +38,36 @@ allprojects {

publishing {
publications {
create<MavenPublication>("maven") {
groupId = rootProject.group.toString()
artifactId = project.name
version = project.version.toString()

if (project != rootProject) {
all {
if (this is MavenPublication) {
artifact(tasks.getByName("emptyJar")) {
classifier = "javadoc"
}
}

pom {
name.set("Kotlin UUID library")
description.set(project.description?.takeIf { it.isNotBlank() }
?: "Library for generating and manipulating UUID")
url.set("https://kotlinlang.org")
developers {
developer {
name.set("Sergey Mashkov")
email.set("sergey.mashkov@jetbrains.com")
pom {
name.set("Kotlin UUID library")
description.set(project.description?.takeIf { it.isNotBlank() }
?: "Library for generating and manipulating UUID")
url.set("https://github.com/cy6erGn0m/kotlinx-uuid")
developers {
developer {
name.set("Sergey Mashkov")
email.set("sergey.mashkov@jetbrains.com")
organization.set("JetBrains s.r.o.")
organizationUrl.set("https://jetbrains.com")
}
}
}
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
scm {
connection.set("scm:git:https://github.com/cy6erGn0m/kotlinx-uuid.git")
developerConnection.set("scm:git:https://github.com/cy6erGn0m/kotlinx-uuid.git")
url.set("https://github.com/cy6erGn0m/kotlinx-uuid/")
}
}
scm {
connection.set("scm:git:git://example.com/my-library.git")
developerConnection.set("scm:git:ssh://example.com/my-library.git")
url.set("http://example.com/my-library/")
}
}
}
Expand All @@ -86,51 +83,5 @@ allprojects {
}
}
}

afterEvaluate {
convention.findByName("kotlin")?.let { kotlin ->
kotlin as KotlinMultiplatformExtension

kotlin.targets.forEach { target ->
publishing.publications.findByName(target.name)?.let { publication ->
with(publication as org.gradle.api.publish.maven.internal.publication.DefaultMavenPublication) {
version = project.version.toString()

artifact(tasks.getByName("emptyJar")) {
classifier = "javadoc"
}

pom {
name.set("Kotlin UUID library")
description.set(project.description?.takeIf { it.isNotBlank() }
?: "Library for generating and manipulating UUID")
url.set("https://kotlinlang.org")
developers {
developer {
name.set("Sergey Mashkov")
email.set("sergey.mashkov@jetbrains.com")
organization.set("JetBrains s.r.o.")
organizationUrl.set("https://jetbrains.com")
}
}
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
scm {
connection.set("scm:git:git://example.com/my-library.git")
developerConnection.set("scm:git:ssh://example.com/my-library.git")
url.set("http://example.com/my-library/")
}
}
}
}
}
}
}
}
}


1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ buildscript {
}
}

enableFeaturePreview("GRADLE_METADATA")
rootProject.name = "kotlinx-uuid"

include("core")
Expand Down

0 comments on commit bea2f77

Please sign in to comment.