This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-03
Channels
- # babashka (12)
- # beginners (15)
- # biff (2)
- # calva (17)
- # clj-kondo (19)
- # clj-on-windows (3)
- # clj-otel (1)
- # clojure (3)
- # clojure-europe (5)
- # conjure (2)
- # graalvm (2)
- # helix (5)
- # introduce-yourself (1)
- # nbb (24)
- # off-topic (32)
- # polylith (3)
- # reitit (21)
- # releases (1)
- # reveal (3)
- # scittle (1)
- # squint (56)
- # tools-deps (4)
- # xtdb (6)
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?
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
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?
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.