Skip to content

Commit

Permalink
Ensure correct compiled output and sources are included in multi vers…
Browse files Browse the repository at this point in the history
…ion jar (#5487)
  • Loading branch information
jack-berg authored Jun 2, 2023
1 parent 97415aa commit e637e51
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sdk/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,17 @@ for (version in mrJarVersions) {

tasks {
withType(Jar::class) {
val sourcePathProvider = if (name.equals("jar")) {
{ ss: SourceSet? -> ss?.output }
} else if (name.equals("sourcesJar")) {
{ ss: SourceSet? -> ss?.java }
} else {
{ _: SourceSet -> project.objects.fileCollection() }
}

for (version in mrJarVersions) {
into("META-INF/versions/$version") {
from(sourceSets["java$version"].output)
from(sourcePathProvider(sourceSets["java$version"]))
}
}
manifest.attributes(
Expand Down

0 comments on commit e637e51

Please sign in to comment.