     [boot.util                   :as util]
     [boot.from.clojure.tools.cli :as cli])
   (:import
-   [java.net URLClassLoader URL]
-   java.lang.management.ManagementFactory
-   [java.util.concurrent LinkedBlockingQueue TimeUnit]))
+    [java.io File]
+    [java.net URLClassLoader URL]
+    [java.lang.management ManagementFactory]
+    [java.util.concurrent LinkedBlockingQueue TimeUnit]))
 
 (declare watch-dirs sync! on-env! get-env set-env! tmpfile tmpdir ls)
 

             (get-add-dir fileset)))))

(defn cp
  [fileset src-file dest-tmpfile]
  (->> (tmpdir dest-tmpfile)
       (non-user-dir-for fileset)
       (assoc dest-tmpfile :dir)
       (tmpd/cp fileset src-file)))

(defn add-asset
  [fileset dir]
  (tmpd/add fileset (get-add-dir fileset #{:asset}) dir))

(defn add-source
  [fileset dir]
  (tmpd/add fileset (get-add-dir fileset #{:source}) dir))

(defn add-resource
  [fileset dir] (tmpd/add fileset (get-add-dir fileset #{:resource}) dir))

;; Tempdir helpers


   new))

(defn- order-set-env-keys
  "Ensures that :dependencies are processed last, because changes to other
  keys affect dependency resolution."
  [kvs]
  (let [dk :dependencies]
    (->> kvs (sort-by first #(cond (= %1 dk) 1 (= %2 dk) -1 :else 0)))))

(defn- parse-task-opts
  "Given and argv and a tools.cli type argspec spec, returns a vector of the
  parsed option map and a list of remaining non-option arguments. This is how
  tasks in a pipeline created on the cli are separated into individual tasks
  and task options."
  [argv spec]
  (loop [opts [] [car & cdr :as argv] argv]
    (if-not car
