Fork me on GitHub
#tools-deps
<
2022-09-03
>
jasonjckn04:09:30

This questions probably been asked a hundred times, I did read through the chat history a bit, IF you have java sources as part of your Clojure project, is the recommended setup is to move them to a different folder and use :deps/prep-lib ? This still seems to leave a lot to be desired, like if I change a java source it won’t automatically recompile the affected classes, any other solutions here that behave like lein?

seancorfield05:09:26

prep-lib is intended to be a one-off step for libraries so that consumers can use them. It is not intended to be the normal way for you to compile Java code in a project you work on. Write a build.clj with a task that does the Java compilation -- see the tools.build documentation for guidance. HTH @U0J3J79FE

jasonjckn05:09:08

To get the java source files compiled before a cider-jack-in, is there a lein-like prep-tasks, or I should change the command cider uses to start the repl?

seancorfield05:09:10

You can then call that build.clj function from any other functions in build.clj that might need to leverage the compiled Java classes -- how exactly you do that, is up to you. At work, we have a prep... function in our build.clj that can be invoked manually as needed and is automatically called from a couple of other functions to ensure that the "compile" step always happens in our CI pipeline, for example.

👍 1