-
Notifications
You must be signed in to change notification settings - Fork 6
/
bb.edn
73 lines (62 loc) · 4.71 KB
/
bb.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{:paths ["script"]
:deps {borkdude/gh-release-artifact
#_ {:local/root "../gh-release-artifact"}
{:git/url "https://github.com/borkdude/gh-release-artifact"
:git/sha "db5e79559fdbfa009ed4a0921079e20e1e76b269"}}
:tasks {:requires ([babashka.fs :as fs])
:init (do (defn print-public-task [k]
(let [{:keys [:private :name]} (current-task)]
(when-not private
(println (case k :enter "☐" "✓") name)))))
:enter (print-public-task :enter)
:leave (print-public-task :leave)
recent-clj-kondo {:doc "Detects most recent clj-kondo version from clojars"
:requires ([babashka.curl :as curl]
[cheshire.core :as cheshire])
;; see https://github.com/clojars/clojars-web/wiki/Data
:task (-> (curl/get "https://clojars.org/api/artifacts/clj-kondo/clj-kondo")
:body (cheshire/parse-string true)
:latest_release)}
update-project-clj {:doc "Updates project.clj with most recent clj-kondo version"
:depends [recent-clj-kondo]
:task (binding [*command-line-args* [recent-clj-kondo]]
(load-file "script/update-project.clj"))}
-uberjar {:depends [recent-clj-kondo update-project-clj]
:task (str (fs/path "server/target" (str "lsp-server-"
recent-clj-kondo
"-standalone.jar")))}
build-server {:doc "Produces lsp server standalone jar"
:depends [update-project-clj -uberjar]
:task (when (seq (fs/modified-since -uberjar ["server/project.clj" "server/src"]))
(shell {:dir "server"}
"lein with-profiles -user do clean, run -m clj-kondo.lsp-server.impl.version")
(shell {:dir "server"}
"lein with-profiles -user do clean, uberjar"))}
-jar {:depends [recent-clj-kondo]
:task (str "server/target/lsp-server-" recent-clj-kondo "-standalone.jar")}
lsp-jar {:doc "Copies renamed jar for upload to clj-kondo repo"
:depends [build-server -jar]
:task (let [lsp-jar (fs/path (fs/parent -jar) (str "clj-kondo-" (fs/file-name -jar)))]
(fs/copy -jar lsp-jar {:replace-existing true}))}
upload-jar {:doc "Uploads standalone lsp server jar to clj-kondo repo"
:depends [recent-clj-kondo lsp-jar]
:requires ([clj-kondo-lsp.release-artifact :as ghr])
:task (ghr/release recent-clj-kondo lsp-jar)}
vscode-server {:doc "Copied lsp server jar to vscode extension"
:depends [lsp-jar]
:task (fs/copy lsp-jar (fs/path "vscode-extension" "clj-kondo.lsp-standalone.jar")
{:replace-existing true})}
vscode-version {:doc "Prepares package.json with up to date clj-kondo version"
:depends [recent-clj-kondo]
:task (binding [*command-line-args* [recent-clj-kondo]]
(load-file "script/update-package-json.clj"))}
vscode-publish {:doc "Publishes vscode extension to marketplace"
:depends [vscode-server vscode-version]
:task (shell {:dir "vscode-extension"} "vsce publish")}
ovsx-publish {:doc "Publishes vscode extension to ovsx thing"
:depends [vscode-server vscode-version]
:task (shell {:dir "vscode-extension"}
(str "ovsx publish --pat "
(System/getenv "OVSX_TOKEN")))}
publish {:doc "The mother of all tasks: publishes everything needed for new release"
:depends [upload-jar vscode-publish ovsx-publish]}}}