Fork me on GitHub
#leiningen
<
2021-02-22
>
cgore15:02:40

Although the more that I look at my specific problem, I'm not sure I really even want to do this, it's being used to generate some classes magically at compile time, instead I probably want to do the same but whenever just from the repl.

mikerod16:02:10

@cgore you can do things like generate classfiles prior to other lein things - typically via :prep-tasks

mikerod16:02:29

still though, you’d be using something external - like perhaps maven if that’s the plugin in question - ideally you’d have something not coupled directly with maven

mikerod16:02:06

for example - often used example is protobuf - and you can see that here https://github.com/technomancy/leiningen/blob/2.9.5/sample.project.clj#L263-L266

gklijs05:02:55

To prevent using maven, you can probably just use the Java dependency the plugin uses, and use that with interop. That's what I did to generate Avro classes, https://github.com/gklijs/bob2021/blob/308316f525391ae2a0f8865e2958aef2c54692f9/topology/env/dev/clj/nl/openweb/dev/avro_compile.clj#L55.

👍 3
mikerod16:02:33

so these steps would run before your lein task and you could get generated classfiles onto your classpath ahead of time etc.

quoll16:02:03

Hi. I’m wondering if there is a typical way that projects build modules. I’ve seen lein-modules and it seems reasonable, but there’s a problem I’m working through on it, and it occurred to me that maybe there was something else that people tend to use instead. e.g. leiningen-core is a project inside the leiningen project, and leiningen refers to it via :dependencies, :source-paths and in the :dev profile it’s added to :resource-paths