Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Worth migrating to Rake?

Is it really advantageous to move to Rake from ant?

Anyone migrated from ant and find something monumental?

FYI: Current environment is Ant for J2ME builds

like image 392
prakash Avatar asked Sep 16 '08 11:09

prakash


3 Answers

I would say yes, but I have a different perspective than a Java-environment guy, because I'm a .NET-environment guy. I had written and maintained a non-trivial build script (clean, generate-assembly-info, build, test, coverage, analysis, package) in msbuild (MS' XML-driven NAnt effort) and it was very painful:

  • XML isn't friendly; it's very noisy
  • No-one else on the team was interested in learning it to the point of performing more, and more useful, automations; so high bus factor (ie, if I get hit by a bus, they're stuck with it)
  • It did not lend itself to refactoring or improvement - it was one of those 'touch-at-your-peril' things, you know?
  • It needed custom C# tasks to be written to run the various tools the build needed (though to be fair, often these are written by the vendors)

In about a work-week's worth of my time (got to love empty offices at Christmas time!), I've learned enough ruby+rake to replace the whole thing with a shorter (in terms of LOC) script with slightly more functionality, and more understandability (I hope, anyhow; haven't had it reviewed yet).

It benefits from: - It's a new language, but a real language. My team-mates like learning new languages, and this, while a thin excuse, is still an excuse ;-) This might mitigate the bus-factor if I'm right. - It's a short hop (I gather) from here to capistrano, the automated/remote/distributed deployment tool from the RoR world. Despite being an MS-stack shop, we're gonna be using that in combination with IIS7 finally having a CLI config tool.

So, yeah. Your mileage may vary, but it was worth it for me.

like image 62
Peter Mounce Avatar answered Nov 14 '22 19:11

Peter Mounce


Rake is great if you want:

  • Access to a real programming language; conditionals and loops are all dead-simple, compared to Ant (in which they are nigh-impossible)
  • File format that is easy to read and can be syntax checked
  • More intuitive/predictable assignment of values to variables

Rake is bad for you because:

  • You need to provide a lot basic of the tasks (like running javac, creating jar files, etc.) yourself. Projects like Raven might help, but it seems geared toward auto-downloading dependencies and not so much automated a build/deploy process. Plus, the documentation is a bit lacking.
  • Most java tools that can be automated are done as Ant tasks, which aren't easily runnable from Rake; starting up the JVM can be annoying at build time
like image 23
davetron5000 Avatar answered Nov 14 '22 18:11

davetron5000


You might want to check out buildr as well. It's a higher-level build-tool built on rake. IMHO it takes a lot of the good features from maven, and throws away the bad-ones. I haven't used it in anything big myself but I know people who have and are quite happy with it.

like image 1
auramo Avatar answered Nov 14 '22 18:11

auramo