Skip to content

Commit e9a74cd

Browse files
committed
Use the existing Gradle task to generate sources
Signed-off-by: Aayush Gupta <[email protected]>
1 parent bf6aa2b commit e9a74cd

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

build.gradle.kts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ allprojects {
2222
toolchain {
2323
languageVersion.set(JavaLanguageVersion.of(11))
2424
}
25+
withSourcesJar()
2526
}
2627

2728
version = "v0.24.8"
@@ -52,13 +53,6 @@ subprojects {
5253
}
5354
}
5455

55-
// sourcesJar task
56-
val sourcesJar by tasks.registering(Jar::class) {
57-
dependsOn("classes")
58-
archiveClassifier.set("sources")
59-
from(provider { the<JavaPluginExtension>().sourceSets["main"].allSource })
60-
}
61-
6256
// Prevent .proto files ending up in JARs
6357
tasks.withType<Jar>().configureEach {
6458
exclude("**/*.proto")
@@ -73,11 +67,6 @@ subprojects {
7367
exceptionFormat = TestExceptionFormat.FULL
7468
}
7569
}
76-
77-
// Register sources JAR as artifact
78-
artifacts {
79-
add("archives", sourcesJar)
80-
}
8170
}
8271

8372
// https://discuss.gradle.org/t/best-approach-gradle-multi-module-project-generate-just-one-global-javadoc/18657/21

0 commit comments

Comments
 (0)