I'm migrating an old (and large) leiningen project to deps.edn and build.cli. What would be a good way of passing a variable (version tag) from my build.clj to a macro in the code that is being compiled? I used to generate a resources/version.edn file and then slurp it in the macro, but there is surely a better way?
Hmm. Thanks. I think in the end I'll stick to my previous approach.
You could set a system property or env var
that's what i do: https://github.com/NoahTheDuke/splint/blob/main/resources/SPLINT_VERSION and https://github.com/NoahTheDuke/splint/blob/main/build.clj
Also, FYI, I've been getting a weird error about a LICENSE file being a directory, and after some kagi'ing around found https://ask.clojure.org/index.php/10854/getting-an-error-with-tools-build-uberjar and https://clojure.atlassian.net/browse/TBUILD-11 — this was indeed the problem and adding :exclude ["LICENSE"] to my uber call makes the problem go away. TBUILD-11 comment would indicate that this would be somehow detected, but it wasn't.
Isn’t the error you’re seeing the detection? I don’t understand the question
The way I understood TBUILD-11 was that there would be a more specific error message than a FileNotFoundException with "Not a directory". That's all I got, which is why I thought it isn't being detected.