|
@@ -39,12 +39,12 @@ public class BuildNumber |
|
|
/** |
|
|
/** |
|
|
* The name of the property in which the build number is stored. |
|
|
* The name of the property in which the build number is stored. |
|
|
*/ |
|
|
*/ |
|
|
private static final String DEFAULT_PROPRTY_NAME = "build.number"; |
|
|
|
|
|
|
|
|
private static final String DEFAULT_PROPERTY_NAME = "build.number"; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* The default filename to use if no file specified. |
|
|
* The default filename to use if no file specified. |
|
|
*/ |
|
|
*/ |
|
|
private static final String DEFAULT_FILENAME = DEFAULT_PROPRTY_NAME; |
|
|
|
|
|
|
|
|
private static final String DEFAULT_FILENAME = DEFAULT_PROPERTY_NAME; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* The File in which the build number is stored. |
|
|
* The File in which the build number is stored. |
|
@@ -75,7 +75,7 @@ public class BuildNumber |
|
|
final Properties properties = loadProperties(); |
|
|
final Properties properties = loadProperties(); |
|
|
final int buildNumber = getBuildNumber( properties ); |
|
|
final int buildNumber = getBuildNumber( properties ); |
|
|
|
|
|
|
|
|
properties.put( DEFAULT_PROPRTY_NAME, |
|
|
|
|
|
|
|
|
properties.put( DEFAULT_PROPERTY_NAME, |
|
|
String.valueOf( buildNumber + 1 ) ); |
|
|
String.valueOf( buildNumber + 1 ) ); |
|
|
|
|
|
|
|
|
// Write the properties file back out |
|
|
// Write the properties file back out |
|
@@ -99,7 +99,7 @@ public class BuildNumber |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//Finally set the property |
|
|
//Finally set the property |
|
|
getContext().setProperty( DEFAULT_PROPRTY_NAME, |
|
|
|
|
|
|
|
|
getContext().setProperty( DEFAULT_PROPERTY_NAME, |
|
|
String.valueOf( buildNumber ) ); |
|
|
String.valueOf( buildNumber ) ); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -114,7 +114,7 @@ public class BuildNumber |
|
|
throws TaskException |
|
|
throws TaskException |
|
|
{ |
|
|
{ |
|
|
final String buildNumber = |
|
|
final String buildNumber = |
|
|
properties.getProperty( DEFAULT_PROPRTY_NAME, "0" ).trim(); |
|
|
|
|
|
|
|
|
properties.getProperty( DEFAULT_PROPERTY_NAME, "0" ).trim(); |
|
|
|
|
|
|
|
|
// Try parsing the line into an integer. |
|
|
// Try parsing the line into an integer. |
|
|
try |
|
|
try |
|
@@ -197,4 +197,4 @@ public class BuildNumber |
|
|
throw new TaskException( message ); |
|
|
throw new TaskException( message ); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |