You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2010/08/02 22:15:26 UTC

svn commit: r981669 - in /uima/uimaj/trunk/uimaj-core: ./ src/main/java/org/apache/uima/impl/ src/main/versionJava/ src/main/versionJava/org/ src/main/versionJava/org/apache/ src/main/versionJava/org/apache/uima/ src/main/versionJava/org/apache/uima/impl/

Author: schor
Date: Mon Aug  2 20:15:26 2010
New Revision: 981669

URL: http://svn.apache.org/viewvc?rev=981669&view=rev
Log:
[UIMA-1834] added a new class, UimaVersion and UimaAsVersion, which is not in the source-path, and has substitutable values for the version (major, minor, incremental), and updated the pom to use filtered resource processing to produce a new class under target which has the version info from the pom substituted in.

Added:
    uima/uimaj/trunk/uimaj-core/src/main/versionJava/
    uima/uimaj/trunk/uimaj-core/src/main/versionJava/org/
    uima/uimaj/trunk/uimaj-core/src/main/versionJava/org/apache/
    uima/uimaj/trunk/uimaj-core/src/main/versionJava/org/apache/uima/
    uima/uimaj/trunk/uimaj-core/src/main/versionJava/org/apache/uima/impl/
    uima/uimaj/trunk/uimaj-core/src/main/versionJava/org/apache/uima/impl/UimaVersion.java
Modified:
    uima/uimaj/trunk/uimaj-core/pom.xml
    uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/impl/UIMAFramework_impl.java

Modified: uima/uimaj/trunk/uimaj-core/pom.xml
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/pom.xml?rev=981669&r1=981668&r2=981669&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-core/pom.xml (original)
+++ uima/uimaj/trunk/uimaj-core/pom.xml Mon Aug  2 20:15:26 2010
@@ -80,6 +80,52 @@
 	<build>
 		<finalName>uima-core</finalName>
 		<plugins>
+      
+      <!-- filter the template for the version java code
+           to insert the version from properties -->
+      <plugin>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>2.4.3</version>  <!-- 2.4.0 fails -->
+        <executions>
+          <execution>
+            <id>setVersions</id>
+            <goals><goal>copy-resources</goal></goals>
+            <phase>generate-sources</phase>
+            <configuration>
+              <outputDirectory>${project.build.directory}/generated-sources/releaseVersion</outputDirectory>
+              <resources>
+                <resource>
+                  <filtering>true</filtering>
+                  <directory>src/main/versionJava</directory>
+                </resource>
+              </resources>
+              <delimiters>
+                <delimiter>${*}</delimiter>
+              </delimiters>
+              <useDefaultDelimiters>false</useDefaultDelimiters>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      
+      <!-- add the generated sources to the compile sources -->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <version>1.5</version>
+        <executions>
+          <execution>
+            <id>addVersionSrc</id>
+            <goals><goal>add-source</goal></goals>
+            <configuration>
+              <sources>
+                <source>${project.build.directory}/generated-sources/releaseVersion</source>
+              </sources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-surefire-plugin</artifactId>

Modified: uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/impl/UIMAFramework_impl.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/impl/UIMAFramework_impl.java?rev=981669&r1=981668&r2=981669&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/impl/UIMAFramework_impl.java (original)
+++ uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/impl/UIMAFramework_impl.java Mon Aug  2 20:15:26 2010
@@ -191,21 +191,21 @@ public class UIMAFramework_impl extends 
    * @see org.apache.uima.UIMAFramework#_getMajorVersion()
    */
   public short _getMajorVersion() {
-    return 2; // major version
+    return UimaVersion.getMajorVersion(); // major version
   }
 
   /**
    * @see org.apache.uima.UIMAFramework#_getMinorVersion()
    */
   public short _getMinorVersion() {
-    return 3; // minor version
+    return UimaVersion.getMinorVersion(); // minor version
   }
 
   /**
    * @see org.apache.uima.UIMAFramework#_getBuildRevision()
    */
   public short _getBuildRevision() {
-    return 0; // build revision
+    return UimaVersion.getBuildRevision(); // build revision
   }
 
   /**

Added: uima/uimaj/trunk/uimaj-core/src/main/versionJava/org/apache/uima/impl/UimaVersion.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/main/versionJava/org/apache/uima/impl/UimaVersion.java?rev=981669&view=auto
==============================================================================
--- uima/uimaj/trunk/uimaj-core/src/main/versionJava/org/apache/uima/impl/UimaVersion.java (added)
+++ uima/uimaj/trunk/uimaj-core/src/main/versionJava/org/apache/uima/impl/UimaVersion.java Mon Aug  2 20:15:26 2010
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+package org.apache.uima.impl;
+
+public class UimaVersion {
+  /**
+   * @see org.apache.uima.UIMAFramework#_getMajorVersion()
+   */
+  public static short getMajorVersion() {
+    return ${parsedVersion.majorVersion}; // major version
+  }
+
+  /**
+   * @see org.apache.uima.UIMAFramework#_getMinorVersion()
+   */
+  public static short getMinorVersion() {
+    return ${parsedVersion.minorVersion}; // minor version
+  }
+
+  /**
+   * @see org.apache.uima.UIMAFramework#_getBuildRevision()
+   */
+  public static short getBuildRevision() {
+    return ${parsedVersion.incrementalVersion}; // build revision
+  }
+
+}
\ No newline at end of file