-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This allows tailoring the output specifically to the needs of libraries, such as automatically placing the pom.xml.
- Loading branch information
1 parent
6461571
commit 9fd4a63
Showing
4 changed files
with
39 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
(ns ^:no-doc juxt.pack.library | ||
(:require | ||
[clojure.java.io :as io] | ||
[juxt.pack.impl.vfs :as vfs])) | ||
|
||
(defn write-paths | ||
[basis output-path extra-paths] | ||
(io/make-parents (io/file output-path)) | ||
(vfs/write-vfs | ||
{:type :jar | ||
:stream (io/output-stream output-path)} | ||
(concat extra-paths | ||
(mapcat | ||
(fn [path] | ||
(vfs/files-path | ||
(file-seq (io/file path)) | ||
(io/file path))) | ||
(keep | ||
#(when (:path-key (val %)) | ||
(key %)) | ||
(:classpath basis)))))) | ||
|
||
(defn library | ||
[{:keys [basis path pom lib]}] | ||
(write-paths basis path | ||
(when pom | ||
[{:path ["META-INF" "maven" (namespace lib) (name lib) "pom.xml"] | ||
:input (io/input-stream pom)}]))) |