Need help with Ant within TeamCity

Hello all,

I am attempting to use TC to create targeted builds for sql and forms documents.

All artifacts are checked into Subversion, and the developers tag the trunk for deployment. The developers then will edit a property file that indicates which files should be zipped up and pushed to our Artifactory server.

The process is as follows:

Developer tags version 1.0.1, which will push all of trunk to the tag

Developer then edits release.properties to indicate file.1 and file.2 and puts it into project/tags/1.0.1.

TC (or ant) is initiated and reads project/tags/1.0.1/release.properties to determine what will be pushed

TC (or ant) zips up only the files indicated in release.properties, and pushes the zip to Artifactory

The deployer gets the zip out of Artifactory and does its thing.

Having a really hard time with SVNAnt -- svnSetting seems to not work correctly.   I am very far from being an Ant guru.  If anyone can show me the error of my ways, I would be most grateful.

******************  CODE FOLLOWS ********************

<?xml version="1.0"?>

<project name="TestSample" basedir="." default="main">

<path id="svnant.classpath" >

     <fileset dir="/alm/svnant/lib" >

         <include name="**/*.jar" />

     </fileset>

  </path>

  <svnSetting

     javahl="false"

     svnkit="false"

        username="me"

        password="myPassword"

        id="svn.settings"   />

  <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />

  <target name="setProperties">

    <property file="${%teamcity.build.checkoutDir%}/release.properties"/>

   <propertyset id="include">

     <propertyref prefix="Files"/>

    </propertyset>

    <propertyset id="release">

   <propertyref prefix="Tag"/>

    </propertyset>

    <propertyset id="subproj">

   <propertyref prefix="Project"/>

    </propertyset>

  </target>

  <target name="loadPropertyFile">

      <loadproperties>

        <file file="${%teamcity.build.checkoutDir%}/release.properties"/>

    </loadproperties>

  </target>

  <target name="checkoutPropertyFile">

    <svn refid="svn.settings">

      <checkout url="%vcsroot.Mercury_RMS.url%/tags/release.properties" destPath="${%teamcity.build.checkoutDir%}"/>

    </svn>

  </target>

  <target name="zipfiles">

   <pathconvert refid="includeFiles" pathsep="," property="includeFiles"/>

   <property name="sourcedir" value="${%system.teamcity.build.checkoutDir%}"/>

   <jar destfile="rmsRelease.zip" basedir="${sourcedir}/${Tag}" includes="${Files}"/>

  </target>

  <target name="main">

   <antcall target="checkoutPropertyFile"/>

   <antcall target="loadPropertyFile"/>

   <antcall target="setProperties"/>

    <antcall target="zipfiles"/>  

  </target>

</project>

*******************  END OF CODE *******************

[11:00:05]svnSetting

[11:00:05][svnSetting] Problem: failed to create task or type svnSetting
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.


1 comment
Comment actions Permalink

Hi

You need to add the typedef before the call to svnSetting and not after.

regards
ziv shapira

0

Please sign in to leave a comment.