tools-build

jrychter 2025-04-27T01:43:40.193109Z

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?

jrychter 2025-04-29T01:43:08.222019Z

Hmm. Thanks. I think in the end I'll stick to my previous approach.

Alex Miller (Clojure team) 2025-04-27T12:30:04.803329Z

You could set a system property or env var

jrychter 2025-04-27T01:58:30.543779Z

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.

Alex Miller (Clojure team) 2025-04-27T12:32:22.528279Z

Isn’t the error you’re seeing the detection? I don’t understand the question

jrychter 2025-04-28T03:40:56.733689Z

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.