< prev index next >

src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java

Print this page

        

*** 56,66 **** import java.util.Properties; import java.util.Set; import static java.util.stream.Collectors.*; import jdk.tools.jlink.internal.BasicImageWriter; - import jdk.tools.jlink.internal.plugins.FileCopierPlugin.SymImageFile; import jdk.tools.jlink.internal.ExecutableImage; import jdk.tools.jlink.plugin.ResourcePool; import jdk.tools.jlink.plugin.ResourcePoolEntry; import jdk.tools.jlink.plugin.ResourcePoolEntry.Type; import jdk.tools.jlink.plugin.ResourcePoolModule; --- 56,65 ----
*** 147,170 **** this.root = root; this.mdir = root.resolve("lib"); Files.createDirectories(mdir); } - private void storeRelease(ResourcePool pool) throws IOException { - Properties props = new Properties(); - Optional<ResourcePoolEntry> release = pool.findEntry("/java.base/release"); - if (release.isPresent()) { - try (InputStream is = release.get().content()) { - props.load(is); - } - } - File r = new File(root.toFile(), "release"); - try (FileOutputStream fo = new FileOutputStream(r)) { - props.store(fo, null); - } - } - @Override public void storeFiles(ResourcePool files) { try { // populate targetOsName field up-front because it's used elsewhere. Optional<ResourcePoolModule> javaBase = files.moduleView().findModule("java.base"); --- 146,155 ----
*** 178,190 **** if (this.targetOsName == null) { throw new PluginException("TargetPlatform attribute is missing for java.base module"); } - // store 'release' file - storeRelease(files); - Path bin = root.resolve(BIN_DIRNAME); // check any duplicated resource files Map<Path, Set<String>> duplicates = new HashMap<>(); files.entries() --- 163,172 ----
*** 371,382 **** return Paths.get(MAN_DIRNAME, entryToFileName(entry)); case LEGAL_NOTICE: return Paths.get(LEGAL_DIRNAME, entryToFileName(entry)); case TOP: return Paths.get(entryToFileName(entry)); - case OTHER: - return Paths.get("other", entryToFileName(entry)); default: throw new IllegalArgumentException("invalid type: " + entry); } } --- 353,362 ----
*** 410,432 **** Path relPath = source.getParent().relativize(target); writeSymLinkEntry(root.resolve(source), relPath); } break; case TOP: ! break; ! case OTHER: ! String filename = entryToFileName(file); ! if (file instanceof SymImageFile) { ! SymImageFile sym = (SymImageFile) file; ! Path target = root.resolve(sym.getTargetPath()); ! if (!Files.exists(target)) { ! throw new IOException("Sym link target " + target ! + " doesn't exist"); ! } ! writeSymEntry(root.resolve(filename), target); ! } else { ! writeEntry(in, root.resolve(filename)); } break; default: throw new InternalError("unexpected entry: " + file.path()); } --- 390,402 ---- Path relPath = source.getParent().relativize(target); writeSymLinkEntry(root.resolve(source), relPath); } break; case TOP: ! // Copy TOP files of the "java.base" module (only) ! if ("java.base".equals(file.moduleName())) { ! writeEntry(in, root.resolve(entryToImagePath(file))); } break; default: throw new InternalError("unexpected entry: " + file.path()); }
< prev index next >