- Created Thursday, February 5th 2015 @ 06:59:28
I'm working on a starter bot for Clojure . What I'm noticing is that I can't test it by uploading it. This is because my strategy is to AOT compile the Clojure code and then include the contents of the Clojure runtime jar. The zip file then ends up as 3.8Mb which results in "No file chosen or file too large" error.
Can I help at all with the server-side support (i.e. is there an public git repository for the integration code available)? Or would you rather see me have a fully-functional starter bot in Clojure before you put any effort into Clojure support?
The simplest thing I can imagine would be to detect the presence of .clj files and then generate a plain vanilla Leiningen build file and use the
lein uberjartarget to build a distribution jar with all of the dependencies (i.e. clojure). I imagine that would integrate well with any existing Java glue code you have.
Hmm. Alternatively you could require the zip file to contain AOT compiled clj class files, detect the presence of clojure-like class files (e.g.
classname__init.class), and add the clojure jar as a Java runtime dependency. That's less robust but maybe easier still.
Anyway. I'm keen to see Clojure support. What's the best thing for me to do next?
DeveloperCreated Thursday, February 5th 2015 @ 07:32:42
Although I'm not aware of the specifics, I do know Clojure is already being supported.
DeveloperCreated Thursday, February 5th 2015 @ 08:55:44
Currently the second thing you suggested is implemented. The compiler gets all the .clj files and the main one that contains 'defn -main'. Then it runs with Java and the Clojure 1.6 jar.
- Created Thursday, February 5th 2015 @ 15:49:42
@nikooO_o, @jim Fantastic! I have a
defn -mainin one file. It fails to reference other namespace though:
Exception in thread "main" java.io.FileNotFoundException: Could not locate handlers__init.class or handlers.clj on classpath: , compiling:(/src/bot.clj:1:1)
(ns bot (:require handlers))
Is this designed to work for multiple clj files?
- Created Thursday, February 5th 2015 @ 15:55:07
I was able to keep the namespace structure if I put all the code in a single clj file. It works! Thanks for you help getting setup.
(ns bot) ..... (ns handlers) .....