changeset 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 7ea82d063131
children cea0fb35f941 178326c22081
files build/ant.build.xml teamcity-plugin.xml
diffstat 2 files changed, 17 insertions(+), 10 deletions(-) [+]
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>
 
--- a/teamcity-plugin.xml	Thu Aug 01 11:53:48 2013 +0400
+++ b/teamcity-plugin.xml	Thu Aug 01 11:59:50 2013 +0400
@@ -4,7 +4,7 @@
   <info>
     <name>mercurial</name>
     <display-name>VCS Support: Mercurial</display-name>
-    <version>@Plugin_Version@</version>
+    <version>@version@</version>
     <vendor>
       <name>JetBrains, s.r.o.</name>
       <url>http://www.jetbrains.com</url>