< prev index next >

test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java

Print this page




 292         } else {
 293             appDesc = JavaAppDesc.parse(javaAppDesc);
 294         }
 295         return helloAppImage(appDesc);
 296     }
 297 
 298     public static JPackageCommand helloAppImage(JavaAppDesc javaAppDesc) {
 299         JPackageCommand cmd = new JPackageCommand();
 300         cmd.setDefaultInputOutput().setDefaultAppName();
 301         PackageType.IMAGE.applyTo(cmd);
 302         new HelloApp(javaAppDesc).addTo(cmd);
 303         return cmd;
 304     }
 305 
 306     public JPackageCommand setPackageType(PackageType type) {
 307         verifyMutable();
 308         type.applyTo(this);
 309         return this;
 310     }
 311 
 312     JPackageCommand setDefaultAppName() {
 313         return addArguments("--name", TKit.getCurrentDefaultAppName());
 314     }
 315 
 316     /**
 317      * Returns path to output bundle of configured jpackage command.
 318      *
 319      * If this is build image command, returns path to application image directory.
 320      */
 321     public Path outputBundle() {
 322         final String bundleName;
 323         if (isImagePackageType()) {
 324             String dirName = name();
 325             if (TKit.isOSX()) {
 326                 dirName = dirName + ".app";
 327             }
 328             bundleName = dirName;
 329         } else if (TKit.isLinux()) {
 330             bundleName = LinuxHelper.getBundleName(this);
 331         } else if (TKit.isWindows()) {
 332             bundleName = WindowsHelper.getBundleName(this);




 292         } else {
 293             appDesc = JavaAppDesc.parse(javaAppDesc);
 294         }
 295         return helloAppImage(appDesc);
 296     }
 297 
 298     public static JPackageCommand helloAppImage(JavaAppDesc javaAppDesc) {
 299         JPackageCommand cmd = new JPackageCommand();
 300         cmd.setDefaultInputOutput().setDefaultAppName();
 301         PackageType.IMAGE.applyTo(cmd);
 302         new HelloApp(javaAppDesc).addTo(cmd);
 303         return cmd;
 304     }
 305 
 306     public JPackageCommand setPackageType(PackageType type) {
 307         verifyMutable();
 308         type.applyTo(this);
 309         return this;
 310     }
 311 
 312     public JPackageCommand setDefaultAppName() {
 313         return addArguments("--name", TKit.getCurrentDefaultAppName());
 314     }
 315 
 316     /**
 317      * Returns path to output bundle of configured jpackage command.
 318      *
 319      * If this is build image command, returns path to application image directory.
 320      */
 321     public Path outputBundle() {
 322         final String bundleName;
 323         if (isImagePackageType()) {
 324             String dirName = name();
 325             if (TKit.isOSX()) {
 326                 dirName = dirName + ".app";
 327             }
 328             bundleName = dirName;
 329         } else if (TKit.isLinux()) {
 330             bundleName = LinuxHelper.getBundleName(this);
 331         } else if (TKit.isWindows()) {
 332             bundleName = WindowsHelper.getBundleName(this);


< prev index next >