summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/pom.xml4
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Version.java14
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/revision.properties (renamed from sca-java-2.x/trunk/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/core-spi-messages.properties)2
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/test/java/org/apache/tuscany/sca/runtime/VersionTestCase.java3
4 files changed, 21 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/core-spi/pom.xml b/sca-java-2.x/trunk/modules/core-spi/pom.xml
index 5d89fcbe93..ab1952c730 100644
--- a/sca-java-2.x/trunk/modules/core-spi/pom.xml
+++ b/sca-java-2.x/trunk/modules/core-spi/pom.xml
@@ -98,9 +98,11 @@
<phase>process-resources</phase>
<configuration>
<tasks>
+ <filter token="version" value="${pom.version}"/>
<filter token="svnRevision" value="${sources.version}"/>
+ <filter token="buildtime" value="${build.timestamp}"/>
<copy toDir="${basedir}/target/classes/org/apache/tuscany/sca/runtime" overwrite="true"
- filtering="on" file="${basedir}/src/main/resources/org/apache/tuscany/sca/runtime/core-spi-messages.properties"/>
+ filtering="on" file="${basedir}/src/main/resources/org/apache/tuscany/sca/runtime/revision.properties"/>
</tasks>
</configuration>
<goals>
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Version.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Version.java
index b112176982..6060910a17 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Version.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/Version.java
@@ -23,13 +23,25 @@ import java.util.ResourceBundle;
public class Version {
+ public static final String VERSION;
public static final String REVISION;
+ public static final String BUILDTIME;
static {
- ResourceBundle rb = ResourceBundle.getBundle("org/apache/tuscany/sca/runtime/core-spi-messages");
+ ResourceBundle rb = ResourceBundle.getBundle("org/apache/tuscany/sca/runtime/revision");
+ VERSION = rb.getString("version");
REVISION = rb.getString("revision");
+ BUILDTIME = rb.getString("buildtime");
}
+ public static String getVersion() {
+ return VERSION;
+ }
+
public static String getRevsion() {
return REVISION;
}
+
+ public static String getBuildTime() {
+ return BUILDTIME;
+ }
}
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/core-spi-messages.properties b/sca-java-2.x/trunk/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/revision.properties
index 0659d609fd..9018bd1a1b 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/core-spi-messages.properties
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/revision.properties
@@ -21,7 +21,9 @@
#-- Don't edit these. They're updated from the build, see the
# buildnumber-maven-plugin in this modules pom.xml
+version=@version@
revision=@svnRevision@
+buildtime=@buildtime@
#----------------------
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/test/java/org/apache/tuscany/sca/runtime/VersionTestCase.java b/sca-java-2.x/trunk/modules/core-spi/src/test/java/org/apache/tuscany/sca/runtime/VersionTestCase.java
index b23709199d..3dd429ce23 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/test/java/org/apache/tuscany/sca/runtime/VersionTestCase.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/test/java/org/apache/tuscany/sca/runtime/VersionTestCase.java
@@ -27,7 +27,10 @@ public class VersionTestCase {
@Test
public void testRevision() {
// Doesn't test much, just that it has been initilized to a number
+ System.out.println(Version.getVersion() + " " + Version.getRevsion() + " " + Version.getBuildTime());
+ Integer.parseInt(Version.getVersion());
Integer.parseInt(Version.getRevsion());
+ Integer.parseInt(Version.getBuildTime());
}
}