Write native-image argfile only if there are excludes

Refactors duplicate logic in BootZipCopyAction and Packager into
separate classes.

Closes gh-33363

Co-authored-by: Phillip Webb <pwebb@vmware.com>
This commit is contained in:
Moritz Halbritter
2022-11-30 14:29:09 +01:00
parent 276b288891
commit c6536c54d8
7 changed files with 275 additions and 46 deletions

View File

@@ -201,6 +201,13 @@ class BootJarTests extends AbstractBootArchiveTests<BootJar> {
}
}
@Test
void nativeImageArgFileIsNotWrittenWhenExcludesAreEmpty() throws IOException {
try (JarFile jarFile = new JarFile(createLayeredJar(false))) {
assertThat(jarFile.getEntry("META-INF/native-image/argfile")).isNull();
}
}
@Test
void javaVersionIsWrittenToManifest() throws IOException {
try (JarFile jarFile = new JarFile(createPopulatedJar())) {