Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e9b247e

Browse files
Advertise source jars for JVM-only libraries (#4394)
Original implementation: https://github.com/vanniktech/gradle-maven-publish-plugin/blob/f22bd35c84c3df28700db4ca3de11d5b78a29fde/plugin/src/main/kotlin/com/vanniktech/maven/publish/Platform.kt#L472 Thanks, @vanniktech! The issue with the replaced implementation is that it only packs the jar, without registering the publication variant. Checking the sources of `java { withSourcesJar() }`, we see the corresponding logic, but given that we can instead invoke it directly, no need to reimplement it. Fixes #4112
1 parent 6baf7c8 commit e9b247e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

‎buildSrc/src/main/kotlin/pub-conventions.gradle.kts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,11 @@ publishing {
2222
apply(plugin = "java-library")
2323

2424
// MPP projects pack their sources automatically, java libraries need to explicitly pack them
25-
val sources = tasks.register("sourcesJar", Jar::class) {
26-
archiveClassifier = "sources"
27-
from(sourceSets.named("main").get().allSource)
28-
}
25+
project.extensions.getByType(JavaPluginExtension::class.java).withSourcesJar()
2926

3027
publications {
3128
register("mavenJava", MavenPublication::class) {
3229
from(components["java"])
33-
artifact(sources)
3430
}
3531
}
3632
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /