From 819c10e88387ff4d42c2e0b10b4ad69e9291082a Mon Sep 17 00:00:00 2001 From: Rajinikanth Date: Sat, 8 Apr 2023 02:29:02 +0530 Subject: [PATCH] TP-24174 | upload to nexus --- .github/workflows/android_build.yml | 4 +++- gradle.properties | 3 ++- navi-uitron/build.gradle | 27 +++++++++++++++++++++++++++ settings.gradle | 14 ++++++++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android_build.yml b/.github/workflows/android_build.yml index ec5efe6..94dc504 100644 --- a/.github/workflows/android_build.yml +++ b/.github/workflows/android_build.yml @@ -29,4 +29,6 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Assemble with Stacktrace - run: ./gradlew assembleDebug --stacktrace \ No newline at end of file + run: ./gradlew assembleDebug --stacktrace + - name: Upload to nexus + run: ./gradlew publish -PNEXUS_URL=https://nexus.cmd.navi-tech.in/repository/maven-snapshots -PNEXUS_USERNAME=nexus-user -PNEXUS_PASSWORD=nexus-user; fi; \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 3c5031e..d853dff 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,4 +20,5 @@ 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 +android.disableAutomaticComponentCreation=true \ No newline at end of file diff --git a/navi-uitron/build.gradle b/navi-uitron/build.gradle index 8bd97d7..bbbefcd 100644 --- a/navi-uitron/build.gradle +++ b/navi-uitron/build.gradle @@ -2,8 +2,11 @@ plugins { id 'com.android.library' id 'org.jetbrains.kotlin.android' id 'kotlin-parcelize' + id 'maven-publish' } +def VERSION_NAME = "1.0.0" + android { namespace 'com.navi.uitron' compileSdk 32 @@ -37,6 +40,30 @@ android { } } +publishing { + repositories { + if (project.hasProperty('NEXUS_URL')) { + maven { + url = "$NEXUS_URL" + credentials { + username = "$NEXUS_USERNAME" + password = "$NEXUS_PASSWORD" + } + } + } + } + publications { + if (project.hasProperty('NEXUS_URL')) { + maven(MavenPublication) { + artifactId = "uitron" + groupId = "com.navi.medici" + version = "navi_v$VERSION_NAME-SNAPSHOT" + artifact("build/outputs/aar/navi-uitron-debug.aar") + } + } + } +} + dependencies { implementation "androidx.compose.ui:ui:1.2.0-beta03" implementation "androidx.compose.material:material:1.2.0-beta03" diff --git a/settings.gradle b/settings.gradle index 94b5285..8d05981 100644 --- a/settings.gradle +++ b/settings.gradle @@ -12,6 +12,20 @@ dependencyResolutionManagement { google() mavenCentral() maven { url 'https://jitpack.io' } + maven { + credentials { + username 'nexus-user' + password 'nexus-user' + } + url "https://nexus.cmd.navi-tech.in/repository/maven-snapshots" + } + maven { + credentials { + username 'nexus-user' + password 'nexus-user' + } + url "https://nexus.cmd.navi-tech.in/repository/maven-releases" + } } } rootProject.name = "UiTron"