1 19 20 package edu.umd.cs.findbugs; 21 22 import java.text.SimpleDateFormat ; 23 import java.util.Date ; 24 25 28 public class Version { 29 32 public static final int MAJOR = 1; 33 34 37 public static final int MINOR = 1; 38 39 42 public static final int PATCHLEVEL = 3; 43 44 47 public static final boolean IS_DEVELOPMENT = true; 48 49 53 public static final int RELEASE_CANDIDATE = 3; 54 55 59 public static final int PREVIEW = 0; 60 61 private static final String RELEASE_SUFFIX_WORD = 62 (RELEASE_CANDIDATE > 0 63 ? "rc" + RELEASE_CANDIDATE 64 : (PREVIEW > 0 ? "preview" + PREVIEW : "dev")); 65 66 69 public static final String RELEASE = 70 MAJOR + "." + MINOR + "." + PATCHLEVEL + (IS_DEVELOPMENT ? "-" + RELEASE_SUFFIX_WORD : ""); 71 72 static final SimpleDateFormat dateFormat = new SimpleDateFormat ("HH:mm:ss z, dd MMMM, yyyy"); 73 static final SimpleDateFormat eclipseDateFormat = new SimpleDateFormat ("yyyyMMdd"); 74 77 public static final String DATE = dateFormat.format(new Date ()); 78 79 public static final String ECLIPSE_DATE = eclipseDateFormat.format(new Date ()) ; 80 81 84 public static final String ECLIPSE_UI_VERSION = MAJOR + "." + MINOR + "." + PATCHLEVEL + "." + ECLIPSE_DATE; 86 87 90 public static final String WEBSITE = "http://findbugs.sourceforge.net"; 91 92 95 public static final String DOWNLOADS_WEBSITE = "http://prdownloads.sourceforge.net/findbugs"; 96 97 100 public static final String SUPPORT_EMAIL = "http://findbugs.sourceforge.net/reportingBugs.html"; 101 102 public static void main(String [] argv) { 103 if (argv.length != 1) 104 usage(); 105 106 String arg = argv[0]; 107 108 if (arg.equals("-release")) 109 System.out.println(RELEASE); 110 else if (arg.equals("-date")) 111 System.out.println(DATE); 112 else if (arg.equals("-props")) { 113 System.out.println("release.number=" + RELEASE); 114 System.out.println("release.date=" + DATE); 115 System.out.println("eclipse.ui.version=" + ECLIPSE_UI_VERSION); 116 System.out.println("findbugs.website=" + WEBSITE); 117 System.out.println("findbugs.downloads.website=" + DOWNLOADS_WEBSITE); 118 } else { 119 usage(); 120 System.exit(1); 121 } 122 } 123 124 private static void usage() { 125 System.err.println("Usage: " + Version.class.getName() + 126 " (-release|-date|-props)"); 127 } 128 } 129 130 | Popular Tags |