109
110 return true;
111 }
112
113 // it is static for the sake of sharing with "installer" bundlers
114 // that may skip calls to validate/bundle in this class!
115 static File getRootDir(File outDir, Map<String, ? super Object> params) {
116 return new File(outDir, APP_NAME.fetchFrom(params));
117 }
118
119 File doBundle(Map<String, ? super Object> params, File outputDirectory,
120 boolean dependentTask) throws PackagerException {
121 if (StandardBundlerParam.isRuntimeInstaller(params)) {
122 return PREDEFINED_RUNTIME_IMAGE.fetchFrom(params);
123 } else {
124 return doAppBundle(params, outputDirectory, dependentTask);
125 }
126 }
127
128 private File doAppBundle(Map<String, ? super Object> params,
129 File outputDirectory, boolean dependentTask) throws PackagerException {
130 try {
131 File rootDirectory = createRoot(params, outputDirectory,
132 dependentTask, APP_NAME.fetchFrom(params));
133 AbstractAppImageBuilder appBuilder = new LinuxAppImageBuilder(
134 params, outputDirectory.toPath());
135 if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(params) == null ) {
136 JLinkBundlerHelper.execute(params, appBuilder);
137 } else {
138 StandardBundlerParam.copyPredefinedRuntimeImage(
139 params, appBuilder);
140 }
141 return rootDirectory;
142 } catch (PackagerException pe) {
143 throw pe;
144 } catch (Exception ex) {
145 Log.verbose(ex);
146 throw new PackagerException(ex);
147 }
148 }
149
|
109
110 return true;
111 }
112
113 // it is static for the sake of sharing with "installer" bundlers
114 // that may skip calls to validate/bundle in this class!
115 static File getRootDir(File outDir, Map<String, ? super Object> params) {
116 return new File(outDir, APP_NAME.fetchFrom(params));
117 }
118
119 File doBundle(Map<String, ? super Object> params, File outputDirectory,
120 boolean dependentTask) throws PackagerException {
121 if (StandardBundlerParam.isRuntimeInstaller(params)) {
122 return PREDEFINED_RUNTIME_IMAGE.fetchFrom(params);
123 } else {
124 return doAppBundle(params, outputDirectory, dependentTask);
125 }
126 }
127
128 private File doAppBundle(Map<String, ? super Object> params,
129 File outputDirectory, boolean dependentTask)
130 throws PackagerException {
131 try {
132 File rootDirectory = createRoot(params, outputDirectory,
133 dependentTask, APP_NAME.fetchFrom(params));
134 AbstractAppImageBuilder appBuilder = new LinuxAppImageBuilder(
135 params, outputDirectory.toPath());
136 if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(params) == null ) {
137 JLinkBundlerHelper.execute(params, appBuilder);
138 } else {
139 StandardBundlerParam.copyPredefinedRuntimeImage(
140 params, appBuilder);
141 }
142 return rootDirectory;
143 } catch (PackagerException pe) {
144 throw pe;
145 } catch (Exception ex) {
146 Log.verbose(ex);
147 throw new PackagerException(ex);
148 }
149 }
150
|