0

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

yazz.com
  • 57,320
  • 66
  • 234
  • 385
  • 1
    Use 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
  • 1
    Or 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
  • 1
    Ok, 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 Answers1

1

There are at least 3 ways:

  1. lein hooks. See How can I add a build step to leiningen?

  2. lein aliases: You'll find some info with examples in https://github.com/technomancy/leiningen/blob/286bc3f034e322f91be2a59cc970da49badd08ac/sample.project.clj#L204

  3. Custom lein tasks, as in how to add a hook into the uberjar process (building with lein)

Community
  • 1
  • 1
nberger
  • 3,659
  • 17
  • 19