          (spit boot-config-edn-out-file master-config)
          (spit xml-out-file content))
       (-> fileset (boot/add-resource workspace) boot/commit!))))
-
 
 ;; (boot/deftask mods
 ;;   "modules"

                                                         (boot/tmp-path boot-config-edn-f)
                                                         boot-config-edn-f))
                     ;; step 4: create servlet generator
                     gen-servlets-content (stencil/render-file "migae/templates/gen-servlets.mustache"
                                                               (assoc servlets-config-map
                                                                      :gen-servlets-ns
                                                                      gen-servlets-ns))

  ;; (print-task "logging" *opts*)
  (fn middleware [next-handler]
    (fn handler [fileset]
      (if verbose (util/info (format "Configuring logging for %s\n" (if jul "jul" "log4j"))))
      (let [workspace (boot/tmp-dir!)
            log4j-edn-files (->> fileset
                                 boot/input-files
                                 (boot/by-re [(re-pattern (str log4j-edn "$"))]))
            log4j-edn-f (condp = (count log4j-edn-files)
                          0 (throw (Exception. (str log4j-edn " file not found")))
                          1 (first log4j-edn-files)
                          (throw (Exception.
                                  (str "Only one " log4j-edn " file allowed; found "
                                       (count log4j-edn-files)))))
            log4j-cfg (-> (boot/tmp-file log4j-edn-f) slurp read-string)

            jul-edn-files (->> fileset
                               boot/input-files
                               (boot/by-re [(re-pattern (str jul-edn "$"))]))
            jul-edn-f (condp = (count jul-edn-files)
                        0 (throw (Exception. (str jul-edn " file not found")))
                        1 (first jul-edn-files)
                        (throw (Exception.
                                (str "Only one " jul-edn " file allowed; found "
                                     (count jul-edn-files)))))
            jul-cfg (-> (boot/tmp-file jul-edn-f) slurp read-string)

            boot-config-edn-files (->> fileset
                                       boot/input-files
                                       (boot/by-re [(re-pattern (str boot-config-edn "$"))]))
            boot-config-edn-f (condp = (count boot-config-edn-files)
                                0 (throw (Exception. (str boot-config-edn " file not found")))
                                ;; 0 (do (util/info (str "Creating " boot-config-edn "\n"))
                                ;;       (io/file boot-config-edn)) ;; this creates a java.io.File
                                1 (first boot-config-edn-files)  ;; this is a boot.tmpdir.TmpFile
                                (throw (Exception.
                                        (str "Only one " boot-config-edn " file allowed, found "
                                             (count boot-config-edn-files)))))
            boot-config-edn-map (if (instance? boot.tmpdir.TmpFile boot-config-edn-f)
                                  (-> (boot/tmp-file boot-config-edn-f) slurp read-string)
                                  {})

            content (stencil/render-file
                     (if jul
                       "migae/boot_gae/logging.properties.mustache"
                       "migae/boot_gae/log4j.properties.mustache")
                     (merge boot-config-edn-map (if jul jul-cfg log4j-cfg)))

            odir (if odir odir (if jul web-inf-dir classes-dir))

            out-path (if jul "logging.properties" "log4j.properties")

            mv-arg {(re-pattern out-path) (str odir "/$1")}

            target-middleware identity
