Fix to lein-jar path resolution bug.

This commit is contained in:
Perry Trolard 2010-02-01 15:50:45 -06:00 committed by Phil Hagelberg
parent 024f167d86
commit 4b773b1835

View file

@ -32,18 +32,17 @@
(re-sub (re-pattern (str "^" (Pattern/quote to-trim))) "" s))
(defmethod copy-to-jar :path [project jar-os spec]
(let [root (str (unix-path (:root project)) \/)
noroot #(trim-leading-str (unix-path %) root)
[resources classes src]
(map noroot (map project [:resources-path :compile-path :source-path]))]
(doseq [child (file-seq (file (:path spec)))]
(when-not (.isDirectory child)
(let [path (reduce trim-leading-str
(let [path (reduce trim-leading-str
(unix-path (str child))
[(unix-path (:root project))
"/"
"resources"
"classes"
(:source-path project)
"/"])]
[root resources classes src "/"])]
(.putNextEntry jar-os (JarEntry. path))
(copy child jar-os)))))
(copy child jar-os))))))
(defmethod copy-to-jar :bytes [project jar-os spec]
(.putNextEntry jar-os (JarEntry. (:path spec)))