Skip to content

Commit

Permalink
build: add publishig configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
levinzonr committed Apr 2, 2024
1 parent f262ebf commit 870eb02
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ plugins {
alias(libs.plugins.spotless)
alias(libs.plugins.detekt) apply false
alias(libs.plugins.kotlin.dokka)
alias(libs.plugins.gradle.maven.publish) apply false
}


Expand Down
24 changes: 23 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,26 @@ 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


GROUP=io.monstarlab.test
VERSION_NAME=0.0.1

POM_NAME=Test
POM_DESCRIPTION=Library descriptiomn
POM_INCEPTION_YEAR=2024
POM_URL=https://github.com/monstar-lab-oss/android-lib-template

POM_LICENSE_NAME=MIT License
POM_LICENSE_URL=https://raw.githubusercontent.com/monstar-lab-oss/android-lib-template/main/LICENSE
POM_LICENSE_DIST=repo

POM_SCM_URL=scm:[email protected]:monstar-lab-oss/android-lib-template.git
POM_SCM_CONNECTION=scm:[email protected]:monstar-lab-oss/android-lib-template.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:monstar-lab-oss/android-lib-template.git

POM_DEVELOPER_ID=Monstarlab
POM_DEVELOPER_NAME=Monstarlab
POM_DEVELOPER_EMAIL=[email protected]
POM_DEVELOPER_URL=https://github.com/monstar-lab-oss
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ activityCompose = "1.8.2"
composeBom = "2024.02.00"
spotless="6.25.0"
detekt="1.23.5"
gradle-maven-publsih ="0.28.0"


[libraries]
android_gradle_plugin = { module = "com.android.tools.build:gradle", version.ref = "agp" }
Expand Down Expand Up @@ -38,6 +40,7 @@ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-dokka = { id = "org.jetbrains.dokka", version.ref = "kotlin" }
monstarlab-application = { id = "io.monstarlab.application", version = "undefined" }
monstarlab-library = { id = "io.monstarlab.library", version = "undefined" }
gradle-maven-publish = {id = "com.vanniktech.maven.publish", version.ref = "gradle-maven-publsih"}



11 changes: 11 additions & 0 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
import com.vanniktech.maven.publish.SonatypeHost

plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.monstarlab.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.gradle.maven.publish)
}

android {
Expand All @@ -24,6 +28,13 @@ kotlin {
jvmToolchain(17)
}

mavenPublishing {
configure(AndroidSingleVariantLibrary("release"))
publishToMavenCentral(SonatypeHost.S01)
signAllPublications()
}


dependencies {
implementation(libs.androidx.core.ktx)
androidTestImplementation(libs.androidx.junit)
Expand Down
5 changes: 5 additions & 0 deletions lib/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
POM_NAME=Test Library
POM_DESCRIPTION=Test Library
POM_INCEPTION_YEAR=2024
POM_ARTIFACT_ID=lib
POM_PACKAGING=aar

0 comments on commit 870eb02

Please sign in to comment.