Skip to content

Commit

Permalink
Update androidx.build.publishing.gradle
Browse files Browse the repository at this point in the history
add sources zip generation
  • Loading branch information
camaelon committed May 4, 2021
1 parent 6c763e7 commit 57c0db8
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,22 @@ publishing {
}
}

task androidSourceJar(type: Jar) {
if (project.hasProperty('android')) {
from android.sourceSets.main.java.srcDirs
archiveClassifier.set('sources')
}
}

components.configureEach {component ->
if (component.name in ['release', 'java']) {
publishing.publications {
maven(MavenPublication) {
from component
artifactId aid
if (project.hasProperty('android')) {
artifact androidSourceJar
}
}
}
}
Expand Down

0 comments on commit 57c0db8

Please sign in to comment.