Fork me on GitHub
#boot
<
2018-04-23
>
phreed22:04:06

@seancorfield What exactly prevents boot from being run as a library? It seems like something like clj -m boot.main

seancorfield22:04:47

@phreed see the exception above?

phreed22:04:43

@seancorfield Yes, I saw that but I did not understand what was going wrong.

seancorfield23:04:49

The Boot JAR depends on boot.App -- which is the launcher app part of Boot that is not part of the library, because Boot is designed to be launched via boot.App, not from anything else.

(! 1200)-> clj -Sdeps '{:deps {boot/core {:mvn/version "RELEASE"}}}'
Downloading: boot/core/maven-metadata.xml from 
Clojure 1.9.0
user=> (require 'boot.core)
ClassNotFoundException boot.App  java.net.URLClassLoader$1.run (URLClassLoader.java:372)
user=> 

seancorfield23:04:37

Several Boot namespaces have (:import [boot App]) or just refer directly to boot.App/config assuming it'll be on the classloader because that's how Boot runs, so you can't load those namespaces into a Clojure context that has been started from outside Boot (because boot.App isn't loaded).

seancorfield23:04:47

Does that help @phreed?

phreed23:04:10

I think I understand. I thought boot -b > src/boot/user.clj produced a file that with a little work could be evaluated via clj -m boot/user.clj but I guess that is not right. I suppose it could be made to work if provided with a properly constructed mock boot.App?

seancorfield23:04:52

Sounds like an unrealistic expectation to me...