Ensure .class files aren't present in the resources library MR jar (#9245)

This commit is contained in:
Mateusz Rzeszutek 2023-08-18 11:25:03 +02:00 committed by GitHub
parent 23c20dadaf
commit 6ac134b19f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -50,9 +50,17 @@ for (version in mrJarVersions) {
tasks { tasks {
withType(Jar::class) { withType(Jar::class) {
val sourcePathProvider = if (name == "jar") {
{ ss: SourceSet? -> ss?.output }
} else if (name == "sourcesJar") {
{ ss: SourceSet? -> ss?.java }
} else {
{ project.objects.fileCollection() }
}
for (version in mrJarVersions) { for (version in mrJarVersions) {
into("META-INF/versions/$version") { into("META-INF/versions/$version") {
from(sourceSets["java$version"].output) from(sourcePathProvider(sourceSets["java$version"]))
} }
} }
manifest.attributes( manifest.attributes(