Re: leiningen javac plugin

65 views
Skip to first unread message
Message has been deleted

liebke

unread,
Dec 9, 2009, 6:06:16 PM12/9/09
to Clojure
This is exactly what I need!

Unfortunately, I'm getting the following exception when I run the
compile-java task.

$ lein compile-java
Exception in thread "main" java.lang.IllegalArgumentException: No
method in multimethod 'as-file' for dispatch value: null
at clojure.lang.MultiFn.getFn(MultiFn.java:115)
at clojure.lang.MultiFn.invoke(MultiFn.java:157)
at clojure.contrib.java_utils$file__565.invoke(java_utils.clj:86)
at leiningen.compile$find_lib_jars__1085.invoke(compile.clj:29)
at leiningen.compile_java$lib_path__543.invoke(compile_java.clj:15)
at leiningen.compile_java$compile_java__546.invoke(compile_java.clj:
21)
at clojure.lang.Var.invoke(Var.java:359)
at clojure.lang.AFn.applyToHelper(AFn.java:173)
at clojure.lang.Var.applyTo(Var.java:476)
at clojure.core$apply__4379.invoke(core.clj:436)
at leiningen.core$_main__4685.doInvoke(core.clj:38)
at clojure.lang.RestFn.invoke(RestFn.java:415)
at clojure.lang.AFn.applyToHelper(AFn.java:173)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at leiningen.core.main(Unknown Source)


Poking around a bit, it looks like it might have something to do with
the :library-path value that is passed to Leiningen being null.

David



On Dec 9, 2:53 am, antoniogarrote <listasantoniogarr...@gmail.com>
wrote:
> A quick and dirty hack to compile java files in clojure projects using
> leiningen.
>
> The clojar is athttp://clojars.org/, the source code at:http://github.com/antoniogarrote/lein-javac
>
> Just run $lein compile-java to transforms 'src/**.java' into 'classes/
> **.class'
>
> I hope someone find it useful.
>
> Cheers!
Message has been deleted
Message has been deleted
Message has been deleted

Mark Derricutt

unread,
Dec 31, 2009, 3:15:06 AM12/31/09
to clo...@googlegroups.com
I normally bind the clojure-maven-plugin to the compile phase, so "mvn
compile" does both a java and clojure compile. However, unlike the
scala or groovy 'star compilers' its not one process/parse, the java
compiler runs first, then the clojure.


--
Pull me down under...

On Thu, Dec 31, 2009 at 12:10 PM, Saul <sha...@gmail.com> wrote:
> I can imagine the maven way of doing things is a pain for plugin
> developers. However, I have recently moved from the scala maven plugin
> (which compiles java source automatically) to the clojure maven plugin
>

Phil Hagelberg

unread,
Jan 2, 2010, 1:23:00 AM1/2/10
to clo...@googlegroups.com
Saul <sha...@gmail.com> writes:

> Many thanks. This works for me and I find it useful. However, in a
> perfect world:
>
> lein compile
>
> would also compile my java source code or call compile-java before
> performing a compile. In fact in this perfect world:
>
> lein swank
>
> would download all dependencies, compile java files and then start a
> swank server. Is there anyway to get leiningen plugins to depend on
> each other or has this behaviour been omitted by design?

I am not opposed to setting up a hooks system that would define a number
of built-in hooks for which plugins could add functions, much like the
way Emacs does it.

I haven't needed it myself, but if you would find it useful and care
enough to take the time to implement it, I welcome a discussion of the
feature.

-Phil

Reply all
Reply to author
Forward
0 new messages