view build/ant.build.xml @ 663:e01fa9602447

switch to new API
author eugene.petrenko@gmail.com
date Tue, 01 Oct 2013 10:12:55 +0200
parents 7a4ecffe34a9
children 31a1aca3305c
line wrap: on
line source
<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}"/>

    <tstamp>
      <format property="timestamp" pattern="yyyyMMddhhmmss"/>
    </tstamp>

    <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="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="@version@" value="${plugin.version}"/>
    </replace>
  </target>

</project>