Skip to content

Commit

Permalink
publish-module.gradle updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar authored and sagar committed May 17, 2024
1 parent b7aaaab commit 6008bd3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/publish-module.gradle
Original file line number Diff line number Diff line change
@@ -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
}
}

Expand All @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 6008bd3

Please sign in to comment.