Fork me on GitHub
Chad Morrow01:02:47

Hey so I have only recently discovered clojure but already have a dumb question maybe someone here could answer. I read that clojure makes for good "glue" code and someone I was talking to about this said that he thought Leinengen could be used to compile other jvm-lang projects and might be able to replace gradle as a build tool for things like Kotlin and what not. Is that a real possibility or just ill-informed nonsense? I figured tooling may be a practical place to start getting to know clojure but i'm still green enough that I can't tell if this is as dumb a question as I suspect it is.


leiningen is a dependency manager, it already knows how to compile and package clojure and java, if you like clojure better than groovy it might make sense to try managing a complex build in leiningen


I haven't used lein-kotlin, but it apparently exists


the small size of the code should give a hint about how easy it would be to compile other targets from clojure

Chad Morrow01:02:05

Whoa, that is much less code than I imagined there being


one change that might be called for in that project is having a dedicated dependency vector for kotlin - in case kotlin should see deps other code doesn't or other code should see deps kotlin doesn't - but perhaps there's no need


or a more general thing would be to respect the :kotlin profile if present(?)

Chad Morrow01:02:39

Hm, interesting.


also, there's an alternative build and dependency tool for clojure, boot, which is more oriented to builds as code (where leiningen is essentially a data based declarative dsl) - you might want to take a moment to compare before committing to doing tooling in a specific way


I’d like to use runit to run lein. runit needs to know the real PID of the process, but /usr/local/bin/lein creates a child process (rather than exec), so signals sent to the /usr/local/bin/lein PID don’t get passed to my code. How might I get around this?


So far the only fix is to add exec in front of "$LEIN_JAVA_CMD"… but I’d rather not patch lein


OK, my workaround for now is to skip the /usr/local/bin/lein script and run the java command from line 351 directly (with -Dleiningen.original.pwd etc)


@aaron51 that’s very interesting, I’d bet you’d get good feedback on that on the freenode #leiningen channel where the devs hang out


@aaron51 you can use lein trampoline run to get lein to run a single process


@aaron51 also there are some gotchas to using lein in production, and quite a few advantages to running an uberjar (created with lein) via java


Anyone have any experience running existing Java JUnit tests via lein? was helpful in incorporating java sources into my project.clj but the one plugin I've found that seems to address this issue doesn't seem to work and is quite old.