Added :gen-class directive and Leiningen :main to generate useable uberjar

This commit is contained in:
fogus 2011-01-04 10:34:02 -05:00
parent 91a2c90f46
commit b60a453a1b
2 changed files with 6 additions and 5 deletions

View file

@ -1,5 +1,6 @@
(defproject marginalia "0.2.2" (defproject marginalia "0.2.2"
:description "lightweight literate programming for clojure -- inspired by [docco](http://jashkenas.github.com/docco/)" :description "lightweight literate programming for clojure -- inspired by [docco](http://jashkenas.github.com/docco/)"
:main marginalia.core
:dependencies :dependencies
[[org.clojure/clojure "1.2.0"] [[org.clojure/clojure "1.2.0"]
[org.clojars.nakkaya/markdownj "1.0.2b4"] [org.clojars.nakkaya/markdownj "1.0.2b4"]

View file

@ -4,7 +4,8 @@
(:require [clojure.java.io :as io] (:require [clojure.java.io :as io]
[clojure.string :as str]) [clojure.string :as str])
(:use [marginalia.html :only (uberdoc-html)] (:use [marginalia.html :only (uberdoc-html)]
[clojure.contrib.find-namespaces :only (read-file-ns-decl)])) [clojure.contrib.find-namespaces :only (read-file-ns-decl)])
(:gen-class))
(def *test* "./src/cljojo/core.clj") (def *test* "./src/cljojo/core.clj")
@ -250,18 +251,17 @@
(defn -main (defn -main
"main docstring "main docstring
Multi line" Multi line"
[sources] [& sources]
(run-marginalia sources)) (run-marginalia sources))
;; # Example Usage ;; # Example Usage
(comment (comment
;; Command line example ;; Command line example
(-main ["./src/marginalia/core.clj" "./src/marginalia/html.clj"]) (-main "./src/marginalia/core.clj" "./src/marginalia/html.clj")
;; This will find all marginalia source files, and then generate an uberdoc. ;; This will find all marginalia source files, and then generate an uberdoc.
(-main (find-clojure-file-paths "./src")) (apply -main (find-clojure-file-paths "./src"))
;; Move these to tests ;; Move these to tests
(merge-line {:docstring-text "hello world" :line 3} {:docs ["stuff"]}) (merge-line {:docstring-text "hello world" :line 3} {:docs ["stuff"]})