Skip to content

Commit

Permalink
fix publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Calvin-LL committed Feb 5, 2024
1 parent 487029d commit 962dc34
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 50 deletions.
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ plugins {
id("org.jetbrains.kotlin.multiplatform") version "1.9.21" apply false
id("com.android.library") version "8.2.2" apply false
id("org.jetbrains.compose") version "1.5.11" apply false
id("org.jetbrains.dokka") version "1.9.10" apply false
id("com.vanniktech.maven.publish") version "0.27.0" apply false
}
6 changes: 5 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true

# https://vanniktech.github.io/gradle-maven-publish-plugin/central/#configuring-maven-central
SONATYPE_HOST=S01
RELEASE_SIGNING_ENABLED=true
74 changes: 25 additions & 49 deletions reorderable/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ plugins {
id("com.android.library")
id("org.jetbrains.kotlin.multiplatform")
id("org.jetbrains.compose")
id("maven-publish")
id("signing")
id("org.jetbrains.dokka")
id("com.vanniktech.maven.publish")
}

group = "sh.calvin.reorderable"
Expand All @@ -30,8 +30,7 @@ kotlin {
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.material3)
@OptIn(ExperimentalComposeLibrary::class)
implementation(compose.components.resources)
@OptIn(ExperimentalComposeLibrary::class) implementation(compose.components.resources)
}

commonTest.dependencies {
Expand Down Expand Up @@ -88,54 +87,31 @@ android {
}
}

publishing {
publications {
register<MavenPublication>("release") {
groupId = project.group.toString()
artifactId = "reorderable"
version = project.version.toString()
afterEvaluate {
from(components["release"])
}

pom {
name = "Reorderable"
description = "A library for reordering items in a LazyColumn"
url = "https://github.com/Calvin-LL/Reorderable"

licenses {
license {
name = "The Apache Software License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "repo"
}
}
scm {
connection = "scm:git:git://github.com/Calvin-LL/Reorderable.git"
developerConnection = "scm:git:ssh://github.com/Calvin-LL/Reorderable.git"
url = "https://github.com/Calvin-LL/Reorderable"
}
developers {
developer {
name = "Calvin Liang"
email = "[email protected]"
}
}
mavenPublishing {
pom {
name = "Reorderable"
description = "A library for reordering items in a LazyColumn"
url = "https://github.com/Calvin-LL/Reorderable"
inceptionYear = "2023"

licenses {
license {
name = "The Apache Software License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
}
repositories {
maven {
name = "sonatype"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.properties["ossrhUsername"].toString()
password = project.properties["ossrhPassword"].toString()
scm {
connection = "scm:git:git://github.com/Calvin-LL/Reorderable.git"
developerConnection = "scm:git:ssh://github.com/Calvin-LL/Reorderable.git"
url = "https://github.com/Calvin-LL/Reorderable"
}
developers {
developer {
name = "Calvin Liang"
email = "[email protected]"
url = "https://calvin.sh"
}
}
}
}

signing {
sign(publishing.publications)
}

0 comments on commit 962dc34

Please sign in to comment.