From: Caleb Powell Date: 2007-03-15T02:51:10+09:00 Subject: Re: replacing maven with rake + rjb + ant Hi, with regards to invoking Ant tasks from a Ruby script, you might like to look at Antwrap: Project Page: https://rubyforge.org/projects/antwrap/ Docs: http://antwrap.rubyforge.org/ It is being used by the Raven build tool for Ant tasks, but is also available as a gem. It currently works on the JRuby interpreter. However, I have it working in the native (or standard) Ruby interpreter by using the Ruby Java Bridge. An update for this will be coming soon. On 12/8/06, thebox wrote: > Hi! > > We do 99.999% of our development in java. Our system is a complex J2EE > distributed application currently (poorly) managed with maven. Now, I > don't want to get into the reasons for doing this, but we have > struggled enough to seriously consider replacing maven with some decent > build tool. > > Of course, rake is attractive because it has real file-dependant tasks, > it supports both declarative and imperative programming styles and > today I think we may stick with it, waiting for eventually more > maturity from rant. > > The point of this post though is that we would like to find a way to > coordinate common java task (like compiling, jaring, waring, deploying > in containers, etc.) without reinventing the wheel. An obvious choice > would be to piggy back on maven through system calls, but my ambitions > are bigger than that, because I want to break the addiction with maven > repository dependency management structure. > > A better idea would be to rely on ant and of course you want to do it > in an efficient manner. As Martin Fowler mentioned in his article [1], > best way would be to run ant as a server, so that you don't have to pay > jvm initialization startup time for any call. Apparently, Jon Tirsen > has never released his code (or I wasn't able to find it). I've only > found an old "proof of concept" in codehaus [2]. I'm looking for > something more solid than that. > > Ant can be effectively driven like a server, by simply using an > extension like Ant-Contrib [3]. The only problem is that if you use > Ant-Contrib as it is, the protocol between a client and an ant server > relies on java object serialization, making it practically useless from > the ruby world (you don't really want to reproduce the java object > serialization protocol in ruby, do you?!?). > > Hence, I'm currently thinking about using rjb to instantiate > client-side Ant-Contrib java classes from rake and then understand if I > can let the jvm dealing with socket communication, or I serialize java > objects on a bytestream and let ruby handle the communication over the > socket. This is in theory, of course, because I've never used rjb > before and I don't know how easy, manageable and fast it is. > > What do you guys think about it? Anybody has any experience around > stuff like this? Alternatives? > > Thanks > Giuliano > > [1] ==> http://www.martinfowler.com/articles/rake.html > [2] ==> > http://jira.codehaus.org/browse/HAUS-211;jsessionid=asvbK6wlqWt7H6hWmN?actionOrder=desc > [3] ==> http://ant-contrib.sourceforge.net/ > > > -- Caleb "There is no theory of evolution, just a list of creatures Chuck Norris allows to live."