|
16 | 16 | (defn published? |
17 | 17 | "A `predicate-fn` designed to be used with [[k16.kmono.core.graph/filter-by]]. |
18 | 18 |
|
19 | | - Checks whether a given `package` has been published to it's maven repository. |
20 | | - The repositories from the packages `:mvn/deps` map will be used to run this |
21 | | - check. |
| 19 | + Checks whether a given `package` has been published to it's maven repository. |
| 20 | + The repositories from the packages `:mvn/deps` map will be used to run this |
| 21 | + check. |
22 | 22 |
|
23 | | - Requires that the package has a `:version` set in order to perform a maven |
24 | | - query. |
| 23 | + Requires that the package has a `:version` set in order to perform a maven |
| 24 | + query. |
25 | 25 |
|
26 | | - This fn will just return `false` if the package `:version` is not set." |
| 26 | + This fn will just return `false` if the package `:version` is not set." |
27 | 27 | [package] |
28 | 28 | (let [local-repo-override (str (fs/create-temp-dir))] |
29 | 29 | (try |
|
49 | 49 | (defn join |
50 | 50 | "Attempt to join together a given a series of paths. |
51 | 51 |
|
52 | | - For example - given `(join \"/a/b/c\" \"../d\")` return `\"/a/b/d\"`" |
| 52 | + For example - given `(join \"/a/b/c\" \"../d\")` return `\"/a/b/d\"`" |
53 | 53 | [& paths] |
54 | 54 | (->> (apply fs/file paths) |
55 | 55 | fs/normalize |
56 | 56 | str)) |
57 | 57 |
|
58 | 58 | (defn create-basis |
59 | 59 | "Constructs a basis using [[clojure.tools.build.api/create-basis]] with a |
60 | | - modified set of `:libs`. |
| 60 | + modified set of `:libs`. |
61 | 61 |
|
62 | | - Any `:local/root` kmono dependencies within the basis are replaced with their |
63 | | - respective `:mvn/version` coordinate derived from the given `packages` map. |
| 62 | + Any `:local/root` kmono dependencies within the basis are replaced with their |
| 63 | + respective `:mvn/version` coordinate derived from the given `packages` map. |
64 | 64 |
|
65 | | - These `:libs` are then used to generate a correctly referenced `pom.xml` when |
66 | | - using [[clojure.tools.build.api/write-pom]]. |
| 65 | + These `:libs` are then used to generate a correctly referenced `pom.xml` when |
| 66 | + using [[clojure.tools.build.api/write-pom]]. |
67 | 67 |
|
68 | | - Additional `opts` can be optionally provided and these will be given directly |
69 | | - to `create-basis`." |
| 68 | + Additional `opts` can be optionally provided and these will be given directly |
| 69 | + to `create-basis`." |
70 | 70 | ([packages package] (create-basis packages package {})) |
71 | 71 | ([packages package opts] |
72 | 72 | (let [dependencies |
|
96 | 96 | (defn for-each-package |
97 | 97 | "Execute a given `build-fn` for each package in the given `packages` map. |
98 | 98 |
|
99 | | - Accepts an optional `opts` map containing: |
| 99 | + Accepts an optional `opts` map containing: |
100 | 100 |
|
101 | | - - **`:concurrency`** :int (default 4) - The maximum number of packages that |
102 | | - can be executing at a time. |
103 | | - - **`:run-in-order`** :boolean (default `true`) - Set this to false to run |
104 | | - all packages concurrently ignoring their dependency order. |
105 | | - - **`silent`** :boolean (default `false`) - Set this to true to disable |
106 | | - logging the package name and version. |
| 101 | + - **`:concurrency`** :int (default 4) - The maximum number of packages that |
| 102 | + can be executing at a time. |
| 103 | + - **`:run-in-order`** :boolean (default `true`) - Set this to false to run |
| 104 | + all packages concurrently ignoring their dependency order. |
| 105 | + - **`silent`** :boolean (default `false`) - Set this to true to disable |
| 106 | + logging the package name and version. |
107 | 107 |
|
108 | | - The `build-fn` will be called with the `*project-root*` var (from |
109 | | - `clojure.tools.build.api`) bound to the subdirectory of the relevant package. |
110 | | - This allows using the various API's from `tools.build` under the assumption |
111 | | - that all specified paths will be relative to the package subdirectory. |
| 108 | + The `build-fn` will be called with the `*project-root*` var (from |
| 109 | + `clojure.tools.build.api`) bound to the subdirectory of the relevant package. |
| 110 | + This allows using the various API's from `tools.build` under the assumption |
| 111 | + that all specified paths will be relative to the package subdirectory. |
112 | 112 |
|
113 | | - TIP: Use the [[clojure.tools.build.api/resolve-path]] API to resolve a path |
114 | | - relative to the current package dir. |
| 113 | + TIP: Use the [[clojure.tools.build.api/resolve-path]] API to resolve a path |
| 114 | + relative to the current package dir. |
115 | 115 |
|
116 | | - The `build-fn` will be called concurrently (up to max of `:concurrency` or |
117 | | - `4`) but packages with dependencies will only be executed after each of their |
118 | | - respective dependencies have run unless `:run-in-order` is `false`." |
| 116 | + The `build-fn` will be called concurrently (up to max of `:concurrency` or |
| 117 | + `4`) but packages with dependencies will only be executed after each of their |
| 118 | + respective dependencies have run unless `:run-in-order` is `false`." |
119 | 119 | {:style/indent :defn |
120 | 120 | :malli/schema |
121 | 121 | [:function |
|
0 commit comments