README.rdoc

Path: README.rdoc
Last Update: Mon Jan 22 21:21:39 -0800 2007

Raven — Build Java with Rake and Gem

Raven is a build tool for Java programs based on Rake and Ruby Gems (and a bit of Maven but only for the good part).

First it wraps jar files in a Ruby Gem. You can then start manage your java jar library just like a Gem library. Tools are provided to convert a Maven jar repository to a Gem repository (both local on your machine or on a public server). This allows users to both start quickly working with Raven if they were using Maven, but also to produce easily very complete Gem central repositories with a lot of jars.

Second, you declare your dependencies in a Rakefile. You basically say which gems you need (and so which jars will be included in your classpath) for building. When building, if some Gems are missing, they are automatically installed in your local Gem repository. Just like Maven.

Third, Raven gives you a small library of Rake tasks that you can use to compile your java classes, build a jar file, build a war file, produce javadoc, wrap the jar you built in a Gem, …

This effectively gives you everything you need to build Java projects, using Gems for dependencies management and Rake for scripts.

Example of Rakefile using Raven:


require ‘raven’ require ‘rake/clean‘

CLEAN.include(‘target’)

dependency ‘compile_deps’ do |t|

    t.deps << [{'commons-logging' => '1.1'}, 'commons-pool']
    t.deps << ['commons-lang', 'wsdl4j', 'log4j']

end

javac ‘compile’ => ‘compile_deps’ do |t|

    t.build_path << "src/main/java"

end

jar ‘ode-utils.jar’ => ‘compile‘

jar_source ‘ode-utils-source.jar’ => ‘compile‘

lib_dir ‘build_lib’ => ‘compile_deps’ do |t|

    t.target = 'dist/lib'

end

war ‘utils.war’ => [‘compile’, ‘compile_deps’] do |t|

    t.webapp_dir = 'src/test'

end

javadoc ‘jdoc’ => ‘deps‘

gem_wrap_inst ‘gem’ => ‘ode-utils.jar’ do |t|

    t.version = '1.0'
    t.group = 'ode'

end


See Raven::DependencyTask, Raven::JavacTask, Raven::JarTask, Raven::JarSourceTask, Raven::WarTask, Raven::LibDirTask, Raven::JavaDocTask, Raven::GemWrapTask and Raven::GemInstallTask for more information.

[Validate]