              fileset
              (do
                ;; step 0: read the edn files
-               (let [filters-edn-files (->> (boot/fileset-diff @prev-pre fileset)
-                            boot/input-files
-                            (boot/by-name [filters-edn]))]
+               (let [filters-edn-files (->> (boot/input-files fileset)
+                                            (boot/by-name [filters-edn]))]
                  (if (> (count filters-edn-files) 1)
                    (throw (Exception. "only one filters.edn file allowed")))
                  (if (= (count filters-edn-files) 0)

          (builtin/sift :move {#"(.*\.clj$)" (str mod "/" classes-dir "/$1")})
          (builtin/target :no-clean true))))

(boot/deftask dev
  "make a dev build - including reloader"
  [k keep bool "keep intermediate .clj and .edn files"
   v verbose bool "verbose"]
  (let [keep (or keep false)
        verbose (or verbose false)
        mod (str (-> (boot/get-env) :gae :module))]
    (comp (install-sdk)
          (libs :verbose verbose)
          (logging :verbose verbose)

          (builtin/sift :move {#"(.*\.class$)" (str classes-dir "/$1")})
          (builtin/target :dir #{(str "target/" mod)})
          )))

(boot/deftask build
  "dev build, source only"
  [k keep bool "keep intermediate .clj and .edn files"
   v verbose bool "verbose"]
  (let [keep (or keep false)
        verbose (or verbose false)
        mod (str (-> (boot/get-env) :gae :module))]
    (println "MODULE: " mod)
    (comp ;; (install-sdk)
          (logging :verbose verbose)
          (appstats :verbose verbose)
          (builtin/javac)
          (reloader :keep keep :verbose verbose)
          (filters :keep keep :verbose verbose)
          (servlets :keep keep :verbose verbose)
          (webxml :verbose verbose)
          (appengine :verbose verbose)
          (builtin/sift :move {#"(.*clj$)" (str classes-dir "/$1")})
          (builtin/sift :move {#"(.*\.class$)" (str classes-dir "/$1")})
          ;; FIXME: use cache instead?
          ;; (builtin/target :dir #{(str "target/" mod)})
          )))

(boot/deftask make
  "dev build, source only"
  [v verbose bool "verbose"]
  (let [mod (str (-> (boot/get-env) :gae :module))
        rgx (re-pattern (str "(^" mod "/.*clj$)"))
        prev (atom nil)]
    (println "MODULE: " mod)
    (println "REGEX: " rgx)
    ;; (comp
    (boot/with-pre-wrap [fileset]
      (let [changes (->> (boot/fileset-diff @prev fileset)
                         boot/output-files
                         (map :path))
            fs (boot/new-fileset)
            cache-dir (boot/cache-dir! :boot-gae/build)]
        (doseq [path changes]
          (if verbose (util/info (str "changed: " path "\n")))
          (let [in-file (boot/tmp-file (boot/tmp-get fileset path))
                out-file (if (str/ends-with? path "clj")
                           (doto (io/file cache-dir classes-dir path) io/make-parents)
                           (doto (io/file cache-dir path) io/make-parents))]
            (io/copy in-file out-file))))
      (reset! prev fileset))))

(boot/deftask prod
  "make a prod build"
