[Note, you can implement this solution by writing stub classes by hand. This means you write stubbed out Java classes, run Javac first, and allow Clojure to overwrite the stubbed class files when it compiles. This is easy to do in Maven, and not difficult in ANT. And I have not actually tried this yet, so it's possible that there are wrinkles that still need to be ironed out.]
For a general solution to this problem, which covers not only Javadoc but also the compile-time dependency "chicken-and-egg" problem, I believe we need two stages of compilation to be compatible with Javac. 1) Generate Java stubs from Clojure. 2) Generate class files from Clojure. These need to be separate steps, since (1) must be run before Javac and (2) must be run afterwards. Here is how it would work in the bigger scheme of things. a) gen-stubs generates stubbed Java files. These files are actual Java source, but the methods just throw NotImplementedException. (1) includes Javadoc from Clojure metadata (2) includes annotations (3) includes Types, including generic definitions b) Run Javac against Java classes and Clojure (Java) stubs. Everything compiles, and the annotation processor (Java 5 and 6) is happy as well. c) Run Clojure compile, which overwrites all the stubbed classes from step (b). d) (OPTIONAL) Run Javadoc against Java + Clojure stubs. This will produce complete, seamless Javadoc for consumption by Java users. By using two steps and stubs, the chicken-and-egg problem is solved. You don't get odd compile-time dependency problems. Even though there are two separate compilations happening, it works as if there is only one. I am hoping that someone else will implement this solution before I get around to needing it! :-) Note also that this would allow you to combine Java, Groovy (which already implements stubbed compilation), and Clojure all in the same build with circular dependencies between all three languages. On May 28, 3:36 pm, ka <sancha...@gmail.com> wrote: > I've also added a :class-doc key to the macro - > > (gen-class+javadoc > :class-doc "Class Docs > <ul> <li> One </li> <li> Two </li> </ul> > " > :name "a.b.c.MyCoolClass" > :methods [ > #^{:static true} [method1 > [clojure.lang.PersistentArrayMap] int] > #^{:static true} [method2 [int int float] > clojure.lang.LazySeq] > #^{:static true} [method3 [] Object] > ]) > > Thanks -- 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