How can I call a Clojure function when a Leiningen build has completed? I want to do this as I populate a list during compilation and I want to save the list to disk when the compilation has finished
Asked
Active
Viewed 416 times
0
-
1Use a lein hook. See http://stackoverflow.com/questions/18199188/how-can-i-add-a-build-step-to-leiningen – nberger Aug 18 '15 at 13:28
-
1Or if it fits your use case, use lein aliases, or even a custom lein task as in http://stackoverflow.com/questions/10644087/how-to-add-a-hook-into-the-uberjar-process-building-with-lein – nberger Aug 18 '15 at 13:30
-
1Ok, thanks. Make that an offical answer and I will choose it as the official answer. Thanks! :) – yazz.com Aug 19 '15 at 08:33
1 Answers
1
There are at least 3 ways:
lein hooks. See How can I add a build step to leiningen?
lein aliases: You'll find some info with examples in https://github.com/technomancy/leiningen/blob/286bc3f034e322f91be2a59cc970da49badd08ac/sample.project.clj#L204
Custom lein tasks, as in how to add a hook into the uberjar process (building with lein)