< prev index next >

modules/jdk.packager/src/antplugin/java/com/sun/javafx/tools/ant/DeployFXTask.java

Print this page




 223                     if (index > 0) {
 224                         deployParams.setModule(app.getModule());
 225                     }
 226                     else {
 227                         deployParams.setModule(app.getModule() + "/" + app.get().mainClass);
 228                     }
 229                 }
 230 
 231                 deployParams.setPreloader(app.get().preloaderClass);
 232                 deployParams.setAppId(app.get().id);
 233                 deployParams.setAppName(app.get().name);
 234                 deployParams.setParams(app.get().parameters);
 235                 deployParams.setArguments(app.get().getArguments());
 236                 deployParams.setHtmlParams(app.get().htmlParameters);
 237                 deployParams.setFallback(app.get().fallbackApp);
 238                 deployParams.setSwingAppWithEmbeddedJavaFX(app.get().embeddedIntoSwing);
 239                 deployParams.setVersion(app.get().version);
 240                 deployParams.setId(app.get().id);
 241                 deployParams.setServiceHint(app.get().daemon);
 242 
 243                 if (runtime != null) {
 244                     for (String s : runtime.getAddModules()) {
 245                         deployParams.addAddModule(s);
 246                     }
 247 
 248                     for (String s : runtime.getLimitModules()) {
 249                         deployParams.addLimitModule(s);
 250                     }
 251 
 252                     deployParams.setModulePath(runtime.getModulePath());
 253 
 254                     Boolean stripNativeCommands = runtime.getStripNativeCommands();
 255 
 256                     if (stripNativeCommands != null) {
 257                         deployParams.setStripNativeCommands(stripNativeCommands);
 258                     }
 259 
 260                     Boolean detectModules = runtime.getDetectModules();
 261 
 262                     if (detectModules != null) {
 263                         deployParams.setDetectModules(detectModules);
 264                     }
 265                 }
 266             }
 267 
 268             if (appInfo != null) {
 269                 deployParams.setTitle(appInfo.title);
 270                 deployParams.setVendor(appInfo.vendor);
 271                 deployParams.setDescription(appInfo.appDescription);
 272                 deployParams.setCategory(appInfo.category);
 273                 deployParams.setLicenseType(appInfo.licenseType);
 274                 deployParams.setCopyright(appInfo.copyright);
 275                 deployParams.setEmail(appInfo.email);
 276 
 277                 for (Info.Icon i: appInfo.icons) {
 278                     if (i instanceof Info.Splash) {
 279                        deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
 280                             ((Info.Splash) i).mode);
 281                     } else {
 282                        deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
 283                             DeployParams.RunMode.WEBSTART);
 284                     }
 285                 }


 295         }
 296 
 297         if (!isModular &&
 298             (nativeBundles == BundleType.NATIVE ||
 299              nativeBundles == BundleType.IMAGE ||
 300              nativeBundles == BundleType.INSTALLER ||
 301              nativeBundles == BundleType.ALL)) {
 302             if (app != null) {
 303                 deployParams.setApplicationClass(app.get().mainClass);
 304                 deployParams.setPreloader(app.get().preloaderClass);
 305                 deployParams.setAppId(app.get().id);
 306                 deployParams.setAppName(app.get().name);
 307                 deployParams.setParams(app.get().parameters);
 308                 deployParams.setArguments(app.get().getArguments());
 309                 deployParams.setHtmlParams(app.get().htmlParameters);
 310                 deployParams.setFallback(app.get().fallbackApp);
 311                 deployParams.setSwingAppWithEmbeddedJavaFX(app.get().embeddedIntoSwing);
 312                 deployParams.setVersion(app.get().version);
 313                 deployParams.setId(app.get().id);
 314                 deployParams.setServiceHint(app.get().daemon);


 315             }
 316 
 317             if (appInfo != null) {
 318                 deployParams.setTitle(appInfo.title);
 319                 deployParams.setVendor(appInfo.vendor);
 320                 deployParams.setDescription(appInfo.appDescription);
 321                 deployParams.setCategory(appInfo.category);
 322                 deployParams.setLicenseType(appInfo.licenseType);
 323                 deployParams.setCopyright(appInfo.copyright);
 324                 deployParams.setEmail(appInfo.email);
 325 
 326                 for (Info.Icon i: appInfo.icons) {
 327                     if (i instanceof Info.Splash) {
 328                        deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
 329                             ((Info.Splash) i).mode);
 330                     } else {
 331                        deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
 332                             DeployParams.RunMode.WEBSTART);
 333                     }
 334                 }


 367         deployParams.setBundleType(nativeBundles);
 368         deployParams.setTargetFormat(bundleFormat);
 369 
 370         Log.setLogger(new AntLog(this.getProject()));
 371 
 372         try {
 373             packager.generateDeploymentPackages(deployParams);
 374         } catch (PackagerException pe) {
 375             if (pe.getCause() != null) {
 376                throw new BuildException(pe.getCause().getMessage(), pe.getCause());
 377             } else {
 378                 throw new BuildException(pe.getMessage(), pe);
 379             }
 380         } catch (Exception e) {
 381             throw new BuildException(e.getMessage(), e);
 382         } finally {
 383             Log.setLogger(null);
 384         }
 385     }
 386 


























 387     /**
 388      * Set to true if we are generating an 'extension' JNLP.
 389      *
 390      * @ant.not-required Default is false.
 391      */
 392     public void setExtension(boolean v) {
 393         isExtension = v;
 394     }
 395 
 396     public void setNativeBundles(String v) {
 397         Bundle bundle = Bundler.stringToBundle(v);
 398         this.nativeBundles = bundle.type;
 399         this.bundleFormat = bundle.format;
 400     }
 401 
 402     public void setVersionCheck(String value) {
 403         this.versionCheck = Boolean.valueOf(value);
 404     }
 405 
 406     /**




 223                     if (index > 0) {
 224                         deployParams.setModule(app.getModule());
 225                     }
 226                     else {
 227                         deployParams.setModule(app.getModule() + "/" + app.get().mainClass);
 228                     }
 229                 }
 230 
 231                 deployParams.setPreloader(app.get().preloaderClass);
 232                 deployParams.setAppId(app.get().id);
 233                 deployParams.setAppName(app.get().name);
 234                 deployParams.setParams(app.get().parameters);
 235                 deployParams.setArguments(app.get().getArguments());
 236                 deployParams.setHtmlParams(app.get().htmlParameters);
 237                 deployParams.setFallback(app.get().fallbackApp);
 238                 deployParams.setSwingAppWithEmbeddedJavaFX(app.get().embeddedIntoSwing);
 239                 deployParams.setVersion(app.get().version);
 240                 deployParams.setId(app.get().id);
 241                 deployParams.setServiceHint(app.get().daemon);
 242 
 243                 setRuntime();






















 244             }
 245 
 246             if (appInfo != null) {
 247                 deployParams.setTitle(appInfo.title);
 248                 deployParams.setVendor(appInfo.vendor);
 249                 deployParams.setDescription(appInfo.appDescription);
 250                 deployParams.setCategory(appInfo.category);
 251                 deployParams.setLicenseType(appInfo.licenseType);
 252                 deployParams.setCopyright(appInfo.copyright);
 253                 deployParams.setEmail(appInfo.email);
 254 
 255                 for (Info.Icon i: appInfo.icons) {
 256                     if (i instanceof Info.Splash) {
 257                        deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
 258                             ((Info.Splash) i).mode);
 259                     } else {
 260                        deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
 261                             DeployParams.RunMode.WEBSTART);
 262                     }
 263                 }


 273         }
 274 
 275         if (!isModular &&
 276             (nativeBundles == BundleType.NATIVE ||
 277              nativeBundles == BundleType.IMAGE ||
 278              nativeBundles == BundleType.INSTALLER ||
 279              nativeBundles == BundleType.ALL)) {
 280             if (app != null) {
 281                 deployParams.setApplicationClass(app.get().mainClass);
 282                 deployParams.setPreloader(app.get().preloaderClass);
 283                 deployParams.setAppId(app.get().id);
 284                 deployParams.setAppName(app.get().name);
 285                 deployParams.setParams(app.get().parameters);
 286                 deployParams.setArguments(app.get().getArguments());
 287                 deployParams.setHtmlParams(app.get().htmlParameters);
 288                 deployParams.setFallback(app.get().fallbackApp);
 289                 deployParams.setSwingAppWithEmbeddedJavaFX(app.get().embeddedIntoSwing);
 290                 deployParams.setVersion(app.get().version);
 291                 deployParams.setId(app.get().id);
 292                 deployParams.setServiceHint(app.get().daemon);
 293 
 294                 setRuntime();
 295             }
 296 
 297             if (appInfo != null) {
 298                 deployParams.setTitle(appInfo.title);
 299                 deployParams.setVendor(appInfo.vendor);
 300                 deployParams.setDescription(appInfo.appDescription);
 301                 deployParams.setCategory(appInfo.category);
 302                 deployParams.setLicenseType(appInfo.licenseType);
 303                 deployParams.setCopyright(appInfo.copyright);
 304                 deployParams.setEmail(appInfo.email);
 305 
 306                 for (Info.Icon i: appInfo.icons) {
 307                     if (i instanceof Info.Splash) {
 308                        deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
 309                             ((Info.Splash) i).mode);
 310                     } else {
 311                        deployParams.addIcon(i.href, i.kind, i.width, i.height, i.depth,
 312                             DeployParams.RunMode.WEBSTART);
 313                     }
 314                 }


 347         deployParams.setBundleType(nativeBundles);
 348         deployParams.setTargetFormat(bundleFormat);
 349 
 350         Log.setLogger(new AntLog(this.getProject()));
 351 
 352         try {
 353             packager.generateDeploymentPackages(deployParams);
 354         } catch (PackagerException pe) {
 355             if (pe.getCause() != null) {
 356                throw new BuildException(pe.getCause().getMessage(), pe.getCause());
 357             } else {
 358                 throw new BuildException(pe.getMessage(), pe);
 359             }
 360         } catch (Exception e) {
 361             throw new BuildException(e.getMessage(), e);
 362         } finally {
 363             Log.setLogger(null);
 364         }
 365     }
 366 
 367     private void setRuntime() {
 368         if (runtime != null) {
 369             for (String s : runtime.getAddModules()) {
 370                 deployParams.addAddModule(s);
 371             }
 372 
 373             for (String s : runtime.getLimitModules()) {
 374                 deployParams.addLimitModule(s);
 375             }
 376 
 377             deployParams.setModulePath(runtime.getModulePath());
 378 
 379             Boolean stripNativeCommands = runtime.getStripNativeCommands();
 380 
 381             if (stripNativeCommands != null) {
 382                 deployParams.setStripNativeCommands(stripNativeCommands);
 383             }
 384 
 385             Boolean detectModules = runtime.getDetectModules();
 386 
 387             if (detectModules != null) {
 388                 deployParams.setDetectModules(detectModules);
 389             }
 390         }
 391     }
 392 
 393     /**
 394      * Set to true if we are generating an 'extension' JNLP.
 395      *
 396      * @ant.not-required Default is false.
 397      */
 398     public void setExtension(boolean v) {
 399         isExtension = v;
 400     }
 401 
 402     public void setNativeBundles(String v) {
 403         Bundle bundle = Bundler.stringToBundle(v);
 404         this.nativeBundles = bundle.type;
 405         this.bundleFormat = bundle.format;
 406     }
 407 
 408     public void setVersionCheck(String value) {
 409         this.versionCheck = Boolean.valueOf(value);
 410     }
 411 
 412     /**


< prev index next >