Fork me on GitHub
#leiningen
<
2018-02-12
>
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.

noisesmith01:02:32

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

noisesmith01:02:11

I haven't used lein-kotlin, but it apparently exists https://github.com/reutermj/lein-kotlin

noisesmith01:02:06

the small size of the code should give a hint about how easy it would be to compile other targets from clojure https://github.com/reutermj/lein-kotlin/blob/master/src/leiningen/kotlin.clj

Chad Morrow01:02:05

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

noisesmith01:02:17

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

noisesmith01:02:02

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

Chad Morrow01:02:39

Hm, interesting.

noisesmith01:02:18

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

aaron5106:02:43

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?

aaron5106:02:55

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

aaron5106:02:10

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) https://github.com/technomancy/leiningen/blob/stable/bin/lein#L351

noisesmith17:02:29

@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

danielcompton18:02:46

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

noisesmith18:02:11

@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

frenata23:02:31

Anyone have any experience running existing Java JUnit tests via lein? https://github.com/technomancy/leiningen/blob/master/doc/MIXED_PROJECTS.md 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.