< prev index next >

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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 57,70 **** import java.util.Set; import static java.util.stream.Collectors.*; import jdk.tools.jlink.internal.BasicImageWriter; 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; import jdk.tools.jlink.plugin.PluginException; /** * * Default Image Builder. This builder creates the default runtime image layout. --- 57,70 ---- import java.util.Set; import static java.util.stream.Collectors.*; import jdk.tools.jlink.internal.BasicImageWriter; import jdk.tools.jlink.internal.ExecutableImage; + import jdk.tools.jlink.internal.Platform; import jdk.tools.jlink.plugin.ResourcePool; import jdk.tools.jlink.plugin.ResourcePoolEntry; import jdk.tools.jlink.plugin.ResourcePoolEntry.Type; import jdk.tools.jlink.plugin.PluginException; /** * * Default Image Builder. This builder creates the default runtime image layout.
*** 131,141 **** private final Path root; private final Map<String, String> launchers; private final Path mdir; private final Set<String> modules = new HashSet<>(); ! private String targetOsName; /** * Default image builder constructor. * * @param root The image root directory. --- 131,141 ---- private final Path root; private final Map<String, String> launchers; private final Path mdir; private final Set<String> modules = new HashSet<>(); ! private Platform targetPlatform; /** * Default image builder constructor. * * @param root The image root directory.
*** 149,163 **** } @Override public void storeFiles(ResourcePool files) { try { ! this.targetOsName = files.moduleView(). ! findModule("java.base").get().osName(); ! if (this.targetOsName == null) { throw new PluginException("ModuleTarget attribute is missing for java.base module"); } checkResourcePool(files); Path bin = root.resolve(BIN_DIRNAME); --- 149,165 ---- } @Override public void storeFiles(ResourcePool files) { try { ! String targetOsName = files.moduleView() ! .findModule("java.base").get() ! .osName(); ! if (targetOsName == null) { throw new PluginException("ModuleTarget attribute is missing for java.base module"); } + this.targetPlatform = Platform.toPlatform(targetOsName); checkResourcePool(files); Path bin = root.resolve(BIN_DIRNAME);
*** 474,484 **** return LIB_DIRNAME; } } private boolean isWindows() { ! return targetOsName.startsWith("Windows"); } /** * chmod ugo+x file */ --- 476,486 ---- return LIB_DIRNAME; } } private boolean isWindows() { ! return targetPlatform == Platform.WINDOWS; } /** * chmod ugo+x file */
< prev index next >