modules/fxpackager/src/main/java/com/oracle/tools/packager/linux/LinuxAppBundler.java
Print this page
*** 23,33 ****
* questions.
*/
package com.oracle.tools.packager.linux;
! import com.oracle.tools.packager.AbstractBundler;
import com.oracle.tools.packager.BundlerParamInfo;
import com.oracle.tools.packager.JreUtils;
import com.oracle.tools.packager.JreUtils.Rule;
import com.oracle.tools.packager.StandardBundlerParam;
import com.oracle.tools.packager.Log;
--- 23,33 ----
* questions.
*/
package com.oracle.tools.packager.linux;
! import com.oracle.tools.packager.AbstractImageBundler;
import com.oracle.tools.packager.BundlerParamInfo;
import com.oracle.tools.packager.JreUtils;
import com.oracle.tools.packager.JreUtils.Rule;
import com.oracle.tools.packager.StandardBundlerParam;
import com.oracle.tools.packager.Log;
*** 46,56 ****
import java.text.MessageFormat;
import java.util.*;
import static com.oracle.tools.packager.StandardBundlerParam.*;
! public class LinuxAppBundler extends AbstractBundler {
private static final ResourceBundle I18N =
ResourceBundle.getBundle(LinuxAppBundler.class.getName());
protected static final String LINUX_BUNDLER_PREFIX =
--- 46,56 ----
import java.text.MessageFormat;
import java.util.*;
import static com.oracle.tools.packager.StandardBundlerParam.*;
! public class LinuxAppBundler extends AbstractImageBundler {
private static final ResourceBundle I18N =
ResourceBundle.getBundle(LinuxAppBundler.class.getName());
protected static final String LINUX_BUNDLER_PREFIX =
*** 258,269 ****
executableFile);
executableFile.setExecutable(true, false);
executableFile.setWritable(true, true); //for str
! // Generate PkgInfo
! writePkgInfo(p, rootDir);
}
private void copyApplication(Map<String, ? super Object> params, File appDirectory) throws IOException {
List<RelativeFileSet> appResourcesList = APP_RESOURCES_LIST.fetchFrom(params);
if (appResourcesList == null) {
--- 258,273 ----
executableFile);
executableFile.setExecutable(true, false);
executableFile.setWritable(true, true); //for str
! // Generate launcher .cfg file
! if (LAUNCHER_CFG_FORMAT.fetchFrom(p).equals(CFG_FORMAT_PROPERTIES)) {
! writeCfgFile(p, rootDir);
! } else {
! writeCfgFile(p, new File(rootDir, getLauncherCfgName(p)), "$APPDIR/runtime");
! }
}
private void copyApplication(Map<String, ? super Object> params, File appDirectory) throws IOException {
List<RelativeFileSet> appResourcesList = APP_RESOURCES_LIST.fetchFrom(params);
if (appResourcesList == null) {
*** 279,293 ****
new File(srcdir, fname), new File(appDirectory, fname));
}
}
}
! private void writePkgInfo(Map<String, ? super Object> params, File rootDir) throws FileNotFoundException {
! File pkgInfoFile = new File(rootDir, getLauncherCfgName(params));
! pkgInfoFile.delete();
! PrintStream out = new PrintStream(pkgInfoFile);
if (LINUX_RUNTIME.fetchFrom(params) == null) {
out.println("app.runtime=");
} else {
out.println("app.runtime=$APPDIR/runtime");
}
--- 283,297 ----
new File(srcdir, fname), new File(appDirectory, fname));
}
}
}
! private void writeCfgFile(Map<String, ? super Object> params, File rootDir) throws FileNotFoundException {
! File cfgFile = new File(rootDir, getLauncherCfgName(params));
! cfgFile.delete();
! PrintStream out = new PrintStream(cfgFile);
if (LINUX_RUNTIME.fetchFrom(params) == null) {
out.println("app.runtime=");
} else {
out.println("app.runtime=$APPDIR/runtime");
}
*** 323,332 ****
--- 327,337 ----
out.println("jvmarg."+idx+"=-Djavafx.preloader="+preloader);
}
//app.id required for setting user preferences (Java Preferences API)
out.println("app.preferences.id=" + PREFERENCES_ID.fetchFrom(params));
+ out.println("app.identifier=" + IDENTIFIER.fetchFrom(params));
Map<String, String> overridableJVMOptions = USER_JVM_OPTIONS.fetchFrom(params);
idx = 1;
for (Map.Entry<String, String> arg: overridableJVMOptions.entrySet()) {
if (arg.getKey() == null || arg.getValue() == null) {
*** 412,417 ****
--- 417,427 ----
@Override
public File execute(Map<String, ? super Object> params, File outputParentDir) {
return doBundle(params, outputParentDir, false);
}
+
+ @Override
+ protected String getCacheLocation(Map<String, ? super Object> params) {
+ return "$APPDIR/";
+ }
}