Ensure correct compiled output and sources are included in multi version jar (#5487)
This commit is contained in:
		
							parent
							
								
									97415aaf7c
								
							
						
					
					
						commit
						e637e5121a
					
				|  | @ -63,9 +63,17 @@ for (version in mrJarVersions) { | ||||||
| 
 | 
 | ||||||
| tasks { | tasks { | ||||||
|   withType(Jar::class) { |   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) { |     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( | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue