src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java
branchJDK-8200758-branch
changeset 57450 82c78b40b39d
parent 57446 5a5b85f00a63
child 57789 9280ca6669a2
equal deleted inserted replaced
57448:ac7b7fe5f7d8 57450:82c78b40b39d
    55     private static final String LIBRARY_NAME = "libapplauncher.so";
    55     private static final String LIBRARY_NAME = "libapplauncher.so";
    56 
    56 
    57     private final Path root;
    57     private final Path root;
    58     private final Path appDir;
    58     private final Path appDir;
    59     private final Path appModsDir;
    59     private final Path appModsDir;
    60     private final String relativeModsDir;
       
    61     private final Path runtimeDir;
    60     private final Path runtimeDir;
    62     private final Path binDir;
    61     private final Path binDir;
    63     private final Path mdir;
    62     private final Path mdir;
    64 
    63 
    65     private final Map<String, ? super Object> params;
    64     private final Map<String, ? super Object> params;
    87         Objects.requireNonNull(imageOutDir);
    86         Objects.requireNonNull(imageOutDir);
    88 
    87 
    89         this.root = imageOutDir.resolve(APP_NAME.fetchFrom(config));
    88         this.root = imageOutDir.resolve(APP_NAME.fetchFrom(config));
    90         this.appDir = root.resolve("app");
    89         this.appDir = root.resolve("app");
    91         this.appModsDir = appDir.resolve("mods");
    90         this.appModsDir = appDir.resolve("mods");
    92         this.relativeModsDir = "app/mods";
       
    93         this.runtimeDir = root.resolve("runtime");
    91         this.runtimeDir = root.resolve("runtime");
    94         this.binDir = root.resolve("bin");
    92         this.binDir = root.resolve("bin");
    95         this.mdir = runtimeDir.resolve("lib");
    93         this.mdir = runtimeDir.resolve("lib");
    96         this.params = new HashMap<>();
    94         this.params = new HashMap<>();
    97         config.entrySet().stream().forEach(e -> params.put(
    95         config.entrySet().stream().forEach(e -> params.put(
   107         Objects.requireNonNull(imageOutDir);
   105         Objects.requireNonNull(imageOutDir);
   108 
   106 
   109         this.root = imageOutDir.resolve(appName);
   107         this.root = imageOutDir.resolve(appName);
   110         this.appDir = null;
   108         this.appDir = null;
   111         this.appModsDir = null;
   109         this.appModsDir = null;
   112         this.relativeModsDir = null;
       
   113         this.runtimeDir = null;
   110         this.runtimeDir = null;
   114         this.binDir = null;
   111         this.binDir = null;
   115         this.mdir = null;
   112         this.mdir = null;
   116         this.params = new HashMap<>();
   113         this.params = new HashMap<>();
   117     }
   114     }
   148     }
   145     }
   149 
   146 
   150     @Override
   147     @Override
   151     public Path getAppModsDir() {
   148     public Path getAppModsDir() {
   152         return appModsDir;
   149         return appModsDir;
   153     }
       
   154 
       
   155     @Override
       
   156     public String getRelativeModsDir() {
       
   157         return relativeModsDir;
       
   158     }
   150     }
   159 
   151 
   160     @Override
   152     @Override
   161     public void prepareApplicationFiles() throws IOException {
   153     public void prepareApplicationFiles() throws IOException {
   162         Map<String, ? super Object> originalParams = new HashMap<>(params);
   154         Map<String, ? super Object> originalParams = new HashMap<>(params);
   204         }
   196         }
   205 
   197 
   206         executableFile.toFile().setExecutable(true, false);
   198         executableFile.toFile().setExecutable(true, false);
   207         executableFile.toFile().setWritable(true, true);
   199         executableFile.toFile().setWritable(true, true);
   208 
   200 
   209         writeCfgFile(params, root.resolve(getLauncherCfgName(params)).toFile(),
   201         writeCfgFile(params, root.resolve(getLauncherCfgName(params)).toFile());
   210                 "$APPDIR/runtime");
       
   211     }
   202     }
   212 
   203 
   213     private void copyIcon() throws IOException {
   204     private void copyIcon() throws IOException {
   214         File icon = ICON_PNG.fetchFrom(params);
   205         File icon = ICON_PNG.fetchFrom(params);
   215         if (icon != null) {
   206         if (icon != null) {