This sounds really terrific. A basic Rake question:

  How did you get tasks named "safe:clean", etc?

Is ":" a legal character in a name, and you've done
some really clever naming, or is there some sort of
implied hierarchy?

Travis Tilley (JIRA) wrote:
rake-based build system for JRuby
---------------------------------

                 Key: JRUBY-1449
                 URL: http://jira.codehaus.org/browse/JRUBY-1449
             Project: JRuby
          Issue Type: New Feature
          Components: Miscellaneous
    Affects Versions: JRuby 1.x
            Reporter: Travis Tilley
            Assignee: Thomas E Enebo
            Priority: Trivial
             Fix For: JRuby 1.x
         Attachments: jraven-0.0.1.tar.gz

Multiple JRuby developers have stated how much they would love a rake based 
build system, but more important issues are taking up their time. Hopefully I 
can be of assistance here.

The first step, IMHO, is ensuring the reliability of the build and that builds 
are reproducible at all stages of development. This involves forcing the build 
system to use a 'safe' JRuby install somewhere. This first release contains 
-just- this functionality, and nothing else. I am releasing it here to get 
feedback on my approach.

Rake tasks:

rake safe:clean         # remove the safe jruby install
rake safe:exec          # runs jruby_exec(ENV['executable'], ENV['arguments'])
rake safe:extract       # extract jruby_complete to safe install location
rake safe:fix_shebangs  # fix the shebang lines in installed binaries
rake safe:install_gems  # install ENV['gems'] within safe jruby environment
rake safe:shell         # spawns a shell set up to use the safe jruby install
rake safe:test          # test to make sure the safe:force task is working

To test the SafeJruby tasks, run 'rake safe:test', which will show you your 
current ruby runtime, setup the safe environment if need be, perform runtime 
replacement with the safe jruby, and run the originally requested rake task 
(which just prints out the path to the current ruby runtime to show that 
replacement did, in fact, succeed).

Another rake task that's quite useful is safe:shell, which sets up the 
environment to always use the safe jruby install and then spawns a new 
ENV['SHELL']. If the shell is bash, it spawns the shell with --norc so that the 
ruby-set PATH isn't overwritten by /etc/bashrc or another init script. Note 
that if you run safe:shell, this disables runtime replacement while you are 
using that shell... as it is unnecessary (you are already using the safe 
runtime).

The switch to a safe jruby runtime only happens if you are running a task that 
has defined, as one of its' dependencies, safe:force. This allows you to define 
rake tasks that do not require a runtime switch and avoid the additional time 
that it takes to perform that switch (you can also use rake:shell to avoid the 
problem altogether). I'm not sure yet how well this will work in practice.

The SafeJruby class depends on the existence of either safe/jruby-complete.jar 
or lib/jruby-complete.jar, and will warn you when using the lib version instead 
of the safe version (as this may not be what you had intented).

Please let me know if you have any opinions or feedback regarding this 
approach, or anything related to the build system attempt at all. Thankyou! ^_^



--

Eric Armstrong, Document Systems Architect, Sun Microsystems
http://blogs.sun.com/coolstuff
http://www.artima.com/weblogs/index.jsp?blogger=cooltools

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to