tolitius / boot-check

check, analyze and inspect Clojure/Script code
Eclipse Public License 1.0
70 stars 9 forks source link

Remove need to have `boot.core` on classpath even in pods #2

Open martinklepsch opened 8 years ago

martinklepsch commented 8 years ago

In the demo project boot/core is specified as dependency but usually that should not be necessary.

All functions that are from boot.core should be called outside of pods and their return values can be passed into pods.

Currently if users don't explicitly depend on boot/core they run into the following exception:

ava.io.FileNotFoundException: Could not locate boot/core__init.class or boot/core.clj on classpath., compiling:
(tolitius/boot/helper.clj:1:1)
belucid commented 8 years ago

+1

tolitius commented 8 years ago

ah.. good point. just to confirm: boot-check should depend on boot/core, correct?

tolitius commented 8 years ago

pushed 0.1.2-SNAPSHOT including the boot/core dep

martinklepsch commented 8 years ago

@tolitius that will work but it's not the ideal solution I think. My suggestion would be call all functions you need from boot.core outside your pod and pass their results into the pod. This way you don't need the boot/core dependency. boot.core is already loaded when a deftask is ran.

tolitius commented 8 years ago

@martinklepsch, it's doable, would require quite a rewrite though.

can you share a couple of examples where users would use boot, but would not need / want a boot.core dependency?

martinklepsch commented 8 years ago

@tolitius adding boot/core to pods could affect dependency resolution inside pods which could cause all kinds of issues. Most of the times you run your code in pods which are isolated from the rest of boot. By adding the boot/core dependency this isolation removed. I think what I meant with "ideal" should have been "most hygienic". In practice either approach is likely to just work fine.