Skip to content

Commit ee145b5

Browse files
committed
Rename script files to match bb tasks names
While moving to bb tasks I found that my task names were better than my script filenames. This change renames script filenames to match task names - just to keep me sane. Also now using tasks from scripts and GitHub Action workflows. And updated change log.
1 parent bf02672 commit ee145b5

22 files changed

+53
-50
lines changed

.github/workflows/code-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: clojure -Spath
4444

4545
- name: Run Tests with Code Coverage
46-
run: bb ./script/coverage.clj
46+
run: bb test-coverage
4747

4848
- name: Upload Code Coverage Results
4949
run: |

.github/workflows/libs-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
~/.m2/repository
1919
~/.gitlibs
2020
# base cache on libs_test.clj script for now... lib deps are embedded in it
21-
key: $${ runner.os }}-clj-libs-deps-${{ hashFiles('script/libs_tests.clj') }}
21+
key: $${ runner.os }}-clj-libs-deps-${{ hashFiles('script/test_libs.clj') }}
2222
restore-keys: $${ runner.os }}-clj-libs-deps-
2323

2424
- name: Setup Java
@@ -53,4 +53,4 @@ jobs:
5353
planck --version
5454
5555
- name: Run Libs Tests
56-
run: bb ./script/libs_tests.clj run
56+
run: bb test-libs run

.github/workflows/native-image-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
matrix:
1010
os: [ windows-latest, ubuntu-latest, macos-latest ]
1111
graal-java: [ java11 ]
12-
test: [ pure, sci ]
12+
test: [ test-native, test-native-sci ]
1313

1414
name: ${{ matrix.os }},${{ matrix.graal-java }},${{ matrix.test }}
1515

@@ -109,9 +109,9 @@ jobs:
109109
run: |
110110
# it is overly awkward to get vcvars64.bat loaded into powershell, so we use cmd shell instead
111111
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
112-
bb script\${{ matrix.test }}_native_test.clj
112+
bb ${{ matrix.test }}
113113
shell: cmd
114114
if: matrix.os == 'windows-latest'
115115
- name: Execute ${{ matrix.test }} native test (macos, linux)
116-
run: bb script/${{ matrix.test }}_native_test.clj
116+
run: bb ${{ matrix.test }}
117117
if: matrix.os != 'windows-latest'

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ jobs:
5656
run: clojure -Spath
5757

5858
- name: Release Prep (step 1 of 4)
59-
run: bb ./script/release.clj prep
59+
run: bb ci-release prep
6060

6161
- name: Release Deploy (step 2 of 4)
6262
env:
6363
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
6464
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
65-
run: bb ./script/release.clj deploy-remote
65+
run: bb ci-release deploy-remote
6666

6767
- name: Release Commit (step 3 of 4)
68-
run: bb ./script/release.clj commit
68+
run: bb ci-release commit
6969

7070
- name: Make GitHub Actions aware of target version tag
7171
run: echo "::set-output name=tag::v$(cat ./target/target-version.txt)"

.github/workflows/unit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,4 @@ jobs:
146146
# Run tests
147147
#
148148
- name: Run CI tests
149-
run: bb ./script/ci_tests.clj
149+
run: bb ci-unit-tests

CHANGELOG.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ For a list of breaking changes see link:#v1-breaking[breaking changes].
1717
=== Unreleased
1818

1919
* rewrite-clj now exports clj-kondo config for its public API https://github.com/clj-commons/rewrite-clj/issues/146[#146]
20+
* Internal rewrite-clj developer facing:
21+
* Switched from babashka scripts to babashka tasks, developer guide updated accordingly
2022

2123
=== v1.0.605-alpha
2224

