diff --git a/build.gradle.kts b/build.gradle.kts index 4348480..9aee112 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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 } diff --git a/gradle.properties b/gradle.properties index 20e2a01..769b321 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 \ No newline at end of file +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:git@github.com:monstar-lab-oss/android-lib-template.git +POM_SCM_CONNECTION=scm:git@github.com:monstar-lab-oss/android-lib-template.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:monstar-lab-oss/android-lib-template.git + +POM_DEVELOPER_ID=Monstarlab +POM_DEVELOPER_NAME=Monstarlab +POM_DEVELOPER_EMAIL=sonatype@monstar-lab.com +POM_DEVELOPER_URL=https://github.com/monstar-lab-oss \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a13a9f4..f90d484 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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" } @@ -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"} diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index 10e7867..c82350e 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -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 { @@ -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) diff --git a/lib/gradle.properties b/lib/gradle.properties new file mode 100644 index 0000000..b3f8c25 --- /dev/null +++ b/lib/gradle.properties @@ -0,0 +1,5 @@ +POM_NAME=Test Library +POM_DESCRIPTION=Test Library +POM_INCEPTION_YEAR=2024 +POM_ARTIFACT_ID=lib +POM_PACKAGING=aar