Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kumarshantanu committed Jun 17, 2012
2 parents 70ef17f + f917169 commit 33b1e3c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Expand Up @@ -7,7 +7,7 @@
* [TODO] Generate WAR file for a webapp


## 2012-June-??
## 2012-June-17

* Servlet-engine adapters:
* Jetty 7.6.3.v20120416 `lein-servlet/adapter-jetty7` `0.1.0`
Expand Down
41 changes: 19 additions & 22 deletions plugin/src/leiningen/servlet.clj
Expand Up @@ -96,11 +96,9 @@
(let [deps (get-in project DEPS)
repos (get-in project REPOS)]
(when deps (load-deps deps repos)))
(println project)
(let [project (-> project
with-defaults
(update-project-deps (get-in project DEPS)))
_ (println "Servlet:" (:servlet project))
wanted-eng (get-in project WANTED-ENG)
config (get-in project CONFIG)
webapps (get-in project WEBAPPS)
Expand All @@ -110,7 +108,6 @@
port (get-in project PORT)
config (merge {:tmpdir (str (:target-path project) \/ enam \. port)}
config)
_ (println "Config:" config)
home-url (str "http://localhost:" port)]
(if (and ens enam)
(eval/eval-in-project project `(let [e# (~full-name ~config ~webapps)]
Expand All @@ -121,6 +118,24 @@
(err-println "Unable to determine engine"))))


(defn show-help
"Show help for this plugin"
[]
(println "
Synopsis:
lein servlet <command> [<arguments> ..]
where <command> and respective <arguments> are:
run
war [<app-name>]
help
To generate a new project template containing example configuration:
lein new servlet demo
")
(flush))


(defn war
"Generate WAR file"
[project [app-name]]
Expand All @@ -130,7 +145,7 @@
w-names (set (keys webapps))
v-names (format "(valid names: %s)" (comma-sep (keys webapps)))]
(cond (empty? w-names) (do (err-println "No webapps configured")
(help/show-help))
(show-help))
(w-names app-name) (war/generate-war project
(get webapps app-name))
app-name (err-println "No such webapp name"
Expand All @@ -141,24 +156,6 @@
v-names))))


(defn show-help
"Show help for this plugin"
[]
(println "
Synopsis:
lein servlet <command> [<arguments> ..]
where <command> and respective <arguments> are:
run
war [<app-name>]
help [config]
To generate a new project template containing example configuration:
lein new servlet demo
")
(flush))


(defn servlet
"Work with servlets in Java or another JVM language."
[project & [cmd & args]]
Expand Down

0 comments on commit 33b1e3c

Please sign in to comment.