Fork me on GitHub
#leiningen
<
2018-11-01
>
slipset09:11:50

@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
deactivateduser17:11:52

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

slipset09:11:46

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.

slipset09:11:49

I see you’ve filed an issue :)

slipset15:11:38

which, as I’m now aware of, is exactly what https://github.com/Olical/depot does

slipset15:11:30

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

leblowl19:11:47

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

leblowl19:11:31

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?

leblowl20:11:51

@mario.cordova.862 I am not familiar with that fn. I searched it and found https://shadow-cljs.github.io/docs/UsersGuide.html. 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.

leblowl20:11:10

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

leblowl21:11:18

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

leblowl21:11:52

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")}) 

leblowl21:11:19

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

leblowl21:11:52

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

leblowl21:11:02

so it merges with other settings on app start

leblowl21:11:24

For cprop not entirely sure yet...

leblowl21:11:15

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.

mikerod21:11:46

many ways to do it

mikerod21:11:09

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

mikerod21:11:32

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

mikerod21:11:41

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

mikerod21:11:45

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

leblowl21:11:37

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