Skip to content

enebo/akakamiari

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Purpose of this project: 
  Seamless integration between Rake and Ant environments.

Quick Start:
  To run examples cd into samples and do a command-line like:

  jruby -I../lib simple_compile.rb 

  Also the top-level Rakefile also uses these features to build the
  ant tasks so just running 'jruby -S rake' will use the ant features.

  Lastly, if you want to play with the <rake/> task, you can run ant
  itself in the project directory:

  CLASSPATH=lib/jruby-complete.jar ant call-rakefile-setup
  CLASSPATH=lib/jruby-complete.jar ant call-rakefile

  The first example calls a low-level task in the Rakefile called setup.
  The second example calls default which will end up calling compile.  This
  example is a little more trippy than the others since it is actually using
  ant tasks to run javac.

  As should be apparent in the previous examples, you need a copy of jruby-
  complete.jar to run these targets.  Put it into the project lib dir.

More info:
1. Allow Rakefiles to call ant tasks
    ant.java(:classname => "org.hsqldb.util.DatabaseManager", :fork => "yes") do
      classpath :refid => "project.class.path"
      arg :value => "-driver"
      arg :value => "org.hsqldb.jdbcDriver"
      arg :value => "-url"
      arg :value => "jdbc:hsqldb:#{data_dir}/music"
      arg :value => "-user"
      arg :value => "sa"
    end

2. Allow Rakefiles to be executed from ant.  The first task is merely
   a callout task:

   <rake/>
   <rake file="Rakefile"/>
   <rake file="Rakefile" task="compile"/>

   This just runs a rakefile and executes a Rake task.  If you omit the optional
   parameters then it will use the file 'Rakefile' and the task 'default'.

   The second task allows you to import all your rake tasks as ant targets.
   This allows you to mix and match between ant targets and rake tasks using
   ants target dependency management:

   <rake_import file="Rakefile"/>

   If your ant build.xml has compile and it depends on setup and setup is
   defined in your Rakefile then compile will call setup as a dependency.

3. The same as number 2, but the other direction:

   Invoke ant:

   ant '-f build.xml my_target'

   This just executes ant as a command.  You can also pass in an array if
   you so desire:

   args = ['-f', 'my_build.xml', 'my_target1']
   ant args

   Import ant targets into rake:

   ant_import 'build.xml'

About

My sandbox for upcoming JRuby ant <-> rake integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published