From 67569ebbcd1cf4af5108acc4e81de207738ef26f Mon Sep 17 00:00:00 2001 From: antelder Date: Wed, 27 Jan 2010 09:12:18 +0000 Subject: Update the Version to include the version and build time git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@903575 13f79535-47bb-0310-9956-ffa450edef68 --- sca-java-2.x/trunk/modules/core-spi/pom.xml | 4 ++- .../org/apache/tuscany/sca/runtime/Version.java | 14 +++++++++- .../sca/runtime/core-spi-messages.properties | 28 -------------------- .../apache/tuscany/sca/runtime/revision.properties | 30 ++++++++++++++++++++++ .../tuscany/sca/runtime/VersionTestCase.java | 3 +++ 5 files changed, 49 insertions(+), 30 deletions(-) delete mode 100644 sca-java-2.x/trunk/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/core-spi-messages.properties create mode 100644 sca-java-2.x/trunk/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/revision.properties 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 @@ process-resources + + + filtering="on" file="${basedir}/src/main/resources/org/apache/tuscany/sca/runtime/revision.properties"/> 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/core-spi-messages.properties deleted file mode 100644 index 0659d609fd..0000000000 --- a/sca-java-2.x/trunk/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/core-spi-messages.properties +++ /dev/null @@ -1,28 +0,0 @@ -# -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# - -#-- Don't edit these. They're updated from the build, see the -# buildnumber-maven-plugin in this modules pom.xml -revision=@svnRevision@ -#---------------------- - - - diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/revision.properties b/sca-java-2.x/trunk/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/revision.properties new file mode 100644 index 0000000000..9018bd1a1b --- /dev/null +++ b/sca-java-2.x/trunk/modules/core-spi/src/main/resources/org/apache/tuscany/sca/runtime/revision.properties @@ -0,0 +1,30 @@ +# +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# + +#-- 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()); } } -- cgit v1.2.3