Hi Howard, Thanks for sharing that.
One point though : I have a mitigate feeling with compiling all namespaces from the same JVM/Clojure environment. I understand that it makes the compilation go fast since ant does not need to relaunch the Compiler in a new jvm for each namespace, but I can see problems not detected by this, that could be detected if each namespace is compiled separately: * if namespace A fails to include the appropriate :require directive for namespace B, but B is compiled before A, then A will compile OK because B has been loaded as a side effect of being compiled (this being a good or bad thing is another problem, for the current problem, let's just it be a fact). But if in your app A is loaded/required before B, clabamgo! you have a problem. This kind of problem generally always appears late in the process (generally in pre-production environments or -hopefully- via continuous integration if it includes integration tests). * As I understand the way your script works (and I don't think it could do a better job due to the current naming convention that doesn't help distinguish files creating namespaces from files that are just scripts or pieces of namespaces), even files that are just pieces of namespaces (which I presume should contain some (in-ns) directive at their top) are passed to the compiler. For those file that will appear in the list before the file containing the namespace definition, it will result in a fail of the compilation, but they will be compiled again later, when the real file containing the namespace definition is compiled. BUT again, this could result in compilation of "dead code not yet removed from the code base for some reason", and subtle problems in integration. To be more concrete: namespace N is made of file N.clj, which includes the (ns) directive, loading files N1.clj and N2.clj as pieces of namespace N. But an old file N3.clj is still there, and (Moore's law) N3.clj redefines some functions in N2.clj. In your development box : no problem, you always load namespace N from N.clj, and N3.clj has been correctly removed from the (ns) directive. But then you compile the project for distribution .... and N3.clj is compiled after N2.clj and redefines some functions of N2.clj .... whoops ! Regards, -- Laurent 2009/7/21 Howard Lewis Ship <hls...@gmail.com> > > I've written an Ant build script snippet that locates .clj files and > compiles them. Not tested on Windows. > > http://gist.github.com/151387 > > > -- > Howard M. Lewis Ship > > Creator of Apache Tapestry > Director of Open Source Technology at Formos > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---