modules/fxpackager/src/main/java/com/oracle/tools/packager/mac/MacDmgBundler.java
Print this page
rev 6889 : RT-36724 - JavaFX Packager Renaming
Summary: Move java code around to new packages.
*** 20,58 ****
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
! package com.sun.javafx.tools.packager.bundlers;
! import com.oracle.bundlers.BundlerParamInfo;
! import com.oracle.bundlers.mac.MacBaseInstallerBundler;
! import com.sun.javafx.tools.packager.Log;
! import com.sun.javafx.tools.resource.mac.MacResources;
import sun.misc.BASE64Encoder;
import java.io.*;
import java.text.MessageFormat;
import java.util.*;
! import static com.oracle.bundlers.StandardBundlerParam.*;
! public class MacDMGBundler extends MacBaseInstallerBundler {
private static final ResourceBundle I18N =
! ResourceBundle.getBundle("com.oracle.bundlers.mac.MacDMGBundler");
static final String DEFAULT_BACKGROUND_IMAGE="background_dmg.png";
static final String DEFAULT_DMG_SETUP_SCRIPT="DMGsetup.scpt";
static final String TEMPLATE_BUNDLE_ICON = "GenericApp.icns";
//existing SQE tests look for "license" string in the filenames
// when they look for unathorized license files in the build artifacts
// Use different name to make them happy
static final String DEFAULT_LICENSE_PLIST="lic_template.plist";
! public MacDMGBundler() {
super();
baseResourceLoader = MacResources.class;
}
//@Override
--- 20,56 ----
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
! package com.oracle.tools.packager.mac;
! import com.oracle.tools.packager.*;
! import com.oracle.tools.packager.IOUtils;
import sun.misc.BASE64Encoder;
import java.io.*;
import java.text.MessageFormat;
import java.util.*;
! import static com.oracle.tools.packager.StandardBundlerParam.*;
! public class MacDmgBundler extends MacBaseInstallerBundler {
private static final ResourceBundle I18N =
! ResourceBundle.getBundle(MacDmgBundler.class.getName());
static final String DEFAULT_BACKGROUND_IMAGE="background_dmg.png";
static final String DEFAULT_DMG_SETUP_SCRIPT="DMGsetup.scpt";
static final String TEMPLATE_BUNDLE_ICON = "GenericApp.icns";
//existing SQE tests look for "license" string in the filenames
// when they look for unathorized license files in the build artifacts
// Use different name to make them happy
static final String DEFAULT_LICENSE_PLIST="lic_template.plist";
! public MacDmgBundler() {
super();
baseResourceLoader = MacResources.class;
}
//@Override
*** 144,154 ****
data.put("DEPLOY_INSTALL_NAME", "Desktop");
}
Writer w = new BufferedWriter(new FileWriter(dmgSetup));
w.write(preprocessTextResource(
! com.sun.javafx.tools.packager.bundlers.MacAppBundler.MAC_BUNDLER_PREFIX + dmgSetup.getName(),
I18N.getString("resource.dmg-setup-script"), DEFAULT_DMG_SETUP_SCRIPT, data, VERBOSE.fetchFrom(p)));
w.close();
}
private File getConfig_VolumeScript(Map<String, ? super Object> params) {
--- 142,152 ----
data.put("DEPLOY_INSTALL_NAME", "Desktop");
}
Writer w = new BufferedWriter(new FileWriter(dmgSetup));
w.write(preprocessTextResource(
! MacAppBundler.MAC_BUNDLER_PREFIX + dmgSetup.getName(),
I18N.getString("resource.dmg-setup-script"), DEFAULT_DMG_SETUP_SCRIPT, data, VERBOSE.fetchFrom(p)));
w.close();
}
private File getConfig_VolumeScript(Map<String, ? super Object> params) {
*** 183,193 ****
Map<String, String> data = new HashMap<>();
data.put("APPLICATION_LICENSE_TEXT", licenseInBase64);
Writer w = new BufferedWriter(new FileWriter(getConfig_LicenseFile(params)));
w.write(preprocessTextResource(
! com.sun.javafx.tools.packager.bundlers.MacAppBundler.MAC_BUNDLER_PREFIX + getConfig_LicenseFile(params).getName(),
I18N.getString("resource.license-setup"), DEFAULT_LICENSE_PLIST, data, VERBOSE.fetchFrom(params)));
w.close();
} catch (IOException ex) {
Log.verbose(ex);
--- 181,191 ----
Map<String, String> data = new HashMap<>();
data.put("APPLICATION_LICENSE_TEXT", licenseInBase64);
Writer w = new BufferedWriter(new FileWriter(getConfig_LicenseFile(params)));
w.write(preprocessTextResource(
! MacAppBundler.MAC_BUNDLER_PREFIX + getConfig_LicenseFile(params).getName(),
I18N.getString("resource.license-setup"), DEFAULT_LICENSE_PLIST, data, VERBOSE.fetchFrom(params)));
w.close();
} catch (IOException ex) {
Log.verbose(ex);
*** 195,227 ****
}
private boolean prepareConfigFiles(Map<String, ? super Object> params) throws IOException {
File bgTarget = getConfig_VolumeBackground(params);
! fetchResource(com.sun.javafx.tools.packager.bundlers.MacAppBundler.MAC_BUNDLER_PREFIX + bgTarget.getName(),
I18N.getString("resource.dmg-background"),
DEFAULT_BACKGROUND_IMAGE,
bgTarget,
VERBOSE.fetchFrom(params));
File iconTarget = getConfig_VolumeIcon(params);
if (MacAppBundler.ICON_ICNS.fetchFrom(params) == null || !MacAppBundler.ICON_ICNS.fetchFrom(params).exists()) {
! fetchResource(com.sun.javafx.tools.packager.bundlers.MacAppBundler.MAC_BUNDLER_PREFIX + iconTarget.getName(),
I18N.getString("resource.volume-icon"),
TEMPLATE_BUNDLE_ICON,
iconTarget,
VERBOSE.fetchFrom(params));
} else {
! fetchResource(com.sun.javafx.tools.packager.bundlers.MacAppBundler.MAC_BUNDLER_PREFIX + iconTarget.getName(),
I18N.getString("resource.volume-icon"),
MacAppBundler.ICON_ICNS.fetchFrom(params),
iconTarget,
VERBOSE.fetchFrom(params));
}
! fetchResource(com.sun.javafx.tools.packager.bundlers.MacAppBundler.MAC_BUNDLER_PREFIX + getConfig_Script(params).getName(),
I18N.getString("resource.post-install-script"),
(String) null,
getConfig_Script(params),
VERBOSE.fetchFrom(params));
--- 193,225 ----
}
private boolean prepareConfigFiles(Map<String, ? super Object> params) throws IOException {
File bgTarget = getConfig_VolumeBackground(params);
! fetchResource(MacAppBundler.MAC_BUNDLER_PREFIX + bgTarget.getName(),
I18N.getString("resource.dmg-background"),
DEFAULT_BACKGROUND_IMAGE,
bgTarget,
VERBOSE.fetchFrom(params));
File iconTarget = getConfig_VolumeIcon(params);
if (MacAppBundler.ICON_ICNS.fetchFrom(params) == null || !MacAppBundler.ICON_ICNS.fetchFrom(params).exists()) {
! fetchResource(MacAppBundler.MAC_BUNDLER_PREFIX + iconTarget.getName(),
I18N.getString("resource.volume-icon"),
TEMPLATE_BUNDLE_ICON,
iconTarget,
VERBOSE.fetchFrom(params));
} else {
! fetchResource(MacAppBundler.MAC_BUNDLER_PREFIX + iconTarget.getName(),
I18N.getString("resource.volume-icon"),
MacAppBundler.ICON_ICNS.fetchFrom(params),
iconTarget,
VERBOSE.fetchFrom(params));
}
! fetchResource(MacAppBundler.MAC_BUNDLER_PREFIX + getConfig_Script(params).getName(),
I18N.getString("resource.post-install-script"),
(String) null,
getConfig_Script(params),
VERBOSE.fetchFrom(params));