tolitius / boot-check

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

Could not locate tolitius /boot/helper__init.class or tolitius/boot/helper.clj on classpath. #4

Closed crinklywrappr closed 7 years ago

crinklywrappr commented 8 years ago

New to boot. I wanted to define check-sources in profile.boot but am getting this error when running boot check-sources on this project: https://github.com/magomimmo/modern-cljs/blob/master/doc/second-edition/tutorial-01.md

I can browse to the file in the the local maven repo, and boot show -c shows it in the classpath.

profile.boot:

(set-env! :dependencies '[[boot-deps "0.1.6"]
                          [tolitius/boot-check "0.1.3"]])

(require '[boot.repl]
         '[tolitius.boot-check :as check]
         '[boot-deps :refer [ancient]])

(swap! boot.repl/*default-dependencies* conj
       '[refactor-nrepl "2.0.0-SNAPSHOT"]
       '[cider/cider-nrepl "0.10.0-SNAPSHOT"])

(swap! boot.repl/*default-middleware* conj
       'refactor-nrepl.middleware/wrap-refactor)

(deftask check-sources []
  (comp
   (check/with-yagni)
   (check/with-bikeshed)
   (check/with-kibit)
   (check/with-eastwood)))

build.boot (in my project)

(set-env!
 :source-paths #{"src/cljs"}
 :resource-paths #{"html"}
 :dependencies '[[adzerk/boot-cljs "1.7.170-3"]])

(require '[adzerk.boot-cljs :refer [cljs]])
crinklywrappr commented 8 years ago

Same error in the repl.

tolitius commented 8 years ago

check the demo boot-check project, you might need to add a boot-core as a "provided" dep as shown here.

there is an ask to remove boot-core dep which I agree with but it would have to be a pull request at this point.

let me know if it worked for you

crinklywrappr commented 8 years ago

I had to place both libraries as deps in build.boot. Placing them both in profile.boot didn't do any good.

tolitius commented 7 years ago

closing this. feel free to reopen if there are more questions

dancmeyers commented 6 years ago

This is probably because you have done the same as me, and your build.boot specifies dependencies as a quoted vector of vectors, i.e.

(set-env! :dependencies   '[[org.clojure/clojure "1.8.0"]
                            [com.taoensso/timbre  "4.7.4"]
...

so the set-env for dependencies in your profile.boot is thrown away/overwritten before the check-sources function is actually run. You can fix this by setting your dependencies using a conj/contact etc onto the existing dependencies list in build.boot, but that may come with it's own problems. I'm still trying to find an easier way.