   [d dir DIR str "output dir"
    c config-syms SYMS #{sym} "namespaced symbols bound to meta-config data"
    k keep bool "keep intermediate .clj files"
+   u unit-test bool "configure for unit testing (module = 'default')"
    v verbose bool "Print trace messages."]
   (comp
    (webxml :verbose verbose)
-   (appengine :verbose verbose)))
-
-(boot/deftask service-app
+   (appengine :unit-test unit-test :verbose verbose)))
+
+(boot/deftask config-app
   "generate xml config files for microservices app"
   [d dir DIR str "output dir"
    c config-syms SYMS #{sym} "namespaced symbols bound to meta-config data"

  [fileset servlet]
  (if servlet
    "target"
    (let [boot-config-edn-files (->> (boot/input-files fileset)
                                     (boot/by-name [boot-config-edn]))
          boot-config-edn-f (condp = (count boot-config-edn-files)
                              0 nil
                              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 boot-config-edn-f
                                (-> (boot/tmp-file boot-config-edn-f) slurp read-string)
                                nil)]
      (if boot-config-edn-map
        (str "target/" (-> boot-config-edn-map :module :name))
        (let [appengine-edn-fs (->> fileset
                                    boot/input-files
                                    (boot/by-name [appengine-edn]))

              appengine-edn-f (condp = (count appengine-edn-fs)
                                0 (throw (Exception. appengine-edn " file not found"))
                                1 (first appengine-edn-fs)
                                (throw (Exception. (str "Only one " appengine-edn " file allowed"))))

              appengine-config-map (-> (boot/tmp-file appengine-edn-f) slurp read-string)]
          (if servlet "target" (if (-> appengine-config-map :services)
                                 "target/default"
                                 (str "target/" (-> appengine-config-map :module :name)))))))))

(defn expand-home [s]
  (if (or (.startsWith s "~") (.startsWith s "$HOME"))

   n gen-reloader-ns NS sym "ns for gen-reloader"
   r reloader-impl-ns NS sym "ns for reloader"
   s servlet bool "build as servlet"
   u unit-test bool "configure for unit testing"
   w web-inf WEB-INF str "WEB-INF dir, default: WEB-INF"
   v verbose bool "Print trace messages."]
  (let [workspace (boot/tmp-dir!)
