The Java stubs are, ideally, a temporary thing. They don't need to be around forever. However, I know of no way at present to generate them automatically.
Also, you are solving half the problem. Generating the stubs and class files at the same time does not solve the compile-time dependency problem. Consider: Clojure A references Java class B references Clojure class C references Java class D. A, B, C, D are in a single project. You *must* run either gen-class or Javac first. Without some kind of stubbing, the compile-time references are unknown, either way. Either Java does not know about the Clojure gen-class classes that are to come, or Clojure does not yet know about the Java classes in the project. So, treating Java as the least-common-denominator, you run: * gen-stubs * Javac * gen-class Since the stubs are around, you can also run JavaDoc. The stubs don't need to be saved. In the Maven world, they are part of the build, not source files. On Jun 4, 8:03 am, ka <sancha...@gmail.com> wrote: > @Jason > > I'm supplying a Java API (implemented in Clojure) so needed a solution > quickly which just worked w/o me having to do special things. > > Hence the gen-class+javadoc macro (http://gist.github.com/415269). > But I feel there should be something like this available in contrib > which handles the whole jing-bang of gen-class ! > > Currently I'm using the strategy of generating .class files from gen- > class, then generating java-stubs as required, running javadoc and > just deleting the java-stubs (as they provide no value in their own). > > Why do you think keeping the java-stubs is necessary? > > - 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