File tree 3 files changed +17
-2
lines changed
3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
1
{:paths [" src/scripts" ]
2
2
:tasks {tag scripts/tag
3
3
build-plugin scripts/build-plugin
4
+ install-plugin scripts/install-plugin
4
5
publish-plugin scripts/publish-plugin}}
Original file line number Diff line number Diff line change 4
4
5
5
or
6
6
7
- ` ./gradlew buildPlugin ` to build the plugin, then install it from disk in Intellij, the zip should be on ` ./build/distributions/*.zip ` .
7
+ ` bb install-plugin ` to build and install the plugin .
8
8
9
9
## NREPL
10
10
Original file line number Diff line number Diff line change 1
1
(ns scripts
2
2
(:require
3
+ [babashka.fs :as fs]
3
4
[babashka.tasks :refer [shell]]
4
5
[clojure.string :as string]))
5
6
7
+ (def version-regex #"pluginVersion = ([0-9]+.[0-9]+.[0-9]+.*)" )
8
+
6
9
(defn ^:private replace-in-file [file regex content]
7
10
(as-> (slurp file) $
8
11
(string/replace $ regex content)
17
20
18
21
(defn ^:private replace-tag [tag]
19
22
(replace-in-file " gradle.properties"
20
- #"pluginVersion = [0-9]+.[0-9]+.[0-9]+.*"
23
+ version-regex
21
24
(format " pluginVersion = %s" tag)))
22
25
23
26
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var ]}
36
39
(defn build-plugin []
37
40
(shell " ./gradlew buildPlugin" ))
38
41
42
+ #_{:clj-kondo/ignore [:clojure-lsp/unused-public-var ]}
43
+ (defn install-plugin [& [intellij-plugins-path]]
44
+ (if-not intellij-plugins-path
45
+ (println " Specify the Intellij plugins path\n e.g: bb install-plugin /home/greg/.local/share/JetBrains/IdeaIC2024.3" )
46
+ (let [version (last (re-find version-regex (slurp " gradle.properties" )))]
47
+ (build-plugin )
48
+ (fs/unzip (format " ./build/distributions/clojure-lsp-%s.zip" version)
49
+ intellij-plugins-path
50
+ {:replace-existing true })
51
+ (println " Installed!" ))))
52
+
39
53
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var ]}
40
54
(defn publish-plugin []
41
55
(shell " ./gradlew clean publishPlugin" ))
You can’t perform that action at this time.
0 commit comments