I'm pleased to announce preliminary (and very experimental) support
for the Clojure AOT compiler and REPL within Apache Buildr (http://
buildr.apache.org).  At present, this support is only available within
my Git fork available here: git://github.com/djspiewak/buildr.git
More specifically, Clojure support is available within the "clojure"
and "master" branches ("master" branch alone contains REPL support).
It should be possible to install this particular version of Buildr by
using the following commands, though I'm honestly not sure how up to
date GitHub's gem repository is:

  gem sources -a http://gems.github.com
  sudo gem install djspiewak-buildr

Once installed, Clojure support is activated in a project simply by
storing your .clj scripts within the src/main/clojure directory.  Note
that the (ns) directive will need to match the subdirectory, otherwise
compilation will fail.  By default, every script is compiled to the
target/classes directory.  Namespaces are auto-detected from the
directory structure.  Only updated files are re-compiled (based on
mtime of .clj file and its corresponding *__init.class).  If you wish
to override the auto-detection and specify a reduced set of
namespaces, it can be done using the `compile.using` directive within
your project definition in your buildfile.  Thusly:

define 'clojure-contrib' do
  compile.using :libs => ['clojure.contrib.command-line',
'clojure.contrib.mmap']
end

Any scripts which are *not* pre-compiled will be copied verbatim to
the target/classes directory w.r.t. their position in the directory
structure.  Note that you will need to have set CLOJURE_HOME for this
to work.

You will have to be using the "master" branch from my git repository
in order to use the Clojure REPL through Buildr (or install via the
gem command given above).  To invoke, simply run the following command
somewhere in your project hierarchy:

  buildr shell

This will launch the Clojure REPL pointing at your project's
dependencies and the updated target/classes directory (compilation is
re-run if necessary).  Additionally, if you have a valid license for
JavaRebel, you can make use of it with the REPL by setting the
REBEL_HOME environment variable.

Note that you cannot mix Java and Clojure sources within the same
project.  However, this is fairly easy to overcome by splitting the
languages into separate sub-projects.  Thus, your top-level project
might contain all of your Clojure sources, while the sub-project might
contain Java.  There are more details regarding this process on the
Buildr project page.

One thing to keep in mind is that Buildr was designed to serve as a
build system for more static languages (specifically: Java, Scala,
Groovy).  Thus, it is pre-biased toward things like a separate
compilation phase (the REPL points to target/classes rather than src/
main/clojure).

Fair warning: this language support is *extremely* experimental and
probably not too reliable at this point.  Also note that while it is
possible that Clojure support will be merged into the Buildr trunk in
future, it has not yet been decided one way or another (see
https://issues.apache.org/jira/browse/BUILDR-259).  Use at your own
risk!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to