Changeset 2960
- Timestamp:
- Nov 27, 2006, 1:40:06 PM (16 years ago)
- Location:
- trunk/src/core
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/Application.java
r2942 r2960 63 63 64 64 /** 65 The major version.66 */67 private static final int MAJOR_VERSION = 2;68 69 /**70 The minor version.71 */72 private static final int MINOR_VERSION = 1;73 74 /**75 The build number.76 @base.internal77 The <code>${base.build}</code> string will be replaced with the78 current subversion revision by the <code>ant dist</code> command.79 See <code>svn.revision</code>, <code>dist.init</code> and80 <code>dist</code> targets in the build file.81 82 */83 private static final int BUILD = parseBuildNumber("${base.build}");84 85 /**86 65 If BASE is running or not. 87 66 */ … … 171 150 172 151 /** 173 Get the major version of Base. 174 */ 175 public static int getMajorVersion() 176 { 177 return MAJOR_VERSION; 178 } 179 180 /** 181 Get the minor version of Base. 182 */ 183 public static int getMinorVersion() 184 { 185 return MINOR_VERSION; 186 } 187 152 Get the major version. 153 */ 154 public static String getMajorVersion() 155 { 156 return Version.getMajor(); 157 } 158 159 /** 160 Get the minor version. 161 */ 162 public static String getMinorVersion() 163 { 164 return Version.getMinor(); 165 } 166 /** 167 Get the maintentance version. 168 */ 169 public static String getMaintenanceVersion() 170 { 171 return Version.getMaintenance(); 172 } 173 174 /** 175 Get the build number. 176 */ 177 public static int getBuild() 178 { 179 return Version.getBuild(); 180 } 181 188 182 /** 189 183 Get the BASE version string … … 191 185 public static String getVersionString() 192 186 { 193 return ("BASE " + getMajorVersion() + "." + getMinorVersion() + 194 " (build #" + getBuild() + ")"); 195 } 196 197 /** 198 Get the build number. 199 */ 200 public static int getBuild() 201 { 202 return BUILD; 187 return "BASE " + getMajorVersion() + "." + getMinorVersion() + 188 "." + getMaintenanceVersion() + " (build #" + getBuild() + 189 "; schema #" + Application.getSchemaVersion()+")"; 203 190 } 204 191 … … 321 308 { 322 309 // Read settings from the configuration file 310 Version.init(); 311 log.info("Version: " + Version.getVersion()); 312 323 313 Config.init(); 324 314 authenticationDriver = Config.getString("auth.driver"); … … 847 837 } 848 838 849 850 /**851 Find the first digits in a string and return those as the build number.852 */853 private static int parseBuildNumber(String buildNumber)854 {855 int build = 0;856 Pattern p = Pattern.compile("(\\d+)");857 Matcher m = p.matcher(buildNumber);858 if (m.find())859 {860 build = Integer.parseInt(m.group());861 }862 return build;863 }864 865 866 839 private static class SessionControlCacheCleaner 867 840 extends TimerTask
Note: See TracChangeset
for help on using the changeset viewer.