Fork me on GitHub
#boot
<
2018-09-20
>
dvorme01:09:50

Hi: I'm looking for a good example Boot project where Clojure namespaces depend on Java classes. Any suggestions? Or blog articles on the topic might work too. 🙂 . Thanks in advance.

seancorfield02:09:36

@dvorme Not sure what you're asking there... can you elaborate?

dvorme02:09:18

OK, more specifically:

dvorme02:09:59

I'm working on a project loader built around Boot and Git.

dvorme02:09:04

Current code reads a configuration file for the git coordinates of the bootstrap plugin, which points to a Clojure project built using Boot.

dvorme02:09:36

It clones the project. Then I want to delegate to Boot to load the project.

dvorme02:09:00

I've tried various approaches to this but wind up with classloader trouble, race conditions between core/worker pod startup and the code that launches Boot. It appears that the most reliable approach is likely to be to launch Boot the way it launches itself: via the Boot.java class.

dvorme02:09:21

But the Boot launcher project isn't distributed on Clojars (or similar) as a Jar, so I thought I'd just fork the sources (there are only two classes) into my own repo, and just include that code natively in my build.

dvorme02:09:29

However, adding (javac) (target) to the front end of my build pipeline isn't successfully making Boot.java's class available on the Clojure classpath--unless I've done something stupidly wrong, which is possible. 😉

dvorme02:09:31

I was hoping for an example project where someone has a mixed Java/Clojure build working using Boot so I could compare and see where I might have gone wrong.

dvorme02:09:42

Or suggestions. 🙂

dvorme02:09:10

LOL; found it. Boot.java as delivered from https://github.com/boot-clj/boot-bin/blob/master/src/Boot.java doesn't include a 'package' line.

seancorfield02:09:00

@dvorme I'm having a hard time understanding what Boot.java has to do with what you're trying to do... it really sounds like you're over-complicating things.

seancorfield02:09:21

Boot itself can run git, compile Java code, and then run your Clojure code. Not sure why you think you need to somehow "launch Boot" in the middle of that pipeline...?