Use kotlin_module not kotlin-module to identify Kotlin module metadata
See gh-16004
This commit is contained in:
committed by
Andy Wilkinson
parent
91a005f578
commit
cb6362df82
@@ -381,7 +381,7 @@ public class Repackager {
|
||||
}
|
||||
if ((entry.getName().startsWith("META-INF/")
|
||||
&& !entry.getName().equals("META-INF/aop.xml")
|
||||
&& !entry.getName().endsWith(".kotlin-module"))
|
||||
&& !entry.getName().endsWith(".kotlin_module"))
|
||||
|| entry.getName().startsWith("BOOT-INF/")
|
||||
|| entry.getName().equals("module-info.class")) {
|
||||
return entry;
|
||||
|
||||
@@ -679,15 +679,15 @@ public class RepackagerTests {
|
||||
public void kotlinModuleMetadataMovesBeneathBootInfClassesWhenRepackaged()
|
||||
throws Exception {
|
||||
this.testJarFile.addClass("A.class", ClassWithMainMethod.class);
|
||||
this.testJarFile.addFile("META-INF/test.kotlin-module",
|
||||
this.temporaryFolder.newFile("test.kotlin-module"));
|
||||
this.testJarFile.addFile("META-INF/test.kotlin_module",
|
||||
this.temporaryFolder.newFile("test.kotlin_module"));
|
||||
File source = this.testJarFile.getFile();
|
||||
File dest = this.temporaryFolder.newFile("dest.jar");
|
||||
Repackager repackager = new Repackager(source);
|
||||
repackager.repackage(dest, NO_LIBRARIES);
|
||||
try (JarFile jarFile = new JarFile(dest)) {
|
||||
assertThat(jarFile.getEntry("META-INF/test.kotlin-module")).isNull();
|
||||
assertThat(jarFile.getEntry("BOOT-INF/classes/META-INF/test.kotlin-module"))
|
||||
assertThat(jarFile.getEntry("META-INF/test.kotlin_module")).isNull();
|
||||
assertThat(jarFile.getEntry("BOOT-INF/classes/META-INF/test.kotlin_module"))
|
||||
.isNotNull();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user