Fork me on GitHub

Can anyone point me to any examples of boot tasks being tested end-to-end? I’d like to run (boot (my-task)) inside one of my tests and then check for side effects, but that understandably fails when running tests triggered by a boot test task.


@lsnape there are examples in boot itself using boot.test give a couple of mins I can fetch one for you


I am considering writing dynamic versions of import and require based on . The idea is to be able to pass the name of the class/method in variables; something like (import-dyn (class-name :as foo)) and static methods as (foo / method-name 5 4 3) or instance methods as (let [x (foo . 5)] (x . method-name 4 3)) where class-name and method-name are strings [require-dyn would be similar]. Has anyone already done something like this?


@phreed seems like a better one for #clojure


@dominicm possibly more appropriate for #clojure but it came up while I was writing a boot task so I went with context rather than content. Specifically, it ties into writing general tasks for a code generator (antlr4) where the names of the class and methods are not known until the grammar is defined. If there are no takers here I will cross post. - - - - etc. It would be nice if the tasks in projects like these include post-tasks that would make live coding more accessible. Here is a sample


Is there a section in the docs that describe how scopes work in boot? Or is it implied from something else?


Think I might have figured it out. It just passes through to maven right? Docs here?


I've been playing around with clojure 1.9 and it's tools.deps to see how it might worth with boot. I came up with this function

(defn maven-deps
   (maven-deps "deps.edn" [:deps] "compile"))
  ([deps-edn path scope]
   (let [deps (-> (slurp deps-edn)
     (->> (get-in deps path)
          (map (fn [[k v]]
                 [k (:mvn/version v) :scope scope]))
          (into [])))))
which I can then use in my set-env! like this
 :resource-paths #{"src" "test"}
 :dependencies (concat (maven-deps)
                       (maven-deps "deps.edn" [:aliases :test :extra-deps]
I think that lets me specify my deps in deps.edn (for the benefit of the standard clj/clojure scripts in clojure 1.9, and still use boot for build/test etc. However I'm new to boot so there might be something I'm missing.