tools-build

Drew Verlee 2025-05-30T22:28:36.930029Z

moving my <http://;;%20=>%20"select%20*;\n"|question from tools-de>ps here. So i built a jar with a deps that had a src/clj and src/sql in the deps :paths and when i looked in the jar it didn't have the files in src/sql. So my current understanding is that adding src/sql. Also if i look for the file in the clojure code, when run as a ran, it couldnt' find it. if i add the src/sql to my clojure.tools.build.api/copy-dir as a source pointing at a target that will be used as part of the jar, then i see it, and the running will find it. So the conclusion here, based on what i think im seeing, is that :paths doesn't move non clj files into the jar for you. Finally, if i remove the src/sql from the :paths, but keep as a source in clojure.tools.build.api/copy-dir , the jar will find the file just fine. Thanks for listening to this rant. 💃

2025-05-30T22:35:36.851619Z

oh, you aren't copying your paths into the jar, but are just relying on the aot'ed clojure code in there

2025-05-30T22:37:03.411559Z

I forget that tools.build doesn't copy that all in by default, and assume if it works it must all be there, but if you leave out the copying and are aot compiling, it may still work without actually copying anything

seancorfield 2025-05-30T22:42:03.909379Z

:paths is about the classpath -- for running your code directly. Think deps.edn. What goes in the JAR is up to you -- which is why you need to explicitly put src/sql in the copy-dir call. Think build.clj. They're somewhat unrelated (except for stuff like compile relying on the classpath to find sources).

Drew Verlee 2025-05-30T23:15:30.133989Z

thanks @hiredman and @seancorfield if your interested, i made a little readme story to help me remember part of this: https://github.com/drewverlee/deps-example