-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use vanniktech/gradle-maven-publish-plugin to publish, and migrate to…
… maven central portal
- Loading branch information
Showing
8 changed files
with
99 additions
and
113 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
67 changes: 0 additions & 67 deletions
67
buildSrc/src/main/kotlin/convention.publication.gradle.kts
This file was deleted.
Oops, something went wrong.
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
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,12 +1,16 @@ | ||
// Kotlin DSL only supports syntax shortcut for plugin inside plugins block, | ||
// but plugins block doesn't support `if` syntax, so we have to stay on groovy. | ||
import com.vanniktech.maven.publish.SonatypeHost | ||
|
||
plugins { | ||
alias libs.plugins.kmp | ||
|
||
id "convention.publication" | ||
alias libs.plugins.vanniktech.mavenPublish | ||
} | ||
|
||
version = Consts.releaseVersion | ||
group = Consts.releaseGroup | ||
|
||
def hostOs = System.getProperty("os.name") | ||
def isMacOS = hostOs == "Mac OS X" | ||
def isWindows = hostOs.startsWith("Windows") | ||
|
@@ -20,7 +24,7 @@ if (isMacOS) { | |
kotlin { | ||
if (isMacOS) { | ||
androidTarget() { | ||
publishLibraryVariants("release", "debug") | ||
publishLibraryVariants("release") | ||
} | ||
|
||
[iosArm64(), iosSimulatorArm64(), iosX64(), macosArm64(), macosX64()].forEach { t -> | ||
|
@@ -71,11 +75,13 @@ kotlin { | |
} | ||
} | ||
} | ||
} | ||
|
||
kotlin.freeCompilerArgs += [ | ||
"-include-binary", | ||
"${project.projectDir}/src/linuxMain/libs/x64/libkmp_xlog.a".toString() | ||
] | ||
compilerOptions { | ||
freeCompilerArgs.addAll([ | ||
"-include-binary", | ||
"${project.projectDir}/src/linuxMain/libs/x64/libkmp_xlog.a".toString() | ||
]) | ||
} | ||
} | ||
} | ||
|
@@ -189,12 +195,13 @@ kotlin { | |
} | ||
} | ||
|
||
applyDefaultHierarchyTemplate() | ||
sourceSets { | ||
if (isMacOS) { | ||
all { | ||
languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi") | ||
} | ||
all { | ||
languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi") | ||
} | ||
|
||
if (isMacOS) { | ||
androidUnitTest { | ||
dependencies { | ||
implementation(libs.kotlin.test) | ||
|
@@ -212,17 +219,17 @@ kotlin { | |
|
||
if (isLinux || isWindows) { | ||
cppCommon { | ||
dependsOn(commonMain.get()) | ||
dependsOn(commonMain) | ||
} | ||
|
||
if (isLinux) { | ||
linuxX64Main { | ||
dependsOn(cppCommon.get()) | ||
dependsOn(cppCommon) | ||
} | ||
} | ||
if (isWindows) { | ||
mingwX64Main { | ||
dependsOn(cppCommon.get()) | ||
dependsOn(cppCommon) | ||
} | ||
} | ||
} | ||
|
@@ -255,3 +262,37 @@ if (isMacOS) { | |
} | ||
} | ||
} | ||
|
||
mavenPublishing { | ||
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) | ||
|
||
signAllPublications() | ||
|
||
coordinates(group, Consts.releaseName, version) | ||
|
||
pom { | ||
name = "kmp-xlog" | ||
description = "KMP wrapper for tencent mars xlog." | ||
inceptionYear = "2022" | ||
url = "https://github.com/HackWebRTC/kmp-xlog" | ||
licenses { | ||
license { | ||
name = "MIT" | ||
url = "https://opensource.org/licenses/MIT" | ||
distribution = "https://opensource.org/licenses/MIT" | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = "Piasy" | ||
name = "Piasy Xu" | ||
url = "[email protected]" | ||
} | ||
} | ||
scm { | ||
url = "https://github.com/HackWebRTC/kmp-xlog" | ||
connection = "scm:git:git://github.com/HackWebRTC/kmp-xlog.git" | ||
developerConnection = "scm:git:git://github.com/HackWebRTC/kmp-xlog.git" | ||
} | ||
} | ||
} |
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,7 +1,6 @@ | ||
#!/bin/bash | ||
|
||
./gradlew publishAllPublicationsToSonatypeRepository closeAndReleaseRepository | ||
./gradlew clean publishAndReleaseToMavenCentral --no-configuration-cache | ||
|
||
# login to https://s01.oss.sonatype.org/ , | ||
# find repository in the 'Staging repositories' section, | ||
# close it and release it | ||
# login to https://central.sonatype.com/publishing/deployments , | ||
# and check the status |