views:

40

answers:

4

I have to automate quite a lot in my current project. For this, I use ANT as it provides quite some commands. However, I have to use ant-contrib as I need for loops and other additional parts.

I use a model driven approach and have to automate the whole chain containing several models until the final model is created.

Is there an alternative to ANT that also provides an easy way to specify task execution? Maybe a DSL for this purpose? Is there anything like this out there?

+2  A: 

If you have a modern version of Ant (e.g. 1.8.1) you can use the scriptcondition task/element to run arbitrary scripts with all the control flow of a proper programming language in it.

Something like this:

<condition>
  <scriptcondition language="javascript" value="true">
    for(var i in self) { println(i); }
    self.setValue('true');
  </scriptcondition>
</condition>

See also: http://ant.apache.org/manual/index.html

A: 

And there is always the shell ... sh, batch or WSH or Powershell or if you have it: Python, Perl etc. can get you quite far.

+1  A: 

You could use any scripting language that suits your requirements:

e.g.

  • Bash/Shell Scripting (or PowerShell I suppose)

Something a bit more cross platform and ubiquitous...

  • Perl
  • Python
  • Ruby

...or something more build oriented.

  • Make
  • Rake
slomojo
+1  A: 

I'd be interested in which bits of Ant you find useful - I presume it's the tasks and not the language itself, or the declarative bit of Ant. If that's true, I'd suggest Groovy, Jython or Jruby would let you wrap the Ant tasks in code that's more suitable for your needs, without a line of XML.

Julian Simpson