Skip to content

Commit 097eebb

Browse files
author
Adil Hussain
committed
Added a android.publishing block which takes of including the sources in the publication.
1 parent 6e0d627 commit 097eebb

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

library/build.gradle

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ android {
5050
abortOnError true
5151
}
5252

53+
publishing {
54+
multipleVariants {
55+
allVariants()
56+
withJavadocJar()
57+
withSourcesJar()
58+
}
59+
}
60+
5361
testOptions {
5462
unitTests.all {
5563
useJUnitPlatform()
@@ -72,13 +80,6 @@ dependencies {
7280
androidTestImplementation 'androidx.test:rules:1.5.0'
7381
}
7482

75-
task generateSourcesJar(type: Jar) {
76-
from android.sourceSets.main.java.srcDirs
77-
archiveClassifier.set('sources')
78-
description = "Builds up a jar of this module's sources."
79-
group = 'build'
80-
}
81-
8283
task generateJavadocJar(type: Jar) {
8384
from dokkaJavadoc
8485
archiveClassifier.set("javadoc")
@@ -92,7 +93,6 @@ afterEvaluate {
9293
release(MavenPublication) {
9394
from components.release
9495
artifact generateJavadocJar
95-
// artifact generateSourcesJar
9696

9797
groupId getProperty('projectGroupName')
9898
artifactId getProperty('projectArtifactName')
@@ -129,7 +129,6 @@ afterEvaluate {
129129
debug(MavenPublication) {
130130
from components.debug
131131
artifact generateJavadocJar
132-
// artifact generateSourcesJar
133132

134133
groupId getProperty('projectGroupName')
135134
artifactId getProperty('projectArtifactName')

0 commit comments

Comments
 (0)