5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package com.oracle.bundlers.mac;
26
27 import static com.oracle.bundlers.StandardBundlerParam.*;
28
29 import java.io.BufferedWriter;
30 import java.io.File;
31 import java.io.FileWriter;
32 import java.io.IOException;
33 import java.io.Writer;
34 import java.text.MessageFormat;import java.util.Arrays;
35 import java.util.Collection;
36 import java.util.HashMap;
37 import java.util.Map;
38 import java.util.ResourceBundle;
39
40 import com.oracle.bundlers.AbstractBundler;
41 import com.oracle.bundlers.BundlerParamInfo;
42 import com.oracle.bundlers.StandardBundlerParam;
43
44 import com.sun.javafx.tools.packager.Log;
45 import com.sun.javafx.tools.packager.bundlers.ConfigException;
46 import com.sun.javafx.tools.packager.bundlers.IOUtils;
47 import com.sun.javafx.tools.packager.bundlers.UnsupportedPlatformException;
48 import com.sun.javafx.tools.resource.mac.MacResources;
49
50 public class MacDaemonBundler extends AbstractBundler {
51
52 private static final ResourceBundle I18N =
53 ResourceBundle.getBundle("com.oracle.bundlers.mac.MacDaemonBundler");
54
55 private static final String TEMPLATE_LAUNCHD_PLIST = "launchd.plist.template";
56
57 public final static String MAC_BUNDLER_PREFIX =
58 BUNDLER_PREFIX + "macosx" + File.separator;
59
60 public static final BundlerParamInfo<File> CONFIG_ROOT = new StandardBundlerParam<>(
61 I18N.getString("param.config-root.name"),
62 I18N.getString("param.config-root.description"),
63 "configRoot",
64 File.class,
65 params -> {
66 File configRoot = new File(BUILD_ROOT.fetchFrom(params), "macosx");
67 configRoot.mkdirs();
68 return configRoot;
69 },
70 (s, p) -> new File(s));
71
72 public MacDaemonBundler() {
73 super();
|
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package com.oracle.tools.packager.mac;
26
27 import static com.oracle.tools.packager.StandardBundlerParam.*;
28
29 import java.io.BufferedWriter;
30 import java.io.File;
31 import java.io.FileWriter;
32 import java.io.IOException;
33 import java.io.Writer;
34 import java.text.MessageFormat;import java.util.Arrays;
35 import java.util.Collection;
36 import java.util.HashMap;
37 import java.util.Map;
38 import java.util.ResourceBundle;
39
40 import com.oracle.tools.packager.AbstractBundler;
41 import com.oracle.tools.packager.BundlerParamInfo;
42 import com.oracle.tools.packager.StandardBundlerParam;
43
44 import com.oracle.tools.packager.Log;
45 import com.oracle.tools.packager.ConfigException;
46 import com.oracle.tools.packager.IOUtils;
47 import com.oracle.tools.packager.UnsupportedPlatformException;
48
49 public class MacDaemonBundler extends AbstractBundler {
50
51 private static final ResourceBundle I18N =
52 ResourceBundle.getBundle(MacDaemonBundler.class.getName());
53
54 private static final String TEMPLATE_LAUNCHD_PLIST = "launchd.plist.template";
55
56 public final static String MAC_BUNDLER_PREFIX =
57 BUNDLER_PREFIX + "macosx" + File.separator;
58
59 public static final BundlerParamInfo<File> CONFIG_ROOT = new StandardBundlerParam<>(
60 I18N.getString("param.config-root.name"),
61 I18N.getString("param.config-root.description"),
62 "configRoot",
63 File.class,
64 params -> {
65 File configRoot = new File(BUILD_ROOT.fetchFrom(params), "macosx");
66 configRoot.mkdirs();
67 return configRoot;
68 },
69 (s, p) -> new File(s));
70
71 public MacDaemonBundler() {
72 super();
|