File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ It provides:
4141* AWS Lambda deployment package
4242* Self-executable jars (Using One-JAR)
4343* "Skinny" jars (Jars which do not contain their dependencies)
44- ** Library jars
44+ * Library jars
4545
4646=== What does conflict-less mean?
4747
Original file line number Diff line number Diff line change 6060
6161 Options
6262 :basis - required, basis to create library from
63- :path - required, location to output library to"
63+ :path - required, location to output library to
64+ :pom - input pom.xml, if provided will be copied to
65+ META-INF/maven/<group>/<artifact>/pom.xml
66+ :lib - required if :pom supplied, used to create pom.xml path"
6467 [params]
65- (skinny {:path (:path params)
66- :path-coerce :jar }))
68+ ((requiring-resolve 'juxt.pack.library/library) params))
6769
6870(defn aws-lambda
6971 " Produce a zip file that can be uploaded to AWS lambda. You will need to AOT
Original file line number Diff line number Diff line change 6868
6969 Options
7070 :basis - basis to use, if not provided will create a basis without :user
71- :path - required, location to output library to"
71+ :path - required, location to output library to
72+ :pom - input pom.xml, if provided will be copied to
73+ META-INF/maven/<group>/<artifact>/pom.xml
74+ :lib - required if :pom supplied, used to create pom.xml path"
7275 [{:keys [basis] :as params}]
73- (skinny {:path (:path params)
74- :path-coerce :jar }))
76+ (pack/library (assoc params :basis (or basis (create-basis nil )))))
7577
7678(defn aws-lambda
7779 " Produce a zip file that can be uploaded to AWS lambda. You will need to AOT
Original file line number Diff line number Diff line change 1+ (ns ^:no-doc juxt.pack.library
2+ (:require
3+ [clojure.java.io :as io]
4+ [juxt.pack.impl.vfs :as vfs]))
5+
6+ (defn write-paths
7+ [basis output-path extra-paths]
8+ (io/make-parents (io/file output-path))
9+ (vfs/write-vfs
10+ {:type :jar
11+ :stream (io/output-stream output-path)}
12+ (concat extra-paths
13+ (mapcat
14+ (fn [path]
15+ (vfs/files-path
16+ (file-seq (io/file path))
17+ (io/file path)))
18+ (keep
19+ #(when (:path-key (val %))
20+ (key %))
21+ (:classpath basis))))))
22+
23+ (defn library
24+ [{:keys [basis path pom lib]}]
25+ (write-paths basis path
26+ (when pom
27+ [{:path [" META-INF" " maven" (namespace lib) (name lib) " pom.xml" ]
28+ :input (io/input-stream pom)}])))
You can’t perform that action at this time.
0 commit comments