|
36 | 36 | "Add Maven dependencies to the classpath, fetching them if necessary."
|
37 | 37 | [old new env]
|
38 | 38 | (->> new rm-clojure-dep (assoc env :dependencies) pod/add-dependencies)
|
39 |
| - (into (or old []) new)) |
| 39 | + new) |
40 | 40 |
|
41 | 41 | (defn- add-directories!
|
42 | 42 | "Add URLs (directories or jar files) to the classpath."
|
|
57 | 57 | (let [dk :dependencies]
|
58 | 58 | (->> kvs (sort-by first #(cond (= %1 dk) 1 (= %2 dk) -1 :else 0)))))
|
59 | 59 |
|
60 |
| -(def ^:private base-env |
61 |
| - "Returns initial boot environment settings." |
62 |
| - (fn [] |
63 |
| - '{:dependencies [] |
64 |
| - :src-paths #{} |
65 |
| - :tgt-path "target" |
66 |
| - :repositories [["clojars" "http://clojars.org/repo/"] |
67 |
| - ["maven-central" "http://repo1.maven.org/maven2/"]]})) |
68 |
| - |
69 | 60 | ;; ## Boot Environment
|
70 | 61 | ;;
|
71 | 62 | ;; _These functions are used internally by boot and are not part of the public
|
|
74 | 65 | (declare ^{:dynamic true :doc "The running version of boot."} *boot-version*)
|
75 | 66 | (declare ^{:dynamic true :doc "Command line options for boot itself."} *boot-opts*)
|
76 | 67 |
|
77 |
| -(def boot-env |
| 68 | +(def ^:private boot-env |
78 | 69 | "Atom containing environment key/value pairs. Do not manipulate this atom
|
79 | 70 | directly. Use `set-env!` (below) instead."
|
80 | 71 | (atom nil))
|
|
84 | 75 | There should be no need to call this function directly."
|
85 | 76 | [& kvs]
|
86 | 77 | (doto boot-env
|
87 |
| - (reset! (merge (base-env) (apply hash-map kvs))) |
| 78 | + (reset! |
| 79 | + (->> (apply hash-map kvs) |
| 80 | + (merge {:dependencies [] |
| 81 | + :src-paths #{} |
| 82 | + :tgt-path "target" |
| 83 | + :repositories [["clojars" "http://clojars.org/repo/"] |
| 84 | + ["maven-central" "http://repo1.maven.org/maven2/"]]}))) |
88 | 85 | (add-watch ::boot #(configure!* %3 %4))))
|
89 | 86 |
|
90 | 87 | (defmulti on-env!
|
|
111 | 108 | ;;
|
112 | 109 | ;; _Functions provided for use in boot tasks._
|
113 | 110 |
|
114 |
| -;; Maven Repository Global Configuration |
115 |
| - |
116 |
| -(defn set-offline! |
117 |
| - "Set/unset offline mode for dependency resolution." |
118 |
| - [x] |
119 |
| - (pod/call-worker `(boot.aether/set-offline! ~x))) |
120 |
| - |
121 |
| -(defn set-update! |
122 |
| - "Set the snapshot update frequency for dependency resolution. Accepted values |
123 |
| - of x are `:always`, `:daily`, or `:never`." |
124 |
| - [x] |
125 |
| - (pod/call-worker `(boot.aether/set-update! ~x))) |
126 |
| - |
127 | 111 | ;; ## Boot Environment Management Functions
|
128 | 112 |
|
129 | 113 | (defn get-env
|
|
160 | 144 | [dst & [srcs]]
|
161 | 145 | (tmp/add-sync! @tmpregistry dst srcs))
|
162 | 146 |
|
163 |
| -;; ## Task helpers |
| 147 | +(defn add-wagon! |
| 148 | + "FIXME: document this." |
| 149 | + [maven-coord & [scheme-map]] |
| 150 | + (pod/call-worker |
| 151 | + `(boot.aether/add-wagon ~(get-env) ~maven-coord ~scheme-map))) |
| 152 | + |
| 153 | +;; ## Task helpers – managed temp files |
164 | 154 |
|
165 | 155 | (def ^:private consumed-files (atom #{}))
|
166 | 156 |
|
|
195 | 185 | [f]
|
196 | 186 | (tmp/tmpfile? @tmpregistry f))
|
197 | 187 |
|
198 |
| -(defn mktmp! |
199 |
| - "Create a temp file and return its `File` object. If `mktmp!` has already |
200 |
| - been called with the given `key` the tmpfile will be truncated. The optional |
201 |
| - `name` argument can be used to customize the temp file name (useful for |
202 |
| - creating temp files with a specific file extension, for example)." |
203 |
| - [key & [name]] |
204 |
| - (tmp/mk! @tmpregistry key name)) |
205 |
| - |
206 | 188 | (defn mktmpdir!
|
207 | 189 | "Create a temp directory and return its `File` object. If `mktmpdir!` has
|
208 | 190 | already been called with the given `key` the directory's contents will be
|
209 |
| - deleted. The optional `name` argument can be used to customize the temp |
210 |
| - directory name, as with `mktmp!` above." |
211 |
| - [key & [name]] |
212 |
| - (tmp/mkdir! @tmpregistry key name)) |
| 191 | + deleted." |
| 192 | + [key] |
| 193 | + (tmp/mkdir! @tmpregistry key)) |
213 | 194 |
|
214 |
| -(def tgtdirs |
215 |
| - "Atom containing a vector of File objects--directories created by `mktgtdir!`. |
| 195 | +(def ^:private tgtdirs |
| 196 | + "Atom containing a vector of File objects–directories created by `mktgtdir!`. |
216 | 197 | This atom is managed by boot and shouldn't be manipulated directly."
|
217 | 198 | (atom []))
|
218 | 199 |
|
|
0 commit comments