1 package com.repdev.launcher;
3 import java.io.BufferedReader;
4 import java.io.InputStreamReader;
5 import java.io.PrintStream;
6 import java.text.SimpleDateFormat;
10 * This is a <s>simple</s> launcher for a JAR file that will be wrapped with Launch4J to create
11 * a nice friendly repdev.exe that will run for anyone.
13 * Supports logging all output to a file, subversion updating (or not with the arg --no-update)
15 * @author Ryan Schultz
18 public class Launcher {
19 private static final String date = SimpleDateFormat.getInstance().format(new Date());
21 public static void main(String[] args) throws Exception {
23 for(String arg: args) {
24 if( arg.equals("--log") )
26 if( arg.equals("--help") || arg.equals("-h") ) {
33 PrintStream stderr = new PrintStream("stderr.txt");
34 System.setErr(stderr);
36 PrintStream stdout = new PrintStream("stdout.txt");
37 System.setOut(stdout);
39 System.out.println(">> RepDev Started via launcher with logging");
40 System.out.println(">> Started: " + date + "\n");
41 System.err.println(">> RepDev Started via launcher with logging");
42 System.err.println(">> Started: " + date + "\n");
45 // Finally, we launch repdev...
46 com.repdev.RepDevMain.main(args);
49 private static void usage() {
51 "RepDev Launcher - Usage:",
54 "\t--help or -h\tThis message",
55 "\t--log\tLog all output to stdout.txt and stderr.txt",
59 for( String line: usage )
60 System.out.println(line);