From 6008bd31b1e43a5bf6a39f3d50d1f213bc50ec1a Mon Sep 17 00:00:00 2001 From: sagar Date: Fri, 17 May 2024 15:59:39 +0530 Subject: [PATCH] publish-module.gradle updated --- scripts/publish-module.gradle | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/publish-module.gradle b/scripts/publish-module.gradle index 5dfd30d..3825e7b 100644 --- a/scripts/publish-module.gradle +++ b/scripts/publish-module.gradle @@ -1,12 +1,14 @@ apply plugin: 'maven-publish' apply plugin: 'signing' -task androidSourcesJar(type: Jar) { +tasks.register('androidSourcesJar', Jar) { archiveClassifier.set('sources') if (project.plugins.findPlugin("com.android.library")) { + from android.sourceSets.main.kotlin.srcDirs from android.sourceSets.main.java.srcDirs } else { from sourceSets.main.java.srcDirs + from sourceSets.main.kotlin.srcDirs } } @@ -22,6 +24,7 @@ afterEvaluate { publications { release(MavenPublication) { // The coordinates of the library, being set from variables that + tasks.named("generateMetadataFileForReleasePublication").configure { dependsOn("androidSourcesJar") } // we'll set up later groupId PUBLISH_GROUP_ID artifactId PUBLISH_ARTIFACT_ID @@ -31,10 +34,11 @@ afterEvaluate { if (project.plugins.findPlugin("com.android.library")) { from components.release } else { - artifact("$buildDir/libs/${project.getName()}-${version}.jar") + from components.java +// artifact("$buildDir/libs/${project.getName()}-${version}.jar") } - artifact androidSourcesJar +// artifact androidSourcesJar // Mostly self-explanatory metadata pom {