fix bootstrap addon packaging

This commit is contained in:
dfsek 2021-11-22 09:02:54 -07:00
parent c29dac9847
commit 1c9724c232
2 changed files with 4 additions and 1 deletions

View File

@ -57,7 +57,9 @@ fun Project.configureDistribution() {
val jar = (addonProject.tasks.named("jar").get() as Jar)
println("Packaging addon ${jar.archiveFileName.get()} to ${dest.absolutePath}.")
val entry = ZipEntry("addons/${jar.archiveFileName.get()}")
val boot = if(addonProject.project.extra.has("bootstrap") && addonProject.project.extra.get("bootstrap") as Boolean) "bootstrap/" else ""
val entry = ZipEntry("addons/$boot${jar.archiveFileName.get()}")
zip.putNextEntry(entry)
FileInputStream(jar.archiveFile.get().asFile).copyTo(zip)
zip.closeEntry()

View File

@ -150,6 +150,7 @@ public abstract class AbstractPlatform implements Platform {
} catch(IOException e) {
throw new UncheckedIOException(e);
}
logger.debug("Copying resource {}", resourcePath);
try(InputStream is = getClass().getResourceAsStream("/" + resourcePath);
OutputStream os = new FileOutputStream(resource)) {
IOUtils.copy(is, os);