From 2f1be43a64f459eb762e01a61b70b3bb6ce5a8a1 Mon Sep 17 00:00:00 2001 From: Radhika Canopas Date: Mon, 14 Aug 2023 16:48:45 +0530 Subject: [PATCH] Minor fix --- countrypicker/build.gradle | 2 +- scripts/publish-module.gradle | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/countrypicker/build.gradle b/countrypicker/build.gradle index 3597eeb..0c65ea5 100644 --- a/countrypicker/build.gradle +++ b/countrypicker/build.gradle @@ -5,7 +5,7 @@ plugins { ext { PUBLISH_GROUP_ID = 'com.canopas.jetcountrypicker' - PUBLISH_VERSION = '1.0.8' + PUBLISH_VERSION = '1.0.8-alpha01' PUBLISH_ARTIFACT_ID = 'jetcountrypicker' } apply from: "${rootDir}/scripts/publish-module.gradle" diff --git a/scripts/publish-module.gradle b/scripts/publish-module.gradle index 0b454ee..7089e6a 100644 --- a/scripts/publish-module.gradle +++ b/scripts/publish-module.gradle @@ -4,7 +4,15 @@ apply plugin: 'signing' task androidSourcesJar(type: Jar) { archiveClassifier.set('sources') - from android.sourceSets.main.java.srcDirs + if (project.plugins.findPlugin("com.android.library")) { + from android.sourceSets.main.java.srcDirs + } else { + from sourceSets.main.java.srcDirs + } +} + +artifacts { + archives androidSourcesJar } group = PUBLISH_GROUP_ID @@ -20,14 +28,13 @@ afterEvaluate { artifactId PUBLISH_ARTIFACT_ID version PUBLISH_VERSION artifact androidSourcesJar - /// Two artifacts, the `aar` (or `jar`) and the sources - // if (project.plugins.findPlugin("com.android.library")) { - from components.release - // } else { - // artifact("$buildDir/libs/${project.getName()}-${version}.jar") - // } + // Two artifacts, the `aar` (or `jar`) and the sources + if (project.plugins.findPlugin("com.android.library")) { + } else { + artifact("$buildDir/libs/${project.getName()}-${version}.jar") + } - // artifact androidSourcesJar + artifact androidSourcesJar // Mostly self-explanatory metadata pom {