On May 16, 7:22 am, "Hugo Duncan" <hugodun...@users.sourceforge.net>
wrote:
>> ...
>
> In case you are interested, I recently implemented some of the  
> infrastructure to allow you to write maven plugins in clojure. A simple  
> example that just logs basedir is here:
>
> http://github.com/hugoduncan/clojure-mojo-example/blob/master/src/mai...
>
> The annotation support isn't complete yet, but the simple example works.
>
> --
> Hugo Duncan

On a related note, I was wondering if anyone had taken a stab at
Clojure stub generation.  That is, on the "generate-sources" phase,
you generate .java files that stub out the classes you mean to create
in Clojure.  Javac comes along, sees the stubs, and can compile all
the classes together.

Then, once Javac has done its work, you run Clojure to replace the
stubbed .class files with the real thing.  Solves the "chicken-and-
egg" problem quite nicely.

The stubs would contain Javadoc, annotations, and generics
(eventually...), allowing Java frameworks to easily consume classes
compiled from Clojure.  That is, it would work with the compile-time
annotation processor from Java 5 and 6, and it would also work with
Maven plugins, since they use Javadoc (in Maven 2, at least) for
annotations.  I had imagined that Maven plugins would just sort of
fall out from having a good stub generator.

Has anyone talked about doing something like this???

This is how the Groovy cross-compiler works, and how GMaven (the
Groovy Maven plugin) performs cross compilation.  Of course, it should
be much easier to do with Clojure.  With Groovy you have to worry
about all the intricacies of  ANTLR, but parsing in Clojure is dead
simple.  Theoretically you should just have to look for the correct
function names and metadata and spit out Java source.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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