Fork me on GitHub
#tools-deps
<
2020-12-28
>
Eugen10:12:48

hi, I have a question regarding deps.edn and git dependencies. Can I build a deps.edn dependency locally? I have a project (clj-antlr) that has clojure code + java classes. Can I make a clj-antlr/deps.edn so I can use clj-antlr from another project: my-project/deps.edn ? from git ? My goal is depend on the git version to avoid publishing binary dependenices for clj-antrl. clj-antlr does have some java classes that need to be compiled in order for it to be used. Can I trigger a build step in clj-antlr/deps.edn when I use it in my-project/deps.edn ?

borkdude10:12:50

@eugen.stan For gitlibs, this only works if you check the compiled Java into source control

borkdude10:12:09

which is probably not so nice

borkdude10:12:22

for libs that need .class files, I usually make a release to clojars

borkdude10:12:05

For sci I have one component which needs this, so I have isolated it into its own mini-library. The rest of sci can be used as a git lib

✔️ 3
Eugen10:12:54

So there is no life-cycle hooks that I can use in deps.edn to trigger pre/post processing for dependencies .. thanks, in my case there are 3 classes so I will make a branch for that and once I am sure all things work I'll publish them.

borkdude10:12:56

well, you can also push the compilation phase to the user of the library, as part of the main opts, but so far I haven't seen anyone do this

borkdude10:12:19

it's not unreasonable since you can then treat Java as a source-based language as well

borkdude10:12:29

I'm hoping tools.build will go a bit into this direction

Eugen10:12:24

thanks, I also have some ideas on how to provide this capability. With any luck I will push something this week 🙂 .

vlaaad10:12:27

Afaik it's possible to compile and load Java code in the JVM process used for development, maybe tools-build will help with that :D

borkdude10:12:15

that's what I was suggesting

✔️ 3