Ensure correct compiled output and sources are included in multi version jar (#5487)

This commit is contained in:
jack-berg 2023-06-02 12:34:42 -05:00 committed by GitHub
parent 97415aaf7c
commit e637e5121a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -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(