Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: macbuild/Main.java


1   /*
2    * Main.java
3    *
4    * Created on August 6, 2003, 10:03 PM
5    * This software is released under the Apache Software License, version 1.1.
6    * See the file LICENSE.txt for more information.
7    */
8   
9   package macbuild;
10  
11  import java.io.File;
12  
13  /** NOT FINISHED!
14   * <p>
15   * Runs MacBuild like a standalone program, without having to write a buildfile.
16   * Make sure that ant.jar is in the classpath.
17   *
18   * @author  Mike Baranczak
19   */
20  public class Main {
21      
22      private static void printHelp() {
23          String msg = "Arguments:\n"+
24              "  -help ; print this message and exit.\n"+
25              "  -mainclass <class> ; (required, unless plist is defined) The main\n"+
26              "     application class.\n"+
27              "  -bundlename <name> ; The bundle name. Default: \"MyApplication\"\n"+
28              "  -bundleicon <file> ; Path to bundle icon file. Default: null.\n"+
29              "  -taskinfo ; Print information about this module.\n"+
30              "  -plist <file> ; Path to an Info.plist file to be placed in the\n"+
31              "     bundle. If undefined, the file will be auto-generated from\n"+
32              "     user-specified attributes (currently, mainclass and bundlename).\n";
33  
34          System.out.println(msg);
35      }
36      
37      
38      /**
39       * @param args the command line arguments
40       */
41      public static void main(String[] args) {
42          MacOSXBundleTask task = new MacOSXBundleTask();
43          // parse arguments 
44          for (int i=0; i<args.length; i++) {
45              if (args[i].equals("-help")) {
46                  printHelp();
47                  System.exit(0);
48              }
49              if (args[i].equals("-mainclass")) {
50                  ++i;
51                  if (i >= args.length) {
52                      System.err.println("Error - must specify mainclass attribute.");
53                      System.exit(1);
54                  }
55                  task.setMainClass(args[i]);
56                  continue;
57              }
58              
59          }
60      }
61      
62  }