 
 ;; Tasks
 
-(deftask testing
-  "Adds the test files to the fileset."
-  []
-  (merge-env! :resource-paths #{"src/test/cljc"
-                                "src/test/cljs"
-                                "src/test/resources"})
-  identity)
-
-(deftask benchmarking
-  "Adds the benchmark files to the fileset."
-  []
-  (merge-env! :resource-paths #{"src/benchmark/cljc"
-                                "src/benchmark/java"
-                                "src/benchmark/resources"}
-              :dependencies   '[[com.cognitect/transit-clj         "0.8.300"]
-                                [com.cognitect/transit-cljs        "0.8.239"]
-                                [com.damballa/abracad              "0.4.14-alpha2"]
-                                [gloss                             "0.2.6"]
-                                [cheshire                          "5.7.1"]
-                                [funcool/octet                     "1.0.1"]
-                                [com.google.protobuf/protobuf-java "3.3.1"]
-                                [com.taoensso/nippy                "2.14.0-alpha1"]
-                                [criterium                         "0.4.4"]])
-  identity)
-
 (deftask dev
   "Dev task for proto-repl."
   []
-  (merge-env! :init-ns        'user
-              :resource-paths #{"src/dev/clj"}
-              :dependencies   '[[org.clojure/tools.namespace "0.2.11"]
-                                [proto-repl                  "0.3.1" :exclusions [org.clojure/core.async]]])
   (require 'clojure.tools.namespace.repl)
   (apply (resolve 'clojure.tools.namespace.repl/set-refresh-dirs) (get-env :directories))
-  (comp (testing)
-        (benchmarking)
+  (comp (boot-tools-deps/deps :aliases [:test :benchmark :dev] :quick-merge true)
         (javac)))
 
 (deftask test-clj
   "Runs the tests on JVM."
   []
-  (comp (testing)
+  (comp (boot-tools-deps/deps :aliases [:test] :quick-merge true)
         (boot-test/test :namespaces clj-test-namespaces)))
 
 (deftask test-node

   e js-env VAL kw "The js environment."]
  (let [opt    (or opt :none)
        js-env (or js-env :slimer)]
    (comp (testing)
          (boot-cljs-test/test-cljs :js-env        js-env
                                    :namespaces    cljs-test-namespaces
                                    :optimizations opt

   t target       VAL kw   "The target for the cljs compiler."
   o opt          VAL kw   "The optimization level for the cljs compiler."
   s self-hosted?     bool "True if self-hosted."]
  (let [platform (or platform :clj)]
    (comp (with-pass-thru _
            (println "Testing" platform target opt self-hosted?))
          (case platform
            :clj  (test-clj)
            :cljs (case (or target :browser)
                    :browser (test-browser :opt    opt
                                           :js-env :slimer)
                    :nodejs  (test-node :opt          opt
                                        :self-hosted? self-hosted?))))))

(deftask test-all
  "Runs all test."
  []
  (comp (test :platform     :clj)
        (test :platform     :cljs
              :target       :browser)
        (test :platform     :cljs
              :target       :browser
              :opt          :advanced)
        (test :platform     :cljs
              :target       :nodejs)
        ;; TODO externs for node.js?
        #_(test :platform     :cljs
                :target       :nodejs
                :opt          :advanced)
        (test :platform     :cljs
              :target       :nodejs
              :self-hosted? true)))
