|
1 | 1 | (ns build
|
2 | 2 | (:require [clojure.edn :as edn]
|
3 | 3 | [clojure.java.io :as io]
|
4 |
| - [clojure.string :as string] |
5 | 4 | [clojure.tools.build.api :as b]
|
6 | 5 | [deps-deploy.deps-deploy :as dd]
|
7 | 6 | [whitespace-linter]))
|
|
19 | 18 | (def jar-file (format "target/%s.jar" (name lib)))
|
20 | 19 | (def built-jar-version-file "target/built-jar-version.txt")
|
21 | 20 |
|
22 |
| -(def windows? (string/starts-with? (System/getProperty "os.name") "Windows")) |
23 |
| - |
24 |
| -(defn- localize-path [p] |
25 |
| - (if windows? |
26 |
| - (string/replace p "/" "\\") |
27 |
| - p)) |
28 |
| - |
29 |
| -(defn- localize-regex-path [p] |
30 |
| - (if windows? |
31 |
| - (string/replace p "/" "\\\\") |
32 |
| - p)) |
33 |
| - |
34 | 21 | (defn jar
|
35 | 22 | "Build library jar file.
|
36 | 23 | Also writes built version to target/built-jar-version.txt for easy peasy pickup by any interested downstream operation.
|
|
89 | 76 | (println lib))
|
90 | 77 |
|
91 | 78 | (defn lint-whitespace
|
92 |
| - "Wrap camsaul's whitespace-linter to handle OS specific file separator" |
| 79 | + "Use camsaul's whitespace-linter" |
93 | 80 | [_]
|
94 |
| - (whitespace-linter/lint {:paths (->> [".clj-kondo/config.edn" |
95 |
| - ".codecov.yml" |
96 |
| - ".github" |
97 |
| - ".gitignore" |
98 |
| - "CHANGELOG.adoc" |
99 |
| - "CODE_OF_CONDUCT.md" |
100 |
| - "CONTRIBUTING.md" |
101 |
| - "LICENSE" |
102 |
| - "ORIGINATOR" |
103 |
| - "README.adoc" |
104 |
| - "bb.edn" |
105 |
| - "build.clj" |
106 |
| - "deps.edn" |
107 |
| - "doc" |
108 |
| - "fig.cljs.edn" |
109 |
| - "package.json" |
110 |
| - "pom.xml" |
111 |
| - "resources" |
112 |
| - "script" |
113 |
| - "src" |
114 |
| - "template" |
115 |
| - "test" |
116 |
| - "test-isolated" |
117 |
| - "tests.edn" |
118 |
| - "version.edn"] |
119 |
| - (mapv localize-path)) |
120 |
| - :include-patterns ["\\.clj.?$" "\\.edn$" "\\.yaml$" "\\.adoc$" "\\.md$" |
121 |
| - "CODEOWNERS$" "LICENSE$" "ORIGINATOR$" |
122 |
| - ".clj-kondo.config.edn"] |
123 |
| - :exclude-patterns (->> [;; exclude things generated |
124 |
| - "doc/generated/.*$" |
125 |
| - "src/rewrite_clj/(node|zip)\\.cljc$" |
126 |
| - "src/rewrite_clj/node/string\\.clj$" |
127 |
| - "src/rewrite_clj/zip/(edit|find|remove|seq)\\.clj"] |
128 |
| - (mapv localize-regex-path))})) |
| 81 | + (whitespace-linter/lint {:paths [".clj-kondo/config.edn" |
| 82 | + ".codecov.yml" |
| 83 | + ".github/" |
| 84 | + ".gitignore" |
| 85 | + "CHANGELOG.adoc" |
| 86 | + "CODE_OF_CONDUCT.md" |
| 87 | + "CONTRIBUTING.md" |
| 88 | + "LICENSE" |
| 89 | + "ORIGINATOR" |
| 90 | + "README.adoc" |
| 91 | + "bb.edn" |
| 92 | + "build.clj" |
| 93 | + "deps.edn" |
| 94 | + "doc/" |
| 95 | + "fig.cljs.edn" |
| 96 | + "package.json" |
| 97 | + "pom.xml" |
| 98 | + "resources/" |
| 99 | + "script/" |
| 100 | + "src/" |
| 101 | + "template/" |
| 102 | + "test/" |
| 103 | + "test-isolated/" |
| 104 | + "tests.edn" |
| 105 | + "version.edn"] |
| 106 | + :include-patterns [#"\.clj.?$" #"\.edn$" #"\.yaml$" #"\.adoc$" #"\.md$" |
| 107 | + #"CODEOWNERS$" #"LICENSE$" #"ORIGINATOR$" |
| 108 | + #"\.clj-kondo/config.edn"] |
| 109 | + :exclude-patterns [;; exclude things generated |
| 110 | + #"doc/generated/.*$" |
| 111 | + #"src/rewrite_clj/(node|zip)\.cljc$" |
| 112 | + #"src/rewrite_clj/node/string\.clj$" |
| 113 | + #"src/rewrite_clj/zip/(edit|find|remove|seq)\.clj"]})) |
0 commit comments