@@ -362,7 +364,7 @@ If you were using this internal namespace you can opt to switch to, the also int
362364
** `prepend-space` in favour of `insert-space-left`
363365
** `append-newline` in favour of `insert-newline-right`
364366
** `prepend-newline` in favour of `insert-newline-left`
365-
* fix insertion of nodes in the presense of existing whitespace. (see #33, #34 -
367+
* fix insertion of nodes in the presence of existing whitespace. (see #33, #34 -
366368
thanks @eraserhd!)
367369
* `edn` and `edn*` now take a `:track-position?` option that activates a custom
368370
zipper implementation allowing `position` to be called on. (see #41, #45 -

bb.edn

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,27 @@
99
lread/status-line {:git/url "https://github.com/lread/status-line.git"
1010
:sha "35ed39645038e81b42cb15ed6753b8462e60a06d"}}
1111
:tasks {;; setup
12-
:requires ([lread.status-line :as status])
13-
:enter (let [{:keys [name]} (current-task)] (status/line :head "TASK %s" name))
12+
:requires ([clojure.string :as string]
13+
[lread.status-line :as status])
14+
:enter (let [{:keys [name]} (current-task)] (status/line :head "TASK %s %s" name (string/join " " *command-line-args*)))
1415
:leave (let [{:keys [name]} (current-task)] (status/line :detail "\nTASK %s done." name))
1516
;; commands
1617
apply-import-vars {:task apply-import-vars/-main :doc "(check|gen-code) - export APIs statically from templates"}
1718
lint {:task lint/-main :doc "[--rebuild-cache]"}
18-
test-clj {:task clj-tests/-main :doc "[--clojure-version (1.9|1.10)]"}
19-
test-cljs {:task cljs-tests/-main :doc "use --help for args"}
20-
test-shadow-cljs {:task shadow-cljs-test/-main}
21-
test-native {:task pure-native-test/-main :doc "run rewrite-clj and tests after both compiled with GraalVM native-image"}
22-
test-native-sci {:task sci-native-test/-main :doc "interpret rewrite-clj tests via sci from rewrite-clj native image"}
23-
test-jvm-sci {:task sci-jvm-test/-main :doc "JVM only sanity test for test-native-sci"}
24-
test-clj-watch {:task clj-watch/-main :doc "[kaocha args]"}
25-
test-cljs-watch {:task cljs-watch/-main :doc "watch cljs test with fighweel main"}
26-
test-coverage {:task coverage/-main :doc "generate code coverage reports for Clojure tests"}
27-
test-doc {:task doc-tests/-main :doc "test doc code blocks"}
28-
test-libs {:task libs-tests/-main :doc "(list|run|outdated) - verify that libs using rewrite-clj* work with current rewrite-clj"}
19+
test-clj {:task test-clj/-main :doc "[--clojure-version (1.9|1.10)]"}
20+
test-cljs {:task test-cljs/-main :doc "use --help for args"}
21+
test-shadow-cljs {:task test-shadow-cljs/-main}
22+
test-native {:task test-native/-main :doc "run rewrite-clj and tests after both compiled with GraalVM native-image"}
23+
test-native-sci {:task test-native-sci/-main :doc "interpret rewrite-clj tests via sci from rewrite-clj native image"}
24+
test-jvm-sci {:task test-jvm-sci/-main :doc "JVM only sanity test for test-native-sci"}
25+
test-clj-watch {:task test-clj-watch/-main :doc "[kaocha args]"}
26+
test-cljs-watch {:task test-cljs-watch/-main :doc "watch cljs test with fighweel main"}
27+
test-coverage {:task test-coverage/-main :doc "generate code coverage reports for Clojure tests"}
28+
test-doc {:task test-doc/-main :doc "test doc code blocks"}
29+
test-libs {:task test-libs/-main :doc "(list|run|outdated) - verify that libs using rewrite-clj* work with current rewrite-clj"}
2930
outdated {:task outdated/-main :doc "report on outdated Clojure and npm dependencies"}
30-
doc-api-diffs {:task gen-api-diffs/-main :doc "generate diff docs for rewrite-clj* APIs"}
31-
doc-update-readme {:task update-readme/-main :doc "honour our contributors in README"}
31+
doc-api-diffs {:task doc-api-diffs/-main :doc "generate diff docs for rewrite-clj* APIs"}
32+
doc-update-readme {:task doc-update-readme/-main :doc "honour our contributors in README"}
3233
cljdoc-preview {:task cljdoc-preview/-main :doc "preview what docs will look like on cljdoc, use --help for args"}
33-
ci-unit-tests {:task ci-tests/-main}
34-
ci-release {:task release/-main :doc "release tasks, use --help for args"}}}
34+
ci-unit-tests {:task ci-unit-tests/-main}
35+
ci-release {:task ci-release/-main :doc "release tasks, use --help for args"}}}

script/release.clj renamed to script/ci_release.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
;; This script is ultimately run from GitHub Actions
55
;;
66

7-
(ns release
7+
(ns ci-release
88
(:require [clojure.java.io :as io]
99
[clojure.string :as string]
1010
[helper.env :as env]

script/ci_tests.clj renamed to script/ci_unit_tests.clj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bb
22

3-
(ns ci-tests
3+
(ns ci-unit-tests
44
(:require [helper.env :as env]
55
[helper.fs :as fs]
66
[helper.main :as main]
@@ -12,29 +12,29 @@
1212
(fs/delete-file-recursively dir true)))
1313

1414
(defn lint []
15-
(shell/command ["bb" "./script/lint.clj"]))
15+
(shell/command ["bb" "lint"]))
1616

1717
(defn check-import-vars []
18-
(shell/command ["bb" "./script/apply_import_vars.clj" "check"]))
18+
(shell/command ["bb" "apply-import-vars" "check"]))
1919

2020
(defn doc-tests[]
21-
(shell/command ["bb" "./script/doc_tests.clj"]))
21+
(shell/command ["bb" "test-doc"]))
2222

2323
(defn clojure-tests []
2424
(doseq [version ["1.9" "1.10"]]
25-
(shell/command ["bb" "./script/clj_tests.clj" "--clojure-version" version])) )
25+
(shell/command ["bb" "test-clj" "--clojure-version" version])) )
2626

2727
(defn cljs-tests []
2828
(doseq [env ["node" "chrome-headless"]
2929
opt ["none" "advanced"]]
30-
(shell/command ["bb" "./script/cljs_tests.clj" "--env" env "--optimizations" opt])))
30+
(shell/command ["bb" "test-cljs" "--env" env "--optimizations" opt])))
3131

3232
(defn shadow-cljs-tests []
33-
(shell/command ["bb" "./script/shadow_cljs_test.clj"]))
33+
(shell/command ["bb" "test-shadow-cljs"]))
3434

3535
(defn cljs-bootstrap-tests []
3636
(if (some #{(env/get-os)} '(:mac :unix))
37-
(shell/command ["bb" "./script/cljs_tests.clj" "--env" "planck" "--optimizations" "none"])
37+
(shell/command ["bb" "test-cljs" "--env" "planck" "--optimizations" "none"])
3838
(status/line :warn "skipping planck tests, they can only be run on linux and macOS")) )
3939

4040
(defn -main [& args]

script/gen_api_diffs.clj renamed to script/doc_api_diffs.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bb
22

3-
(ns gen-api-diffs
3+
(ns doc-api-diffs
44
(:require [clojure.java.io :as io]
55
[clojure.string :as string]
66
[helper.env :as env]

0 commit comments

Comments
 (0)