-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch publishing to gradle-maven-publish plugin
- Loading branch information
Showing
6 changed files
with
73 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
VERSION_NAME=2.0.0-beta13 | ||
|
||
kotlin.mpp.stability.nowarn=true | ||
|
||
# gradle-maven-publish configuration | ||
SONATYPE_HOST=DEFAULT | ||
RELEASE_SIGNING_ENABLED=true | ||
GROUP=com.github.ajalt.mordant | ||
POM_DESCRIPTION=Colorful multiplatform styling Kotlin for command-line applications | ||
POM_INCEPTION_YEAR=2018 | ||
POM_URL=https://github.com/ajalt/mordant/ | ||
POM_LICENCE_NAME=Apache-2.0 | ||
POM_LICENCE_URL=https://www.apache.org/licenses/LICENSE-2.0 | ||
POM_LICENSE_DIST=repo | ||
POM_SCM_URL=https://github.com/ajalt/ | ||
POM_SCM_CONNECTION=scm:git:git://github.com/ajalt/mordant.git | ||
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/ajalt/mordant.git | ||
POM_DEVELOPER_ID=ajalt | ||
POM_DEVELOPER_NAME=AJ Alt | ||
POM_DEVELOPER_URL=https://github.com/ajalt/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,8 @@ | ||
@file:Suppress("UNUSED_VARIABLE") | ||
@file:Suppress("UNUSED_VARIABLE", "KotlinRedundantDiagnosticSuppress") // https://youtrack.jetbrains.com/issue/KT-38871 | ||
|
||
import org.jetbrains.dokka.base.DokkaBase | ||
import org.jetbrains.dokka.base.DokkaBaseConfiguration | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
@Suppress("DSL_SCOPE_VIOLATION") // https://youtrack.jetbrains.com/issue/KTIJ-19369 | ||
plugins { | ||
kotlin("multiplatform") | ||
alias(libs.plugins.dokka) | ||
id("maven-publish") | ||
id("signing") | ||
} | ||
|
||
|
||
buildscript { | ||
dependencies { | ||
classpath(libs.dokka.base) | ||
} | ||
alias(libs.plugins.publish) | ||
} | ||
|
||
kotlin { | ||
|
@@ -64,86 +50,3 @@ kotlin { | |
} | ||
} | ||
} | ||
|
||
tasks.withType<KotlinCompile>().configureEach { | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
|
||
tasks.dokkaHtml.configure { | ||
outputDirectory.set(rootDir.resolve("docs/api")) | ||
pluginConfiguration<DokkaBase, DokkaBaseConfiguration> { | ||
footerMessage = "Copyright © 2022 AJ Alt" | ||
} | ||
dokkaSourceSets { | ||
configureEach { | ||
reportUndocumented.set(false) | ||
skipDeprecated.set(true) | ||
} | ||
} | ||
} | ||
|
||
val emptyJavadocJar by tasks.registering(Jar::class) { | ||
archiveClassifier.set("javadoc") | ||
} | ||
|
||
|
||
val isSnapshot = version.toString().endsWith("SNAPSHOT") | ||
val signingKey: String? by project | ||
val SONATYPE_USERNAME: String? by project | ||
val SONATYPE_PASSWORD: String? by project | ||
|
||
publishing { | ||
publications.withType<MavenPublication>().all { | ||
pom { | ||
description.set("Colorful multiplatform styling Kotlin for command-line applications") | ||
name.set("Mordant") | ||
url.set("https://github.com/ajalt/mordant") | ||
scm { | ||
url.set("https://github.com/ajalt/mordant") | ||
connection.set("scm:git:git://github.com/ajalt/mordant.git") | ||
developerConnection.set("scm:git:ssh://[email protected]/ajalt/mordant.git") | ||
} | ||
licenses { | ||
license { | ||
name.set("The Apache Software License, Version 2.0") | ||
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") | ||
distribution.set("repo") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("ajalt") | ||
name.set("AJ Alt") | ||
url.set("https://github.com/ajalt") | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
val releaseUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") | ||
val snapshotUrl = uri("https://oss.sonatype.org/content/repositories/snapshots") | ||
maven { | ||
url = if (isSnapshot) snapshotUrl else releaseUrl | ||
credentials { | ||
username = SONATYPE_USERNAME ?: "" | ||
password = SONATYPE_PASSWORD ?: "" | ||
} | ||
} | ||
} | ||
|
||
publications.withType<MavenPublication>().all { | ||
artifact(emptyJavadocJar.get()) | ||
} | ||
} | ||
|
||
signing { | ||
isRequired = !isSnapshot | ||
|
||
if (signingKey != null && !isSnapshot) { | ||
useInMemoryPgpKeys(signingKey, "") | ||
sign(publishing.publications) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
POM_ARTIFACT_ID=mordant | ||
POM_NAME=Mordant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters