Using the Ant FTP Task in Eclipse

And here is another joy of ANT - you can move files by FTP. Its not one of the core tasks in ANT, so you can be forgiven for trying it, and it not working. Go check out the ANT Manual FTP Task page and it tells you the components you require.

[More]

Using the ANT build.number file

I was wondering how to keep track of how many builds have taken place, putting it together into a overall product version number with the Subversion Revision number.

It turns out that ANT actually keeps a record of builds itself using the Buildnumber task, all you have to do is produce a blank build.number file. If the build.number file is local to the build.xml you need no special attributes, ANT will update the build number for you.

<target name="buildnumber">
      
   <buildnumber/>
   <echo message="ANT Build number ${build.number}" />
      
</target>

How good is that? Marvellous I think is the word you need.

Keeping the private stuff out of ANT config files

I have been using ANT to get builds done of the many projects we work on, and one of the things that has bugged me was that the SVN username and passowrd was stored in the build.properties file.

Today the ANT Manual came to the rescue with the input task.

[More]

How to get the SVN revision number for use in ANT

As part of my build and deploy process I wanted to get the revision number of the working copy and append it into the application so its visible.

To do this you need to have already installed the SVNAnt task, (see my previous post) as its not a core ANT task.

[More]

Exporting a SVN Working Copy with ANT

Once you have installed the SVN task to Eclipse, you can begin to look at the possibilities. For example in a deployment scenario you could use ANT to export the HEAD revision so you have a clean set of files ready for moving by FTP or some other means.

There certainly isnt any VooDoo here, its all very straight forward.

<!-- export current head revision -->

<echo message="exporting to ${buildDir}" />

<property name="buildDir" value="c:/export/${projectName}" />

<svn username="username" password="password">
   
   <export srcUrl="http://localhost/svn/testrepository" destPath="${buildDir}" revision="HEAD" />

</svn>

Installing SVNAnt into Eclipse

On my road of exploration for ANT, and the end goal of using it for deployment, I have had to tackle how to get files out of SVN ready for moving to a server. This means getting ANT to run the equivalent of an svn export from the command line.

This is possible using the command line client through ANT thus:

<exec executable="svn">
<arg line="co ${svn.projecturl} ${build.temp} -r ${svn.revision} --username ${svn.username} --password ${svn.password}"/>
</exec>

However there is a nicer way that doesn't involve installing the SVN command line client. Enter SvnAnt.

[More]

Using ANT from Eclipse

I have recently taken the plunge into ANT for use in deployment and doing some mundane tasks, and since I use Eclipse I have been playing with the integrated version that comes bundled.

There were a few things that are not very well documented (or I could not find) that took me a while to figure out, so I though I would share.

[More]

BlogCFC was created by Raymond Camden. This blog is running version 5.9.001.