Skip to content

Commit

Permalink
feat: add publishing stuff to build.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
Calvin-LL committed Nov 21, 2023
1 parent cf3f4df commit 5c7b636
Showing 1 changed file with 65 additions and 1 deletion.
66 changes: 65 additions & 1 deletion reorderable/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("maven-publish")
id("signing")
}

group = "sh.calvin.reorderable"
version = "1.0.0"

android {
namespace = "sh.calvin.reorderable"
namespace = project.group.toString()
compileSdk = 34

defaultConfig {
Expand Down Expand Up @@ -34,6 +39,13 @@ android {
kotlinOptions {
jvmTarget = "1.8"
}

publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}

dependencies {
Expand All @@ -42,4 +54,56 @@ dependencies {
implementation("androidx.compose.foundation:foundation")

testImplementation("junit:junit:4.13.2")
}

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]"
}
}
}
}
}
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()
}
}
}
}

signing {
sign(publishing.publications)
}

0 comments on commit 5c7b636

Please sign in to comment.