 
    _ modules MODULES edn "modules map"
 
-   s service bool "service"
+   s servlet bool "servlet app DEPRECATED"
    v verbose bool "verbose"]
 
   (boot/with-pre-wrap [fileset]
-    (let [webapp-edn-files (->> fileset
+    (let [appengine-edn-fs (->> fileset
                                 boot/input-files
-                                (boot/by-name [webapp-edn]))
-          webapp-edn-f (condp = (count webapp-edn-files)
-                         0 nil
-                         1 (first webapp-edn-files)
-                         (throw (Exception. "only one webapp.edn file allowed")))
-          webapp-edn-map (if webapp-edn-f (-> (boot/tmp-file webapp-edn-f) slurp read-string) {})
+                                (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)
+
+
           ;; (println "*OPTS*: " *opts*)
           args (->args *opts*)
           ;; _ (println "ARGS: " args)
           ;; jargs (into-array String (conj jargs "build/exploded-app"))
 
-          target-dir (if service (str (-> (boot/get-env) :gae :app :dir)
-                                      "/target/"
-                                      (-> (boot/get-env) :gae :module :name))
-                         "target")
+          target-dir (if servlet "target"
+                         (if (-> appengine-config-map :services)
+                           "target/default"
+                           (str "target/" (-> appengine-config-map :module :name))))
 
           checkout-vec (-> (boot/get-env) :checkouts)
           cos (map #(assoc (apply hash-map %) :coords [(first %) (second %)]) checkout-vec)

          (appengine :verbose verbose)
          (builtin/sift :move {#"(.*clj$)" (str classes-dir "/$1")})
          (builtin/sift :move {#"(.*\.class$)" (str classes-dir "/$1")})
          (if service
            (comp
             (builtin/pom)
             (builtin/jar))
            identity)
          (target :service service :verbose verbose)
          #_(builtin/sift :include #{(re-pattern (str mod ".*jar"))})
          #_(builtin/install)
          #_(target :verbose verbose)

   d dir DIR str "output dir"
   k keep bool "keep intermediate .clj files"
   m module MODULE str "module dirpath"
   s servlet bool "generate config for servlet app instead of service component DEPRECATED"
   v verbose bool "Print trace messages."]
  ;; boolean hasUppercase = !password.equals(password.toLowerCase());
  (let [workspace (boot/tmp-dir!)
        config-workspace (boot/tmp-dir!)
        prev-pre (atom nil)
        dir (if dir dir web-inf-dir)]
    (boot/with-pre-wrap fileset
