More readable and consistent spacing

This commit is contained in:
circlespainter 2014-09-19 13:11:18 +02:00
parent 72c0d04f51
commit ff6197bc60

View file

@ -32,9 +32,9 @@
(cond (symbol? v) (manifest-entry project [k (resolve v)]) (cond (symbol? v) (manifest-entry project [k (resolve v)])
(fn? v) (manifest-entry project [k (v project)]) (fn? v) (manifest-entry project [k (v project)])
(coll? v) (->> v ;; Sub-manifest = manifest section (coll? v) (->> v ;; Sub-manifest = manifest section
(manifest-entries project) (manifest-entries project)
(cons (str "\nName: " (name k) "\n")) (cons (str "\nName: " (name k) "\n"))
(string/join)) (string/join))
:else (->> (str (name k) ": " v) :else (->> (str (name k) ": " v)
(partition-all 70) ;; Manifest spec says lines <= 72 chars (partition-all 70) ;; Manifest spec says lines <= 72 chars
(map (partial apply str)) (map (partial apply str))
@ -50,17 +50,17 @@
(defn ^:internal make-manifest [project] (defn ^:internal make-manifest [project]
(let [initial-mf (let [initial-mf
(concat (conj default-manifest (concat (conj default-manifest
(if-let [main (:main project 'clojure.main)] (if-let [main (:main project 'clojure.main)]
["Main-Class" (munge (str main))])) ["Main-Class" (munge (str main))]))
(manifest-map-to-reordered-seq (:manifest project)))] (manifest-map-to-reordered-seq (:manifest project)))]
(->> initial-mf (->> initial-mf
(manifest-entries project) (manifest-entries project)
(cons "Manifest-Version: 1.0\n") ;; Manifest-Version line must be first (cons "Manifest-Version: 1.0\n") ;; Manifest-Version line must be first
(string/join "") (string/join "")
.getBytes .getBytes
ByteArrayInputStream. ByteArrayInputStream.
Manifest.))) Manifest.)))
(defn ^:internal manifest-map [manifest] (defn ^:internal manifest-map [manifest]
(let [attrs (.getMainAttributes manifest)] (let [attrs (.getMainAttributes manifest)]