       (add-user-resource (first (user-resource-dirs)))))
 
 (defn reset-build!
-  "FIXME: document"
+  "Resets mutable build state to default values. This includes such things as
+  warning counters etc., state that is relevant to a single build cycle. This
+  function should be called before each build iteration."
   []
   (reset! *warnings* 0))
 
-(defn construct-tasks
+(defn- construct-tasks
   "FIXME: document"
   [& argv]
   (loop [ret [] [op-str & args] argv]

                 (sync-user-dirs!))]
    (binding [*warnings* (atom 0)]
      (reset-build!)
      ((task-stack #(do (sync! %) %)) (commit! (reset-fileset nil))))))

(defmacro boot
  "Builds the project as if `argv` was given on the command line."

  (sync-user-dirs!))

(defn- do-cleanup!
  "Cleanup handler. This is run after the build process is complete. Tasks can
  register cleanup callbacks via the cleanup macro below."
  []
  (doseq [f @cleanup-fns] (util/guard (f)))
  (reset! cleanup-fns []))

(defn- printable-readable?
  "If the form can be round-tripped through pr-str -> read-string -> pr-str
  then form is returned, otherwise nil."
  [form]
  (or (nil? form)
      (false? form)
      (try (read-string (pr-str form)) (catch Throwable _))))

(defn- rm-clojure-dep
  "Remove the org.clojure/clojure dependency (if one exists) from a Maven
  dependencies vector."
  [deps]
  (vec (remove (comp (partial = 'org.clojure/clojure) first) deps)))

