diff build/ant.build.xml @ 616:7a4ecffe34a9 Gaya-8.0.x

fix plugin version
author Dmitry Neverov <dmitry.neverov@gmail.com>
date Thu, 01 Aug 2013 11:59:50 +0400
parents f77000a89e97
children 31a1aca3305c
line wrap: on
line diff
--- a/build/ant.build.xml	Thu Aug 01 11:53:48 2013 +0400
+++ b/build/ant.build.xml	Thu Aug 01 11:59:50 2013 +0400
@@ -1,23 +1,30 @@
 <project name="build hooks" default="replace-tokens-in-teamcity-plugin-xml" basedir=".">
 
-
   <target name="replace-tokens-in-teamcity-plugin-xml">
     <property name="home" value="${artifact.output.path}"/>
 
-    <echo message="replacing tokens in teamcity-plugin.xml file under ${home}"/>
+    <tstamp>
+      <format property="timestamp" pattern="yyyyMMddhhmmss"/>
+    </tstamp>
 
-    <condition property="build.number" value="snapshot" else="${build.number}">
-      <not>
-        <isset property="build.number"/>
-      </not>
+    <property name="snapshot.build.number" value="SNAPSHOT-${timestamp}"/>
+
+    <condition property="plugin.version" value="${snapshot.build.number}" else="${build.number}">
+      <or>
+        <not>
+          <isset property="build.number"/>
+        </not>
+        <matches pattern="snapshot-.*" string="${build.number}" casesensitive="false"/>
+      </or>
     </condition>
 
-    <echo message="Setting version to: ${build.number}"/>
+    <echo message="replacing tokens in teamcity-plugin.xml file under ${home}"/>
+    <echo message="Setting version to: ${plugin.version}"/>
+
     <!-- update all references in teamcity-plugin.xml files -->
     <replace dir="${home}" summary="true">
       <include name="**/teamcity-plugin.xml"/>
-
-      <replacefilter token="@Plugin_Version@" value="${build.number}"/>
+      <replacefilter token="@version@" value="${plugin.version}"/>
     </replace>
   </target>