Build Java Projects with Raven

Discussions

News: Build Java Projects with Raven

  1. Build Java Projects with Raven (16 messages)

    Say "nevermore" to inexpressiveness and use Ruby to build your Java applications Ant is arguably the de facto build tool for the Java™ platform; however, other build tools, which support a more expressive paradigm that XML lacks, are entering the scene. Automation expert Paul Duvall describes how Raven, a build platform built on top of Ruby, leverages the power of a full-featured programming language with the simplicity of a build-centric Domain Specific Language. Paul writes:
    I have an existing Java project, and over the past few years I've meticulously maintained an Ant build script for it. I like the plethora of tasks available for Ant; however, I often find that the XML syntax of Ant scripts is somewhat onerous to write. Further, Ant's XML heritage is occasionally limiting when it comes to expressiveness. In fact, when I find myself needing a higher degree of flexibility (say with conditional logic), I'm often forced to write a custom task or embed logic within Ant's script task using Groovy, for instance.
    The article discusses a list of common Java tasks, like javac, javadoc, war, and junit. Raven may provide a more expressive alternative than XML-based build systems by leveraging the flexibility and expressiveness of Ruby and custom DSLs.

    Threaded Messages (16)

  2. Re: Build Java Projects with Raven[ Go to top ]

    Raven's pretty neat. The problems as I see them:
    • Ruby's expressiveness is great. But... I keep thinking there's a DSL out there that doesn't involve Ruby syntax... something that could have a syntax in english, or similar. Imagine: compile with javac from sourcedir into destdir build war using resources with classes from destdir with dependencies from libdirIt could even be done with Ruby, come to think of it, with some warts.
    • Dependency management. Don't tell anyone this, okay? I'm using Maven 2, because everyone else has drunk the kool-aid and it's a pain to do dependency management manually now. Yes, I'm looking at you, jackrabbit maintainers. If only looks could kill... you screwed up EVEN THE MAVEN DEPENDENCIES *argh* *taking medicine* Maven sucks... but the dependency management and bundle generation is the right idea. Good ideas, necessary ideas, done in the worst possible way. (Don't take this as a challenge and try to do it even worser, okay? I'm sure you can, and I don't want to have to scratch my eyes out when I see it.) Dependency management is what's killed Ant for me, and I don't see evidence that Raven supports dependencies in a Maven-like fashion. And yes, Ant fans, I know about Ivy.
  3. Re: Build Java Projects with Raven[ Go to top ]

    I have to maintain a messy ant file, and I cannot oblige other devs to download raven/gant/whatever and set up a environment variable. I would like an ant task that enables me to run raven tasks in a self-contained way. Other thing that would be nice would be a ant2raven converter.
  4. Re: Build Java Projects with Raven[ Go to top ]

    Raven's pretty neat.

    The problems as I see them:
    • Ruby's expressiveness is great. But... I keep thinking there's a DSL out there that doesn't involve Ruby syntax...
    There's always gradle if you want groovy but not gant: http://www.gradle.org/
  5. Re: Build Java Projects with Raven[ Go to top ]



    Dependency management is what's killed Ant for me, and I don't see evidence that Raven supports dependencies in a Maven-like fashion.

    And yes, Ant fans, I know about Ivy.
    Oh, and there's this: http://www.apache.org/dyn/closer.cgi/maven/binaries/maven-ant-tasks-2.0.9.jar
  6. Re: Build Java Projects with Raven[ Go to top ]

    I'm using Maven 2, because everyone else has drunk the kool-aid and it's a pain to do dependency management manually now. Yes, I'm looking at you, jackrabbit maintainers. If only looks could kill... you screwed up EVEN THE MAVEN DEPENDENCIES *argh* *taking medicine*
    So did the log4j people... sigh. http://yoavs.blogspot.com/2008/05/caution-log4j-1215-brings-in-bunch-of.html
  7. new build system?[ Go to top ]

    Guys, what would you think about discussing a new build system, one that used something closer to english to build things, and one that sort of did the thing correctly? Think of dependency management along rpm's lines: myapp: requires: logger servlet jcr-impland...logn provides: logger...andjackrabbit: requires: logger lucene jcr provides: jcr jcr-impl You can see a sort of OSGi-like provision capability here - imagine using OSGi for the build system, and having the OSGi container pulling in the dependencies and fulfilling them as it can. Anyone want to talk about requirements and implementation plan? Maven's the right idea, done the wrong way, and with the wrong audience in mind. Let's fix it.
  8. Re: new build system?[ Go to top ]

    Guys, what would you think about discussing a new build system, one that used something closer to english to build things, and one that sort of did the thing correctly?
    Hi Joseph, I think we're stuck on the way to the cusp of component orientation and the build systems pretty much reflect that reality. Given that we haven't figured out component orientation (in practice) build systems conflate all the aspects of building a complex system. Imagine a hypothetical virtual build system for a modern skyscraper if it had to include cement mix and form pouring factors alongside of high-level system integration aspects -- you'd get something along the lines of ant (and perhaps) maven ... I would suggest that the community focus on getting component orientation working. Given that, each level of construction (low level object compositions; component packaging; and finally system assembly) each would have their own (probably) simple and (definitely) focused specialized build system. Note that such an approach would also (intrinsically) address testing at the appropriate level. If that doesn't happen, then sure, we could use the OSGi approach, or even the JEE approach (what are those DDs but depenedency patches?), to assemble a large system from pre-built and custom pseudo-components. But the inherent complexity will not go away. RoR, which was the 'practical' answer to JEE complexity, reduced complexity at the logical level by adopting a finite set of canonical patterns. Naturally, we could do the same with the system build issue. But wait, isn't that called Maven? ;) /R
  9. Re: new build system?[ Go to top ]

    +1 Yes, Maven is a bit harder to learn than ant but it is the best solution on the market. raven sounds like reinventing the wheel, and IMHO the wheel isn't very round ;-)
  10. Re: new build system?[ Go to top ]

    For those that really love Ant and want a real project model with re-usable target, I'm working on a build system designed as a Ant build.xml generator: http://el4ant.sourceforge.net/ I'm currently including Ivy as dependency manager - used also internally for el4ant plugin dependencies. Any comment and help welcome - please use SF forums: http://sourceforge.net/forum/forum.php?forum_id=492236
  11. Re: new build system?[ Go to top ]

    For those that really love Ant and want a real project model with re-usable target, I'm working on a build system designed as a Ant build.xml generator: http://el4ant.sourceforge.net/

    I'm currently including Ivy as dependency manager - used also internally for el4ant plugin dependencies.

    Any comment and help welcome - please use SF forums: http://sourceforge.net/forum/forum.php?forum_id=492236
    Which way it is better than Maven2?
  12. One thing sometimes found lacking in both Maven and Ant is the limitation of Ant Path expressions for specifying directories and files. I've built a library called FSPath which uses 'XPath like' expressions to do filesystem tasks such as searching, copying, moving and deleting. http://sugar.sourceforge.net/fspath/ IMHO, Maven and Ant may lack expressiveness in certain areas, but there's no reason why little languages can't be plugged in to bridge those gaps.
  13. Re: new build system?[ Go to top ]

    Here are some points: - as it is only Ant, Java and Ant knowledge is enough to use, understand, extend and debug el4ant (development begins because maven1 is too limited, and maven2 was beta) - project model is defined with XML namespaces, extensible with plugins - it supports multi-projects (called modules in el4ant) - you can define many runtime targets per module (Main Class, J2EE container, JUnit test suite...) thanks to execution unit concept (think about client/server targets as an example) - you have fine control on what is included in each jar, war, ear
  14. Raven and Maven[ Go to top ]

    How do you compare this and maven ? What is the advantages I would gain using Raven over Maven ? Deepal http://blogs.deepal.org
  15. Re: Build Java Projects with Raven[ Go to top ]

    Few comments. 1) Raven has been abandoned in favor of builder: http://incubator.apache.org/buildr/ 2) buildr has all the dependency management stuff you guys are talking about 3) I personally found buildr overkill (as I do Maven), so I noticed that builder uses the "AntWrap" gem. So I wrote a build file using Ruby's Rake and the AntWrap gem. Makes translating from Ant easy. Here's a snippet of a ruby rake file that has java targets: require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'rubygems' require 'antwrap' require 'java' web_dir = "../web" common_lib_dir = "../lib" @ant = Antwrap::AntProject.new(:ant_home=>'/usr/share/ant') @ant.mkdir(:dir => "classes") @ant.path(:id => "common.class.path"){ @ant.fileset(:dir => "#{common_lib_dir}"){ @ant.include(:name => "**/*.jar") } } desc "clean the classes directory" task :clean do @ant.delete(:dir => "classes") end desc "generate war file" task :war =>[:compile] do @ant.war(:update => false, :destfile=>"ei.war", :webxml=>"../web/WEB-INF/web.xml"){ @ant.fileset(:dir => web_dir) } end task :default => [:compile] desc "compile java classes" task :compile do puts "compiling java classes to [classes]..." @ant.javac(:srcdir => "../src", :destdir => "classes", :deprecation=>true, :debug=>true, :fork=>true){ @ant.classpath(:refid => "common.class.path") @ant.compilerarg(:value =>"-Xlint") } end end
  16. sorry for the lousy code paste[ Go to top ]

    try this: http://pastie.org/271353
  17. Re: Build Java Projects with Raven[ Go to top ]

    Don't forget GANT