Fork me on GitHub
#tools-deps
<
2020-03-12
>
danielcompton16:03:28

I'm wanting to write a small Java file and use it in my Clojure app using deps.edn and clj . Is there anything similar to :java-source-paths or another way I can accomplish the same goal? My other option is to write this and create a JAR for it and deploy it somewhere or keep it as a local resource

dominicm16:03:41

No equivalent. No compilation done by tdeps.

dominicm16:03:18

You can use javac and have it output to target, and run that shell script before starting clj

danielcompton16:03:35

Might be easier to rewrite the algorithm to Clojure 🙂

Alex Miller (Clojure team)16:03:02

there are some tools.deps add-ons that can compile as well, like badigeon

mike_ananev16:03:20

it's a wrapper for badigeon

borkdude16:03:01

maybe a silly question, but why does badigeon need a wrapper? it's already a tool?

mike_ananev16:03:20

@borkdude no, badigeon is not a ready tool. it is low level api for managing project distributed as sources, which need to be adapted.

borkdude16:03:29

ah ok, I see now

dominicm17:03:27

Javac is pretty good though

👍 4
Alex Miller (Clojure team)20:03:39

@dominicm if you are suggesting that libraries should maintain a directory full of compiled classes, I think that is a bad idea and you should not do that

Alex Miller (Clojure team)20:03:26

if you want to distribute compiled artifacts, you can already do that by putting them in a jar. we don't typically do that in Clojure because the source is so much more flexible.

dominicm20:03:29

I'm not. I'm saying all of the infrastructure around this, code laying around to do the compilation on startup.

imre20:03:59

@alexmiller if you call (compile 'foo) twice, will the second be almost a no-op as it sees it's already compiled?

Alex Miller (Clojure team)20:03:26

you can try it in that project I posted if you like