Fork me on GitHub
#leiningen
<
2018-10-09
>
mbjarland17:10:54

i have a command line app written in clojure and built using lein. I would like to include the git revision of the git repository the tool was built from in the command line help page (something I’ve done in other languages in the past and I find it very helpful) for the tool. I.e. I would like to have programmatic access to the git revision in my project code. Essentially this is the build-time domain reaching into the project code…in my past life I would have done this via a generated class. I did a quick search and none of the leiningen plugins I found seem to do this, any thoughts?

andy.fingerhut18:10:03

Your question reminds me of this project which I came across recently, but do not know the internals enough to recommend for or against it: https://github.com/jgrocho/lein-ver

andy.fingerhut18:10:45

It is targeted at using semantic version numbers, not git revisions, but perhaps it can be tweaked, or at least learned from