Add more build parameters (time, java).

This commit is contained in:
asofold 2013-03-01 16:16:23 +01:00
parent e1adb3db54
commit 2a9e00b4ae
3 changed files with 28 additions and 3 deletions

View File

@ -30,6 +30,11 @@
Version updating is done for NCPPlugin mainly, expect the other poms version to change randomly rather.</description>
<properties>
<maven.build.timestamp.format>yyyy_MM_dd-HH_mm</maven.build.timestamp.format>
<buildTimestamp>${maven.build.timestamp}</buildTimestamp>
</properties>
<build>
<resources>
<resource>

View File

@ -4,7 +4,7 @@ import java.util.HashMap;
import java.util.Map;
/**
* Experimental support for build parameters.
* Support for parameters present or set at building time. They are read from BuildParameters.properties
* @author mc_dev
*
*/
@ -72,10 +72,16 @@ public class BuildParameters {
// Public members.
//////////////////////
/** Test level: more testing for higher levels. */
/** Timestamp from build (maven). "?" if not present. */
public static final String buildTimeString = getString("BUILD_TIMESTAMP", "?");
/** The build number as given by Jenkins. Integer.MIN_VALUE if not present. */
public static final int buildNumber = getInteger("BUILD_NUMBER", Integer.MIN_VALUE);
/** Test level: more testing for higher levels. Defaults to 0. */
public static final int testLevel = getInteger("TEST_LEVEL", 0);
/** Debug level: more debug output for higher levels. */
/** Debug level: more debug output for higher levels. Defaults to 0. */
public static final int debugLevel = getInteger("DEBUG_LEVEL", 0);
}

View File

@ -1,4 +1,18 @@
# These parameters are filled in during building (maven), they are not strictly needed.
# Replacement mappings are defined in the pom.xml.
# ---- Build details ----
BUILD_TIMESTAMP=${buildTimestamp}
BUILD_NUMBER=${BUILD_NUMBER}
# ---- Java ----
JAVA_VENDOR=${java.vendor}
JAVA_VERSION=${java.version}
JAVA_VM_VENDOR=${java.vm.vendor}
JAVA_VM_VERSION=${java.vm.version}
JAVA_SPECIFICATION_VENDOR=${java.specification.vendor}
JAVA_SPECIFICATION_VERSION=${java.specification.version}
# ---- Parameters used at runtime ----
TEST_LEVEL=${TEST_LEVEL}
DEBUG_LEVEL=${DEBUG_LEVEL}