Fork me on GitHub
#depstar
<
2021-09-13
>
jmayaalv16:09:01

Hi! what’s the best way to use depstar to distribute a clojure lib that can be consumed in a maven project?

jmayaalv16:09:48

we can’t aot everything as it would compule all the dependencies as well, ideally we would like the dependencies to be downloaded by maven when the project is included in a java project

jmayaalv16:09:25

so basically something like a thin jar that contains clj and .class files 🙂

jmayaalv16:09:41

right now we are just using exclude 🙂

jmayaalv16:09:48

but it feels wrong

seancorfield16:09:22

@jmayaalv That's a tricky use case, precisely because AOT is transitive. If I was specifically targeting Java project usage, I would write a .java API that called into Clojure via Clojure's "Java API" and ship the Clojure as source in the JAR with just that one Java class compiled -- and it would depend on Clojure itself as a library.

jmayaalv17:09:19

yes, that’s what we are now considering

jmayaalv17:09:34

but i am to stubborn

seancorfield17:09:47

If you AOT the .clj code, even if you exclude "everything" that isn't your own code, you still end up tying the code to a specific version of Clojure itself, which may well bite you in the future.

👍 2