Created
June 5, 2017 15:11
-
-
Save cemerick/00e9e8d1da6461d9daaddd0232943411 to your computer and use it in GitHub Desktop.
optional alternative :filespec destination path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; e.g. usage | |
:filespecs [{:type :path :path "source/directory" :root "destination/directory/"}] | |
; at the end of project.clj | |
(require 'leiningen.jar) | |
(in-ns 'leiningen.jar) | |
(defmethod copy-to-jar :path [project jar-os acc spec] | |
(let [root-file (io/file (:path spec)) | |
root-dir-path (unix-path (dir-string root-file)) | |
destination-root (:root spec) | |
paths (for [child (file-seq root-file) | |
:let [path (relativize-path | |
(full-path child (unix-path (str child))) | |
root-dir-path)]] | |
(when-not (or (skip-file? child path root-file | |
(:jar-exclusions project)) | |
(added-file? child path acc)) | |
(put-jar-entry! jar-os child (str destination-root path)) | |
path))] | |
(into acc paths))) | |
(in-ns 'leiningen.core.project) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
issue opened: technomancy/leiningen#2280