Fork me on GitHub

@deactivateduser10790 re lein-ancient and others like it. Stuart Halloway tweeted a year ago or so about the importance of making your plugin a lib, which then could be made a plugin.

👍 4

This is good advice for anything - not just Leiningen plugins!


So for lein-ancient, it would be nice if it were a lib that could take a set of deps and figure out which were ancient, and then provide a shim for the build tools as needed.


I see you’ve filed an issue :)


which, as I’m now aware of, is exactly what does


although deps-ancient leverages code from ancient-clj, whereas it seems as if depot reimplements it. YMMV, as they say.


Hey does any body know how to make a variable in your project.clj and reference it throughout the project definition and then later in other namespaces throughout the project? I am using a variable to track CSS version for cache busting and would like to use it in multiple places. Thanks


Pretty sure it's possible, but I don't really know the macro-fu to make it happen. If there is a doc that explains it I can try to figure it out again.

Mario C.20:11:34

@leblowl Something like closure-defines?


@mario.cordova.862 I am not familiar with that fn. I searched it and found Environ I am familiar with. I don't mind the variable being an environment variable using environ or cprop, but how can I reference it in my project.clj? I just want to define the string (e.g. "1.1.4") once and reference throughout the project, including in the project.clj.


In boot that would be easy, but not sure how to project.clj


Apparently I can just define it before the defproject and access it using some macro squiggly. I will try that


Ok that stack overflow advice works. Something like this:

(def yo "123")
(defproject blah "blah" 
    :some-css-lein-key {:output ~(str "more blah" yo ".css")}) 


But, now how to make yo available to other namespaces? That one I am not sure


maybe add to cprop or environ map inside project.clj again


so it merges with other settings on app start


For cprop not entirely sure yet...


Same functionality for environ seems to work for cprop. In your profiles section:

:profiles/dev {:env {:hello? "true"}}
... Not sure exactly where in the code cprop does that, or if it's a Leiningen specific function. Anyways problem solved.


many ways to do it


I don’t know what cprop is, but it seems you have it figured out some way or another


you could make it so that things get put in the jar that can be read in “production” time, but also sys properties are set when lein is running things


and get access to either, that is how the versioneer is working


I think environ just writes a file off of the lein project to be used at runtime


@mikerod Thanks. Yea I figured out a way using tolitius/cprop very similar to environ I think. Just a general purpose config/env library. versioneer looks interesting.