tags:

views:

70

answers:

2

I use the Ant cvs and sql tasks to check out and deploy a full code set of database objects. I also use the Ant cvschangelog task to generate a list of what has changed between two tags. It seems that there should be some way of defining a target process that would iterate over the list of elements from the generated changelog xml file and only execute files that have changed between two tags (all of the files use "CREATE or REPLACE" syntax and only replaceable objects are of interest here).

Is there any native Ant solution for this or will a custom task to parse the xml file be necessary?

A: 

Last time I checked Ant didn't support any sort of looping constructs, so you'll have to write your own custom task> However, there is an xslt task that lets you apply stylesheets to xml files. It will depends on what you want to do with the xml itself.

TskTsk
+2  A: 

You might investigate the ant-contrib tasks for looping constructs. The for or foreach task may be just what you need.

martin clayton
Thanks - I had looked at the for/foreach tasks and was hoping that there was some more direct way of processing the list. Unless I'm missing something, it appears that this method would require me to parse the xml file to extract the file names and build a delimited string from the list. Although "deploy what's changed" seems like it would be a common requirement, I'm beginning to think that something like this will be necessary
dpbradley