From e4d4c7580fd91356ffc323e7b94a41497cf45185 Mon Sep 17 00:00:00 2001 From: namnh-0652 Date: Fri, 24 Feb 2023 16:50:24 +0700 Subject: [PATCH] [Modify] Change way to publish --- app/build.gradle | 2 +- attention/build.gradle | 19 ++++--------------- attention/gradle.properties | 4 ++++ core/build.gradle | 19 ++++--------------- core/gradle.properties | 4 ++++ version.gradle | 23 ++++++++++++++--------- 6 files changed, 31 insertions(+), 40 deletions(-) create mode 100644 attention/gradle.properties create mode 100644 core/gradle.properties diff --git a/app/build.gradle b/app/build.gradle index ad6b9c5..f873393 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -36,7 +36,7 @@ android { } dependencies { - implementation 'com.github.namnh-0652.MultipleJitPackLibs:core:1.0.1' + implementation 'com.github.namnh-0652.MultipleJitPackLibs:core:1.0.2' implementation 'com.github.namnh-0652.MultipleJitPackLibs:attention:1.0.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.appcompat:appcompat:1.6.1' diff --git a/attention/build.gradle b/attention/build.gradle index d32c62b..af71274 100644 --- a/attention/build.gradle +++ b/attention/build.gradle @@ -4,7 +4,7 @@ plugins { id 'maven-publish' } apply from: '../version.gradle' -group = libGroupId +group = findProperty('groupId') android { namespace 'com.namnh.libtest.attention' @@ -13,8 +13,8 @@ android { defaultConfig { minSdk 23 targetSdk 33 - versionName attentionVersionName - versionCode attentionVersionCode + versionName = findProperty('versionName') + versionCode = findProperty('versionCode') testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -45,15 +45,4 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } -afterEvaluate { - publishing { - publications { - release(MavenPublication) { - from components.release - groupId = libGroupId - artifactId = 'attention' - version = attentionVersionName - } - } - } -} +with jitpackPublisher diff --git a/attention/gradle.properties b/attention/gradle.properties new file mode 100644 index 0000000..4895417 --- /dev/null +++ b/attention/gradle.properties @@ -0,0 +1,4 @@ +groupId=com.github.namnh-0652.MultipleJitPackLibs +artifactId=attention +versionName=1.0.3 +versionCode=1 diff --git a/core/build.gradle b/core/build.gradle index 2067568..4159abf 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -4,7 +4,7 @@ plugins { id 'maven-publish' } apply from: '../version.gradle' -group = libGroupId +group = findProperty('groupId') android { namespace 'com.namnh.libtest.core' @@ -13,8 +13,8 @@ android { defaultConfig { minSdk 23 targetSdk 33 - versionName coreVersionName - versionCode coreVersionCode + versionName = findProperty('versionName') + versionCode = findProperty('versionCode') testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -45,15 +45,4 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } -afterEvaluate { - publishing { - publications { - release(MavenPublication) { - from components.release - groupId = libGroupId - artifactId = 'core' - version = coreVersionName - } - } - } -} +with jitpackPublisher \ No newline at end of file diff --git a/core/gradle.properties b/core/gradle.properties new file mode 100644 index 0000000..ae08cc5 --- /dev/null +++ b/core/gradle.properties @@ -0,0 +1,4 @@ +groupId=com.github.namnh-0652.MultipleJitPackLibs +artifactId=core +versionName=1.0.3 +versionCode=1 diff --git a/version.gradle b/version.gradle index 9661f78..67e7cda 100644 --- a/version.gradle +++ b/version.gradle @@ -1,9 +1,14 @@ -ext { - coreVersionName = "1.0.2" - coreVersionCode = 1 - - attentionVersionName = "1.0.1" - attentionVersionCode = 1 - - libGroupId = 'com.github.namnh-0652.MultipleJitPackLibs' -} \ No newline at end of file +ext.jitpackPublisher = { + afterEvaluate { + publishing { + publications { + release(MavenPublication) { + from components.release + groupId = findProperty('groupId') + artifactId = findProperty('artifactId') + version = findProperty('versionName') + } + } + } + } +}