Compare commits
2521 commits
uberscript
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8052618fa8 | ||
|
|
238a98d9b2 | ||
|
|
57b799e63d | ||
|
|
dad646ce38 | ||
|
|
35696b7c0b | ||
|
|
00d56900e8 | ||
|
|
1fc8ef6adb | ||
|
|
158b36c645 | ||
|
|
b5c65f46e1 | ||
|
|
7e64ce5dd1 | ||
|
|
73b806dbd2 | ||
|
|
0579d6a0ec | ||
|
|
cfee65101f | ||
|
|
4da643cf63 | ||
|
|
aa15e5212a | ||
|
|
e23a222fdb | ||
|
|
6c0cfde92f | ||
|
|
5f6befc577 | ||
|
|
d7b0f9155d | ||
|
|
28c2f6947f | ||
|
|
5c4fb1ccc1 | ||
|
|
5b7678f309 | ||
|
|
f33c68293b | ||
|
|
fd69206933 | ||
|
|
689148b99c | ||
|
|
3db67a5574 | ||
|
|
8191e09314 | ||
|
|
e784f4ae8a | ||
|
|
774fe99a83 | ||
|
|
f9aafc9d96 | ||
|
|
4037154a28 | ||
|
|
35e904b547 | ||
|
|
08d60112ed | ||
|
|
a9060f0027 | ||
|
|
597f180d32 | ||
|
|
007209c0d2 | ||
|
|
1b2682b67a | ||
|
|
4a2a305e38 | ||
|
|
e3908a1306 | ||
|
|
f967e10bdd | ||
|
|
4c6fe98236 | ||
|
|
28c7c42c2a | ||
|
|
6d5fc67467 | ||
|
|
50fc2e2582 | ||
|
|
a45f76b029 | ||
|
|
9ed0507030 | ||
|
|
f9935def7e | ||
|
|
d053a3c0c5 | ||
|
|
cdcf9deb1c | ||
|
|
6f43c47f2a | ||
|
|
63a51ff669 | ||
|
|
d7c80012b1 | ||
|
|
eddf51529f | ||
|
|
d1dbafc49b | ||
|
|
bc8cd6d358 | ||
|
|
b01ee6d87d | ||
|
|
a43b55bf5c | ||
|
|
4358428464 | ||
|
|
7998e50045 | ||
|
|
8d3806a6e7 | ||
|
|
455728092c | ||
|
|
da3eff0305 | ||
|
|
51b44ba2ed | ||
|
|
3cddc33334 | ||
|
|
d8521888cc | ||
|
|
1a62a619e3 | ||
|
|
ecbdbba8d4 | ||
|
|
e186726fd9 | ||
|
|
2a50af8f68 | ||
|
|
c7a5c6c6bc | ||
|
|
024f1d5515 | ||
|
|
142e9eae06 | ||
|
|
3d909f04b8 | ||
|
|
c9b9ad64fc | ||
|
|
9070db46df | ||
|
|
b16ecfdf6c | ||
|
|
1874da1d2d | ||
|
|
c89ac0bd7f | ||
|
|
def5d8fd37 | ||
|
|
2932d82a65 | ||
|
|
d8d6876832 | ||
|
|
c538d5edbd | ||
|
|
a5ec09087e | ||
|
|
5e4ce8e093 | ||
|
|
c1412f9b31 | ||
|
|
f5d7c1bb6e | ||
|
|
1deae725ae | ||
|
|
42b9ff8f25 | ||
|
|
3442f1e505 | ||
|
|
f0943d8a14 | ||
|
|
dff3b526e9 | ||
|
|
afb566f600 | ||
|
|
3cc45ec8a7 | ||
|
|
d670bbb245 | ||
|
|
62cab79ce6 | ||
|
|
f4292e1038 | ||
|
|
286e03ee24 | ||
|
|
cd362fbf01 | ||
|
|
ccebfa630f | ||
|
|
5ab8b3f975 | ||
|
|
2df2e7661b | ||
|
|
7121253f75 | ||
|
|
e5dde61ba8 | ||
|
|
6a5c13a6f8 | ||
|
|
b981921a00 | ||
|
|
eaf760d62f | ||
|
|
b59bfcb7e6 | ||
|
|
0138990139 | ||
|
|
5acf04dcf1 | ||
|
|
aabd35eeaa | ||
|
|
ec6a6a5cdb | ||
|
|
b19d5f9bff | ||
|
|
5902852ff9 | ||
|
|
24c644d9f0 | ||
|
|
01cb6112f9 | ||
|
|
7ff62d91a2 | ||
|
|
89eed2ed44 | ||
|
|
ed8aa97d34 | ||
|
|
34b5e71465 | ||
|
|
1d5a777b81 | ||
|
|
2519a284f4 | ||
|
|
0f9a0fe622 | ||
|
|
b6f844ba0c | ||
|
|
ab1ee96335 | ||
|
|
a535a5faec | ||
|
|
4715d13f71 | ||
|
|
8b46e030ca | ||
|
|
6ca28c642c | ||
|
|
c3c2c8b108 | ||
|
|
bc1c35790e | ||
|
|
50e8a74321 | ||
|
|
70b3e5c999 | ||
|
|
31a5ec5c71 | ||
|
|
96807375e0 | ||
|
|
c402c01861 | ||
|
|
08a08ef957 | ||
|
|
6a420c9bfd | ||
|
|
030d6ba889 | ||
|
|
15f5918e58 | ||
|
|
0c6f8b6806 | ||
|
|
7128d65de7 | ||
|
|
2bf95f60e7 | ||
|
|
0685424ac3 | ||
|
|
ecb0fa5cac | ||
|
|
e0a303c484 | ||
|
|
5bc1df73af | ||
|
|
ca26b22bf9 | ||
|
|
aa566ed15c | ||
|
|
2492e71dcc | ||
|
|
bbf9933941 | ||
|
|
ea660e956f | ||
|
|
bc413b654b | ||
|
|
a415139b3b | ||
|
|
0147195e8c | ||
|
|
d226fe785a | ||
|
|
2bb865917a | ||
|
|
16eebb60a3 | ||
|
|
da9fcbf10d | ||
|
|
cdfc664682 | ||
|
|
93e398f288 | ||
|
|
880b4ebe3f | ||
|
|
366cbed689 | ||
|
|
d17a5342d2 | ||
|
|
1372b3d8a0 | ||
|
|
b144c81fbb | ||
|
|
0527f6a372 | ||
|
|
e258358170 | ||
|
|
58def24712 | ||
|
|
f335fe51ff | ||
|
|
83918c4b80 | ||
|
|
2da875c8f9 | ||
|
|
7abd0000c7 | ||
|
|
19804e4bc7 | ||
|
|
af3ae5fa79 | ||
|
|
bf183a33a8 | ||
|
|
616de196f8 | ||
|
|
c3c0bf3cef | ||
|
|
ea2c3f06ec | ||
|
|
3068428578 | ||
|
|
702fdf8108 | ||
|
|
7e8e51b882 | ||
|
|
976d0fcb6d | ||
|
|
c60d139dbf | ||
|
|
116ee1191c | ||
|
|
035a8268ba | ||
|
|
5cd2b9d6e6 | ||
|
|
82291325de | ||
|
|
fa0be7ecbf | ||
|
|
6d4737ce77 | ||
|
|
da44bd4940 | ||
|
|
b47a5cc21d | ||
|
|
ba35032253 | ||
|
|
11610d6ebe | ||
|
|
37849d72ad | ||
|
|
375c9d3550 | ||
|
|
d7499210ec | ||
|
|
3d671ffcb6 | ||
|
|
4d1984410b | ||
|
|
0d4096dcd1 | ||
|
|
1e4236e22d | ||
|
|
717084a71d | ||
|
|
3608c6ab81 | ||
|
|
67d8e04db5 | ||
|
|
71c5e7c45b | ||
|
|
3cca11f8d1 | ||
|
|
655760d2a9 | ||
|
|
7b84a9d256 | ||
|
|
1a454b10bb | ||
|
|
81819deb0a | ||
|
|
8a0f66f3c1 | ||
|
|
b53e265af3 | ||
|
|
7530e6a57f | ||
|
|
2ee8185269 | ||
|
|
ff59956602 | ||
|
|
a176584eda | ||
|
|
43d9816bd6 | ||
|
|
e1a12037cd | ||
|
|
86ac0c2431 | ||
|
|
67ae82ee18 | ||
|
|
d8e0c6b476 | ||
|
|
12c89f79c6 | ||
|
|
67dc3af22d | ||
|
|
1f0f932c5e | ||
|
|
fa579b74df | ||
|
|
e7d964bb0a | ||
|
|
771f69d922 | ||
|
|
3e4c5861e7 | ||
|
|
68e8ac6e10 | ||
|
|
32078f8259 | ||
|
|
c9a63af40f | ||
|
|
87f9f6f206 | ||
|
|
df477adbb0 | ||
|
|
35e17bd46a | ||
|
|
9da2afc4b5 | ||
|
|
f24c75a054 | ||
|
|
30534691ba | ||
|
|
6dc3110b3c | ||
|
|
ecbbd7ab84 | ||
|
|
4ae9d27171 | ||
|
|
86ec03e2f4 | ||
|
|
39a9ed69d6 | ||
|
|
9653435460 | ||
|
|
d467bf53c8 | ||
|
|
6bfb2374b8 | ||
|
|
fe940c73c9 | ||
|
|
ea2c439369 | ||
|
|
c48d2f7a90 | ||
|
|
b337e032b6 | ||
|
|
2166c42de2 | ||
|
|
d85c86af2c | ||
|
|
5b471cb5e2 | ||
|
|
629c338b14 | ||
|
|
ab28e4c465 | ||
|
|
54ea4b460d | ||
|
|
bf7f42ce73 | ||
|
|
53d16eb9a0 | ||
|
|
eb69baeaa7 | ||
|
|
6052b9ba35 | ||
|
|
4a1b26a6be | ||
|
|
28f9879e40 | ||
|
|
0e1694f586 | ||
|
|
2ee7a0d12e | ||
|
|
4af5f1fd61 | ||
|
|
fc19382b5e | ||
|
|
9e1452867e | ||
|
|
2a432d3e80 | ||
|
|
1dbffac334 | ||
|
|
aa654a9ead | ||
|
|
9ded5fea0d | ||
|
|
6353ab9de9 | ||
|
|
ce403671be | ||
|
|
cedbff7696 | ||
|
|
15cff2eb7b | ||
|
|
2e23471612 | ||
|
|
6b52831a21 | ||
|
|
fdd2d68e1d | ||
|
|
838608647a | ||
|
|
e746593f14 | ||
|
|
3735135c05 | ||
|
|
7ebe96773d | ||
|
|
2fcf9c682a | ||
|
|
36e9732549 | ||
|
|
a5e4dfe663 | ||
|
|
9da7af58b3 | ||
|
|
f1084c1f36 | ||
|
|
e0598470be | ||
|
|
d854de883e | ||
|
|
80a8097a63 | ||
|
|
5bb98159be | ||
|
|
69b83c3678 | ||
|
|
857ecc3111 | ||
|
|
dbc766f58a | ||
|
|
79a133ee13 | ||
|
|
7ecd2fe59e | ||
|
|
0b892ad8e5 | ||
|
|
66b29b9061 | ||
|
|
1dff46699a | ||
|
|
ae01170f92 | ||
|
|
996c96761e | ||
|
|
ef5d2fdf3a | ||
|
|
9ae36491b7 | ||
|
|
d1580f1a72 | ||
|
|
8788a3c482 | ||
|
|
5cab060bbb | ||
|
|
d984eda226 | ||
|
|
c8324ac887 | ||
|
|
e938a58e06 | ||
|
|
c04b83811c | ||
|
|
6c1a66e853 | ||
|
|
ef50677275 | ||
|
|
8a8c2dcb46 | ||
|
|
7c5a2775df | ||
|
|
0b61f4d3ab | ||
|
|
e14af7b629 | ||
|
|
bc5e6b6d52 | ||
|
|
c2c7053120 | ||
|
|
6467316dc8 | ||
|
|
ad4935077d | ||
|
|
ad6cd5989f | ||
|
|
b1d2dc599b | ||
|
|
af507b2894 | ||
|
|
c91ccc7b93 | ||
|
|
2eed1b810b | ||
|
|
ce9a0f71e5 | ||
|
|
0d20cdf696 | ||
|
|
6bee6b6a89 | ||
|
|
dac6dcd6d5 | ||
|
|
d8c41351f5 | ||
|
|
c1b82db587 | ||
|
|
26c6c5ce18 | ||
|
|
3ded3b9546 | ||
|
|
10c315663f | ||
|
|
5f82d40fe6 | ||
|
|
81d260e473 | ||
|
|
1881a75a1d | ||
|
|
f470dba671 | ||
|
|
09bbd9eb34 | ||
|
|
7dc6b713d0 | ||
|
|
42d9d77e76 | ||
|
|
df5b115aab | ||
|
|
2ee0df4909 | ||
|
|
ea4ebab807 | ||
|
|
666ce9adc9 | ||
|
|
601e6e82cd | ||
|
|
6e088272b7 | ||
|
|
2353827e43 | ||
|
|
a8e7d35dfa | ||
|
|
b6e8f86595 | ||
|
|
3370d7a063 | ||
|
|
d1e36be9d9 | ||
|
|
83c02cb58b | ||
|
|
4c7bbeeb3b | ||
|
|
560369e294 | ||
|
|
94c5141a3e | ||
|
|
b749563003 | ||
|
|
af0937f060 | ||
|
|
85ecdab0a5 | ||
|
|
3b251c1b38 | ||
|
|
657adff336 | ||
|
|
a2f70d8324 | ||
|
|
fb3fa03074 | ||
|
|
de06c199f1 | ||
|
|
85eef7d6f7 | ||
|
|
bf306bb407 | ||
|
|
056254dc9d | ||
|
|
e3228fe358 | ||
|
|
1010b7f114 | ||
|
|
bef5ccf229 | ||
|
|
6760a2b844 | ||
|
|
fa10070013 | ||
|
|
fb3e04cffe | ||
|
|
7b7feb7034 | ||
|
|
c3cf8f5330 | ||
|
|
caf05979c3 | ||
|
|
9356653a09 | ||
|
|
aa7fb0c62a | ||
|
|
45ff85e1a0 | ||
|
|
9ff8003c1b | ||
|
|
b46fc49a5d | ||
|
|
9edce22ea7 | ||
|
|
56f5378702 | ||
|
|
a2398705bf | ||
|
|
c74d9a6f0a | ||
|
|
d27287b837 | ||
|
|
d677a2b65a | ||
|
|
efb947ec03 | ||
|
|
a8c9526be1 | ||
|
|
0d1ffd0c9f | ||
|
|
bfcec721c9 | ||
|
|
3ade21918f | ||
|
|
ddfc93d7e5 | ||
|
|
b44167e5c0 | ||
|
|
8a0fe19ab3 | ||
|
|
a3eb37e4a6 | ||
|
|
44465990a8 | ||
|
|
236768cada | ||
|
|
0f85b02a82 | ||
|
|
b1a5f4e8df | ||
|
|
0e47d7f7a6 | ||
|
|
41e5e0c484 | ||
|
|
fe989f7233 | ||
|
|
7f8ec567e6 | ||
|
|
342cedbcfa | ||
|
|
b22092a318 | ||
|
|
3da2c9f75f | ||
|
|
2e3bd2d3f0 | ||
|
|
555c11eca2 | ||
|
|
32a18191dc | ||
|
|
dcb0b45405 | ||
|
|
e84eb29fa1 | ||
|
|
1c425796ae | ||
|
|
4e8d907369 | ||
|
|
f4bc802880 | ||
|
|
c13500cddb | ||
|
|
98aa6b996e | ||
|
|
f2e955cc0b | ||
|
|
5c4eedb12b | ||
|
|
c536d524f8 | ||
|
|
ea57060963 | ||
|
|
430a466a25 | ||
|
|
d27efb137d | ||
|
|
0063196074 | ||
|
|
4db3de5987 | ||
|
|
cd70809b1b | ||
|
|
2b24a84c11 | ||
|
|
7d5cdadbcb | ||
|
|
325e043440 | ||
|
|
4dcc159ed7 | ||
|
|
a9be9d02ea | ||
|
|
d2fece3f80 | ||
|
|
39e4ea71e9 | ||
|
|
4cbdb57ad1 | ||
|
|
2e0bbfb260 | ||
|
|
c1726c3b98 | ||
|
|
0951328270 | ||
|
|
1de5c553ea | ||
|
|
cd4987b005 | ||
|
|
340d24fb07 | ||
|
|
abc102f0b8 | ||
|
|
3f99274978 | ||
|
|
26967df643 | ||
|
|
1644c94fda | ||
|
|
63102eca86 | ||
|
|
f7907be86e | ||
|
|
19bfd172fc | ||
|
|
a945ea8146 | ||
|
|
fcb0b4a1a7 | ||
|
|
6eea167cfe | ||
|
|
307ed36f9c | ||
|
|
99655aa224 | ||
|
|
b7ee49ab8d | ||
|
|
37b5d1d6a3 | ||
|
|
1a54f03ce3 | ||
|
|
9365a24eed | ||
|
|
0b5a281d46 | ||
|
|
c89a396bbd | ||
|
|
905f6365d4 | ||
|
|
c1788da654 | ||
|
|
d3f7a52f65 | ||
|
|
c85e86cb7e | ||
|
|
b4365826ba | ||
|
|
e68eb7a998 | ||
|
|
18b2d54d33 | ||
|
|
43e7b4af0b | ||
|
|
57ebb524b0 | ||
|
|
6ccdfae7bb | ||
|
|
fa34ebfdef | ||
|
|
a66a2f74f5 | ||
|
|
6850caed6e | ||
|
|
29150e6bd3 | ||
|
|
4a45624acd | ||
|
|
cce0a3d378 | ||
|
|
26780fffe5 | ||
|
|
1bc4782d42 | ||
|
|
2c6485b876 | ||
|
|
4fc1d9a815 | ||
|
|
e7521110c9 | ||
|
|
e2f2e9ae4e | ||
|
|
0927a48c50 | ||
|
|
69373fb445 | ||
|
|
7aba75564e | ||
|
|
4438f3bbcf | ||
|
|
1bb7ebe3dc | ||
|
|
9545d23cc4 | ||
|
|
e74e7ed2ca | ||
|
|
5ad161a059 | ||
|
|
68878e7f89 | ||
|
|
84bd66f869 | ||
|
|
5516151132 | ||
|
|
4e52f0d34c | ||
|
|
4a38fdbd07 | ||
|
|
a8d3923262 | ||
|
|
8d8d3a1057 | ||
|
|
d4c4e53c86 | ||
|
|
52a7c205a3 | ||
|
|
9e004edefe | ||
|
|
b8a0520b93 | ||
|
|
1022068624 | ||
|
|
8df7f7c3fe | ||
|
|
f5e2fe0f61 | ||
|
|
abdd068149 | ||
|
|
99ec77afeb | ||
|
|
eba9d0d642 | ||
|
|
9520c5b240 | ||
|
|
9b21986f05 | ||
|
|
076a2774be | ||
|
|
3f4ac12cc4 | ||
|
|
b2d422cacb | ||
|
|
5dc7763325 | ||
|
|
3045cd226e | ||
|
|
187ee7da00 | ||
|
|
cd9a87e75c | ||
|
|
3ad043769c | ||
|
|
332c7c6ac8 | ||
|
|
711bb40480 | ||
|
|
be426ee56d | ||
|
|
9118c43da3 | ||
|
|
c5c8086dfe | ||
|
|
734ca577f6 | ||
|
|
bf3623b596 | ||
|
|
b2f534517c | ||
|
|
ead237eee3 | ||
|
|
30a15e16ae | ||
|
|
42fd5d851f | ||
|
|
6d1f295f47 | ||
|
|
a1858774b6 | ||
|
|
ab0c5bb058 | ||
|
|
920babb56b | ||
|
|
cc0338a1e9 | ||
|
|
a4e791e6ad | ||
|
|
02d300ee3d | ||
|
|
a6d8d0179c | ||
|
|
9441dabf81 | ||
|
|
842c7a0589 | ||
|
|
a19d05b8da | ||
|
|
ca1e2d7769 | ||
|
|
72dbf53df7 | ||
|
|
76e779d0d3 | ||
|
|
bbd1940844 | ||
|
|
0dab6f5f3d | ||
|
|
5a1b6a9f79 | ||
|
|
722812bd61 | ||
|
|
2b575b1ea6 | ||
|
|
e9e906e09f | ||
|
|
d8f50879c8 | ||
|
|
28f72ff4a2 | ||
|
|
32864476e5 | ||
|
|
63abc75cf5 | ||
|
|
b2855d1212 | ||
|
|
bd5597a3cb | ||
|
|
a79c33d7bf | ||
|
|
1452f45cfb | ||
|
|
64dcb3335d | ||
|
|
c053765731 | ||
|
|
314906cb0d | ||
|
|
4220902927 | ||
|
|
4931048284 | ||
|
|
2da873a2c1 | ||
|
|
17adc69abc | ||
|
|
a464b59bc2 | ||
|
|
7c2e8a155f | ||
|
|
fa9103807d | ||
|
|
3610f52c47 | ||
|
|
68d041c892 | ||
|
|
02cdb00e8d | ||
|
|
7f44c272b8 | ||
|
|
5140bd4249 | ||
|
|
0be3c71772 | ||
|
|
77878631e9 | ||
|
|
28ec2c690a | ||
|
|
fe6042a06f | ||
|
|
6feb785cb0 | ||
|
|
eca7847ed9 | ||
|
|
430cbedbe4 | ||
|
|
a5318ea289 | ||
|
|
91413c2803 | ||
|
|
7844039861 | ||
|
|
61851a511f | ||
|
|
09debe0f1d | ||
|
|
71d0a14c26 | ||
|
|
5b42de70d8 | ||
|
|
79a9bc531a | ||
|
|
6b6d403d5e | ||
|
|
843ca4c2d3 | ||
|
|
e43edd8627 | ||
|
|
b2b20e15c1 | ||
|
|
004e99eaa3 | ||
|
|
4d1c05b23d | ||
|
|
6f41179849 | ||
|
|
1810b4bd97 | ||
|
|
e3aa11baa8 | ||
|
|
9b5ec623e4 | ||
|
|
0b4bfdc3ab | ||
|
|
96e70ff7e3 | ||
|
|
eb4e583c97 | ||
|
|
47df0c47a1 | ||
|
|
7de2262585 | ||
|
|
27fad0ac36 | ||
|
|
5b7213822c | ||
|
|
8fa49b940d | ||
|
|
6c1f5f7a4d | ||
|
|
2a943086a6 | ||
|
|
9e1ea1071d | ||
|
|
a0a34dc5d8 | ||
|
|
b9308eddcc | ||
|
|
3aca505790 | ||
|
|
5965e32d26 | ||
|
|
e9b87b0185 | ||
|
|
91b3a962b4 | ||
|
|
d9358f0706 | ||
|
|
8e64ef9df8 | ||
|
|
2ac1428341 | ||
|
|
efe4f214cc | ||
|
|
bdbe5a4548 | ||
|
|
34136173d5 | ||
|
|
1e06b07d0f | ||
|
|
188949d7eb | ||
|
|
073e7e3ce0 | ||
|
|
39c1390085 | ||
|
|
dd77a85893 | ||
|
|
4223f1432d | ||
|
|
68a6e24516 | ||
|
|
8b39f67700 | ||
|
|
61950b87e2 | ||
|
|
df24d04f73 | ||
|
|
01eea0babb | ||
|
|
935c8da535 | ||
|
|
62916fa292 | ||
|
|
d9aad85476 | ||
|
|
37e2da9f5b | ||
|
|
2535299be8 | ||
|
|
965c177bca | ||
|
|
dc2502ebae | ||
|
|
df24cf287d | ||
|
|
72377d090f | ||
|
|
5570c416e9 | ||
|
|
e619a896a1 | ||
|
|
38dc526680 | ||
|
|
44dbc57cda | ||
|
|
b9fa877cd7 | ||
|
|
f9131b2979 | ||
|
|
ba328f2387 | ||
|
|
d721b925f4 | ||
|
|
c7ccc6fedb | ||
|
|
58dbd2b6aa | ||
|
|
f7b235635a | ||
|
|
7d5083ac0a | ||
|
|
683752c602 | ||
|
|
5ac048157a | ||
|
|
9dff25d36b | ||
|
|
c931fbe294 | ||
|
|
46b6dfd3c3 | ||
|
|
3bdeee8bee | ||
|
|
531b9383f2 | ||
|
|
facb65734e | ||
|
|
419b71e7c6 | ||
|
|
7cc94ea6a1 | ||
|
|
69db7105e5 | ||
|
|
cd3252796e | ||
|
|
6acd912a34 | ||
|
|
cf01d7f24d | ||
|
|
bd857ae3e1 | ||
|
|
43375d49a2 | ||
|
|
9087cf6311 | ||
|
|
c81babad9a | ||
|
|
952a695234 | ||
|
|
a92ebfe68a | ||
|
|
d681f9bc7f | ||
|
|
9305417edc | ||
|
|
7b6a69f2b3 | ||
|
|
eb740c7c9b | ||
|
|
d53d05c856 | ||
|
|
2a56f2e5ef | ||
|
|
ade5ca1ba7 | ||
|
|
bc0b59500b | ||
|
|
cf0f145d10 | ||
|
|
198722ab7c | ||
|
|
6e00354053 | ||
|
|
cb72f8ba17 | ||
|
|
7d3d38fee1 | ||
|
|
03e50cb17e | ||
|
|
0671678b60 | ||
|
|
434ee39ad9 | ||
|
|
c67441226a | ||
|
|
6f8f205609 | ||
|
|
0df40a1a9a | ||
|
|
4504976191 | ||
|
|
eb6745fa86 | ||
|
|
058d2071b2 | ||
|
|
99f1e948d3 | ||
|
|
40e0087b59 | ||
|
|
b458d79b29 | ||
|
|
495ded8a50 | ||
|
|
326b1def6b | ||
|
|
b7e327c690 | ||
|
|
759d977879 | ||
|
|
b57981bcd5 | ||
|
|
3751749ca3 | ||
|
|
7a22c5fa5a | ||
|
|
e08eab080e | ||
|
|
0ac4eea9ee | ||
|
|
885a82b736 | ||
|
|
d222b32d70 | ||
|
|
8d514cc982 | ||
|
|
65d77d3555 | ||
|
|
66e90be6a7 | ||
|
|
85bb1fec76 | ||
|
|
fc15eab795 | ||
|
|
d8a0018213 | ||
|
|
4c3fa4c406 | ||
|
|
bf55d65f14 | ||
|
|
4c1da7d242 | ||
|
|
a24c8fa197 | ||
|
|
6e2eaa9e87 | ||
|
|
9ed3cb6a31 | ||
|
|
8269a632c0 | ||
|
|
bc901fdcf0 | ||
|
|
a5dec07279 | ||
|
|
ac1b16bfc8 | ||
|
|
bb84bd357e | ||
|
|
e5ee1f4a77 | ||
|
|
5be61476d8 | ||
|
|
ee5f2a7a2e | ||
|
|
36d2ec2d87 | ||
|
|
8d9ac4c4d1 | ||
|
|
3d916df4a0 | ||
|
|
70d9bbd10e | ||
|
|
07030d8f89 | ||
|
|
9083959a5d | ||
|
|
4483ccf20b | ||
|
|
ce064291f3 | ||
|
|
e31cb57a3d | ||
|
|
ccc1512bb6 | ||
|
|
8b146525f2 | ||
|
|
c89300b3b5 | ||
|
|
42d721a92f | ||
|
|
98741c9db7 | ||
|
|
ee85685334 | ||
|
|
a4ba9527b9 | ||
|
|
a035291f41 | ||
|
|
f5a226ab34 | ||
|
|
10ec7dcf1a | ||
|
|
fc5dccc9ef | ||
|
|
9de689c623 | ||
|
|
eaf0a068f3 | ||
|
|
bca3f28e28 | ||
|
|
b452c1d94a | ||
|
|
cf93651e8e | ||
|
|
1cf8321960 | ||
|
|
a141998f55 | ||
|
|
5566a7869f | ||
|
|
17c9003e2a | ||
|
|
16ea1e8f95 | ||
|
|
1ead74a501 | ||
|
|
e3b55b5f47 | ||
|
|
a61c2721d7 | ||
|
|
74c26084e3 | ||
|
|
b409d663ff | ||
|
|
9cd1f71b76 | ||
|
|
81e837006e | ||
|
|
5cdeb09a17 | ||
|
|
0e57b9d461 | ||
|
|
351723fdb6 | ||
|
|
b6f19b03dc | ||
|
|
94aab46855 | ||
|
|
b6dffe3f87 | ||
|
|
bfe59b57d0 | ||
|
|
e283a87b4c | ||
|
|
9ca24ffce4 | ||
|
|
1e9cc9f203 | ||
|
|
7c15b04fa2 | ||
|
|
33bee0480d | ||
|
|
ed22bb573b | ||
|
|
682f8514fb | ||
|
|
c2b3fea9fc | ||
|
|
471ed01cae | ||
|
|
9241c81238 | ||
|
|
863c6051bd | ||
|
|
5bb2d2f8bd | ||
|
|
87e9e0861c | ||
|
|
2dac7847a8 | ||
|
|
851e1f5eb0 | ||
|
|
ec842c942d | ||
|
|
77768cec67 | ||
|
|
9fba927ec8 | ||
|
|
7e77ab5633 | ||
|
|
2b3e7df2e9 | ||
|
|
80a8ee1b7e | ||
|
|
465ea247eb | ||
|
|
c94960eac1 | ||
|
|
c081367304 | ||
|
|
8170fd7675 | ||
|
|
0684119000 | ||
|
|
8352448611 | ||
|
|
8fdefb99b9 | ||
|
|
e6f6b02c06 | ||
|
|
7baa0542ec | ||
|
|
4b1e02c6c7 | ||
|
|
9e8571cd08 | ||
|
|
89e8dfdf32 | ||
|
|
e2a8f03d21 | ||
|
|
020d42a94f | ||
|
|
eed298f4a4 | ||
|
|
0c87ed2312 | ||
|
|
78cbdd1d82 | ||
|
|
42ebb92c5d | ||
|
|
7b563dd802 | ||
|
|
2ff0304821 | ||
|
|
2ffbef09d8 | ||
|
|
525f73f822 | ||
|
|
fd3f4a100a | ||
|
|
a9f0483869 | ||
|
|
3110dde2ab | ||
|
|
848683f82d | ||
|
|
d2c8696039 | ||
|
|
92a8042f97 | ||
|
|
c3f61bdc34 | ||
|
|
3b5dbb7c66 | ||
|
|
aa0da8f503 | ||
|
|
00dee39196 | ||
|
|
06d6e97927 | ||
|
|
3bc5bcab5b | ||
|
|
3b9163cde9 | ||
|
|
621130960b | ||
|
|
739f05cc5e | ||
|
|
b84ecd5da7 | ||
|
|
2f146bd712 | ||
|
|
4926aaf85f | ||
|
|
d0d36a2bc4 | ||
|
|
1a700f6a69 | ||
|
|
1631349fb6 | ||
|
|
9566a7d1f1 | ||
|
|
03b1bfa80f | ||
|
|
e1094e1529 | ||
|
|
267646fbe7 | ||
|
|
ea4f56886d | ||
|
|
c4c76d58ac | ||
|
|
e3e855f7ae | ||
|
|
55ffa95b7d | ||
|
|
a592104bc5 | ||
|
|
ef84df8bc9 | ||
|
|
57a6249dcb | ||
|
|
42f79d0db3 | ||
|
|
8afd672a20 | ||
|
|
c97fb958dc | ||
|
|
dcae949496 | ||
|
|
d91eadbc9c | ||
|
|
086a5eb5a2 | ||
|
|
2400fc7be0 | ||
|
|
1197f4feec | ||
|
|
f116b493be | ||
|
|
ea36bbecb9 | ||
|
|
cd54d2a911 | ||
|
|
3e2738201c | ||
|
|
18e19934d1 | ||
|
|
ef41365656 | ||
|
|
3afd85ccb3 | ||
|
|
cae237e42a | ||
|
|
2ca3b2ecc5 | ||
|
|
bebd20c088 | ||
|
|
d15d38df8a | ||
|
|
fc3f178c7e | ||
|
|
8ef3bb08a8 | ||
|
|
75994d5134 | ||
|
|
38feb35a53 | ||
|
|
1200d5625c | ||
|
|
191c6b75a8 | ||
|
|
e285d970c7 | ||
|
|
52c60e7928 | ||
|
|
ccfa50b2bc | ||
|
|
d5c76f774e | ||
|
|
4a42ba938f | ||
|
|
6cdc002423 | ||
|
|
9b2435557d | ||
|
|
6e92c99f31 | ||
|
|
c77944fad7 | ||
|
|
813c6029c5 | ||
|
|
4dc084502a | ||
|
|
2150cb1e06 | ||
|
|
57b88f2141 | ||
|
|
6035a46b3a | ||
|
|
464a000b1b | ||
|
|
d27fc0d2d6 | ||
|
|
b5a17b3af7 | ||
|
|
1eaa094e9b | ||
|
|
306d97f4ef | ||
|
|
33569df040 | ||
|
|
72864a18d6 | ||
|
|
a7a84e872e | ||
|
|
5823a08d51 | ||
|
|
1b3c90870d | ||
|
|
55ff3bcf98 | ||
|
|
b4b0ee87fe | ||
|
|
42f9440d85 | ||
|
|
a201788087 | ||
|
|
f9327c04ca | ||
|
|
ddee3847bf | ||
|
|
765a9c0846 | ||
|
|
4aa352c94a | ||
|
|
b0de4a79a4 | ||
|
|
de43917140 | ||
|
|
c4f2d45f08 | ||
|
|
2c3b1095c8 | ||
|
|
0cdb897f4f | ||
|
|
c97b08425a | ||
|
|
0608c71687 | ||
|
|
2a01f8720e | ||
|
|
774b2d5d3d | ||
|
|
1bd2c18d5e | ||
|
|
245a5bfaad | ||
|
|
dc30728f68 | ||
|
|
e8ca180529 | ||
|
|
05d105716a | ||
|
|
781cc929dd | ||
|
|
8d24f70d73 | ||
|
|
1b3adaaf64 | ||
|
|
dc5b36bbe6 | ||
|
|
5c03eef36b | ||
|
|
e58fe9db1b | ||
|
|
9e57cb4430 | ||
|
|
5c246ccccb | ||
|
|
cde09afa10 | ||
|
|
9c92500297 | ||
|
|
19f58fca83 | ||
|
|
55ba655fab | ||
|
|
4a76fd050d | ||
|
|
30dcb2ad86 | ||
|
|
8aba3ffc2d | ||
|
|
bf06830353 | ||
|
|
536f39d435 | ||
|
|
ac9b249cc8 | ||
|
|
8f447cf43b | ||
|
|
3cf09e12fa | ||
|
|
dca1d2693c | ||
|
|
0ab0cb2410 | ||
|
|
e1544f3d65 | ||
|
|
4e2ef2f152 | ||
|
|
e20ba643ff | ||
|
|
22763c6485 | ||
|
|
00ea105d4a | ||
|
|
3dfcc74324 | ||
|
|
d18ecbd22f | ||
|
|
38185d5658 | ||
|
|
21fd8e3a3f | ||
|
|
cdbe07ad45 | ||
|
|
32ac3c5398 | ||
|
|
e7c504b331 | ||
|
|
7b10adc69a | ||
|
|
4aa6cfc472 | ||
|
|
90add0e787 | ||
|
|
1a48bdf4bc | ||
|
|
16e427848d | ||
|
|
01e414c4d1 | ||
|
|
f044ba15cd | ||
|
|
f8b0a00a17 | ||
|
|
53aa17dbde | ||
|
|
abc15c4959 | ||
|
|
0751e39eac | ||
|
|
833318edb2 | ||
|
|
9cbdc8f767 | ||
|
|
0c9ddadd90 | ||
|
|
2688156b78 | ||
|
|
3f404746b4 | ||
|
|
f491d02ba0 | ||
|
|
3564cac6b3 | ||
|
|
04f16e220c | ||
|
|
e651de400a | ||
|
|
aec2848e24 | ||
|
|
72e9b6ceee | ||
|
|
6259797f6a | ||
|
|
0b471636e1 | ||
|
|
512dbf9ea5 | ||
|
|
b5dea3563d | ||
|
|
381b9f0a4f | ||
|
|
7769675648 | ||
|
|
573db8ea79 | ||
|
|
9ed705f8db | ||
|
|
0a55554bb8 | ||
|
|
cc2c682e79 | ||
|
|
56d2c2b7d5 | ||
|
|
14b177ad21 | ||
|
|
39f057b3ae | ||
|
|
115f89ac81 | ||
|
|
34bd4edf1e | ||
|
|
ebdbd9ea00 | ||
|
|
e979765275 | ||
|
|
60da44512e | ||
|
|
e290c3c2e0 | ||
|
|
ba0ce4ca23 | ||
|
|
30ebdfb6e0 | ||
|
|
ecdf952b23 | ||
|
|
ed0875b52b | ||
|
|
3c7468b6de | ||
|
|
c0d4127b57 | ||
|
|
f0a9e2b88c | ||
|
|
1669983cb2 | ||
|
|
05223adf7e | ||
|
|
9698ddae61 | ||
|
|
83c4ccff2c | ||
|
|
826b955543 | ||
|
|
47ceae0ba0 | ||
|
|
201370275e | ||
|
|
8e3f22db7a | ||
|
|
5ec6fca29a | ||
|
|
35b8204704 | ||
|
|
40fdb19c95 | ||
|
|
94034063db | ||
|
|
b8a3d2447c | ||
|
|
162ca90287 | ||
|
|
a858269c74 | ||
|
|
6442487110 | ||
|
|
cfdb4f69e6 | ||
|
|
17c047418e | ||
|
|
92b4dc7620 | ||
|
|
cb4cbb6691 | ||
|
|
d81e58cf43 | ||
|
|
818ea38a82 | ||
|
|
09284932e4 | ||
|
|
8b3698063f | ||
|
|
d547fbf31a | ||
|
|
f1019384b1 | ||
|
|
9f6ffcf11c | ||
|
|
20e6b447b2 | ||
|
|
0f8458fd03 | ||
|
|
7bf2ca0e57 | ||
|
|
6089496d9c | ||
|
|
8a25716ef4 | ||
|
|
55f96e69fe | ||
|
|
b288abc542 | ||
|
|
77b75fe0b9 | ||
|
|
eea1cdadee | ||
|
|
ab503951da | ||
|
|
27189657a8 | ||
|
|
9b611a42fe | ||
|
|
0d88606c9d | ||
|
|
7b729c5f4b | ||
|
|
1794fe9dd4 | ||
|
|
a977f04181 | ||
|
|
2c79e9dd30 | ||
|
|
f9ca314c31 | ||
|
|
861066082f | ||
|
|
6cf1a3ff6a | ||
|
|
063a0b01c6 | ||
|
|
3b94b51780 | ||
|
|
c1539fe3b0 | ||
|
|
f8657cd59f | ||
|
|
8506c30507 | ||
|
|
96d93d3940 | ||
|
|
5d47397ffc | ||
|
|
d9ff456e60 | ||
|
|
6960bc5d24 | ||
|
|
73306079ec | ||
|
|
fe88348bf8 | ||
|
|
4a13965a6d | ||
|
|
5b455cd51b | ||
|
|
eee3b55f56 | ||
|
|
729de81537 | ||
|
|
6941a5c2ff | ||
|
|
48501c6f52 | ||
|
|
4ff35902f3 | ||
|
|
3eee5870ca | ||
|
|
f1fcf24822 | ||
|
|
786019ef2a | ||
|
|
61ad485ce0 | ||
|
|
9e5bdc4b0f | ||
|
|
200a01fe85 | ||
|
|
1e8ec5285a | ||
|
|
20e8171869 | ||
|
|
b4dfb91fd3 | ||
|
|
8338afb066 | ||
|
|
45df5bcc8f | ||
|
|
c34109d828 | ||
|
|
41dcc9239a | ||
|
|
e65f86a39d | ||
|
|
7f0fd86d8b | ||
|
|
fbc5b69ab1 | ||
|
|
22e56ce779 | ||
|
|
085fffd95b | ||
|
|
226d5c5976 | ||
|
|
b93198c965 | ||
|
|
1ef90f98ef | ||
|
|
fc7df082b7 | ||
|
|
c83786593a | ||
|
|
9727cabaf3 | ||
|
|
24f124d955 | ||
|
|
b92af69d1d | ||
|
|
1113037b51 | ||
|
|
1f7dba35c9 | ||
|
|
8bdb2a21da | ||
|
|
4bfe0eec89 | ||
|
|
e3a6dbacb3 | ||
|
|
1ee298a411 | ||
|
|
917713f24f | ||
|
|
d7f180cdbe | ||
|
|
d830e8f576 | ||
|
|
ae7792634f | ||
|
|
1c03d74235 | ||
|
|
23a97233ad | ||
|
|
83963116b0 | ||
|
|
b5a4e0a170 | ||
|
|
d8db9eee63 | ||
|
|
52448f7597 | ||
|
|
3d0befb52b | ||
|
|
60a3e86449 | ||
|
|
f3526d80a4 | ||
|
|
6eff4cc738 | ||
|
|
211757d5a4 | ||
|
|
d2278835f1 | ||
|
|
60df83b629 | ||
|
|
d4b9f5ed10 | ||
|
|
9b19642039 | ||
|
|
3b9cd12931 | ||
|
|
b102a4ae0e | ||
|
|
db9a8ff10c | ||
|
|
f1db01aede | ||
|
|
4886fe48ae | ||
|
|
5959ba99ec | ||
|
|
f1adb99eff | ||
|
|
fabb945f8c | ||
|
|
7f7b66aeaf | ||
|
|
76a57500af | ||
|
|
1063868554 | ||
|
|
f09e085c75 | ||
|
|
e81ef4aac0 | ||
|
|
7af93adf15 | ||
|
|
ea4c4eae77 | ||
|
|
963bd7957a | ||
|
|
1cf914ad1c | ||
|
|
ff54332977 | ||
|
|
4d24cdca2a | ||
|
|
bee5a88d16 | ||
|
|
a4a8ce5306 | ||
|
|
bffc4bf00c | ||
|
|
bef6d99740 | ||
|
|
c7428da216 | ||
|
|
b29a419bd0 | ||
|
|
3bb54ee5e0 | ||
|
|
d786a5a9b2 | ||
|
|
6c568d62d4 | ||
|
|
c0007e55c4 | ||
|
|
ba582d14a2 | ||
|
|
cd013227d5 | ||
|
|
81a1fd4c86 | ||
|
|
72ae663842 | ||
|
|
586b2234aa | ||
|
|
41703971b1 | ||
|
|
450bddef20 | ||
|
|
1ad93077c1 | ||
|
|
c3cae22541 | ||
|
|
e602286799 | ||
|
|
68bed0723c | ||
|
|
e83ef7a69f | ||
|
|
1e72562c9a | ||
|
|
8d1de7285e | ||
|
|
6305f7450d | ||
|
|
6d35314096 | ||
|
|
b6a3a9cdf5 | ||
|
|
d8d0a50625 | ||
|
|
b4b22bfe70 | ||
|
|
25a57b483c | ||
|
|
fc0bb83ca2 | ||
|
|
b395084d47 | ||
|
|
ad8982d0c6 | ||
|
|
152234937c | ||
|
|
dd6ca6e623 | ||
|
|
c09ff9e61c | ||
|
|
108665ebb9 | ||
|
|
7bfab37077 | ||
|
|
bd3adf029e | ||
|
|
b245b9c890 | ||
|
|
b1f981799c | ||
|
|
75860aad68 | ||
|
|
694fe87ebd | ||
|
|
9047660016 | ||
|
|
ea03cc09e4 | ||
|
|
701c719c78 | ||
|
|
238786df0b | ||
|
|
569f62c928 | ||
|
|
158082e87e | ||
|
|
2260e02963 | ||
|
|
daedd1e07c | ||
|
|
5f4c6e52d0 | ||
|
|
0e744b1e2f | ||
|
|
e444267428 | ||
|
|
6320cddc74 | ||
|
|
315d58e7a1 | ||
|
|
3624de4a92 | ||
|
|
ef0a9f4177 | ||
|
|
153bdb1905 | ||
|
|
cda02cd3a3 | ||
|
|
fff4bf779f | ||
|
|
3759d14baf | ||
|
|
f9451f5de0 | ||
|
|
92ca3c6501 | ||
|
|
7c81443ae7 | ||
|
|
9d685d7f38 | ||
|
|
56c7bcd777 | ||
|
|
630aadcb7d | ||
|
|
0107288ec5 | ||
|
|
3f49ad3b89 | ||
|
|
f0f87f0794 | ||
|
|
4b6d83ffb5 | ||
|
|
3d979ef964 | ||
|
|
4179b6e2ea | ||
|
|
dc5d756394 | ||
|
|
638ae3aaeb | ||
|
|
f4cd6c2bf1 | ||
|
|
9b9f4d8bfc | ||
|
|
f9c1e0b79d | ||
|
|
98d11acad9 | ||
|
|
76accde8da | ||
|
|
0ac8495d28 | ||
|
|
bbd8743894 | ||
|
|
e7571119fb | ||
|
|
61e47555f9 | ||
|
|
ba1c66585a | ||
|
|
141881376d | ||
|
|
5c6e2b5167 | ||
|
|
3eace3278f | ||
|
|
a99e681572 | ||
|
|
17cb349fd6 | ||
|
|
9e8bb78794 | ||
|
|
83c610ca0f | ||
|
|
125e1c1412 | ||
|
|
d5cd5be675 | ||
|
|
319c5174dd | ||
|
|
f620a3dde9 | ||
|
|
7126112cc3 | ||
|
|
1170e3cce7 | ||
|
|
780f2e86ea | ||
|
|
c54d005419 | ||
|
|
e365958526 | ||
|
|
cd285b9a19 | ||
|
|
44eb3625f9 | ||
|
|
19e87a545d | ||
|
|
3c207e1a9b | ||
|
|
e64db1028c | ||
|
|
5dfe9c42ae | ||
|
|
b6de3dee05 | ||
|
|
d62e05c5f2 | ||
|
|
665e4e12b2 | ||
|
|
dafb3ef77c | ||
|
|
6774757230 | ||
|
|
c047c6e2c5 | ||
|
|
14a8c0e0ec | ||
|
|
df91279967 | ||
|
|
b461925981 | ||
|
|
9969b83341 | ||
|
|
ddfdd72c73 | ||
|
|
ac6ad33fcb | ||
|
|
a1007efdac | ||
|
|
8097019b7e | ||
|
|
96a52d73d6 | ||
|
|
1718ab613b | ||
|
|
7c8272ab9e | ||
|
|
fe2f0a76f6 | ||
|
|
5226d9cc0f | ||
|
|
cd07a539f3 | ||
|
|
21c121af32 | ||
|
|
8538a4aa10 | ||
|
|
2cc7e36ec3 | ||
|
|
fe42f1e436 | ||
|
|
35ab5c8628 | ||
|
|
46eb69e662 | ||
|
|
26cb47eac4 | ||
|
|
c9f4b51369 | ||
|
|
d4712ad889 | ||
|
|
c1a8c047b0 | ||
|
|
63212a250b | ||
|
|
1c67d3e76a | ||
|
|
8fc6074b42 | ||
|
|
b7461756bf | ||
|
|
816adaaad0 | ||
|
|
530177eefd | ||
|
|
a02a89857b | ||
|
|
92dbd1be58 | ||
|
|
e95c4dd37d | ||
|
|
c7cc5663cb | ||
|
|
9930eea62c | ||
|
|
98668ef3b7 | ||
|
|
ee15ef1798 | ||
|
|
d08b0d88d8 | ||
|
|
8a15a82f44 | ||
|
|
f8def7d797 | ||
|
|
ca59f3890e | ||
|
|
3602b89512 | ||
|
|
eef4690ba4 | ||
|
|
da31e9c61c | ||
|
|
cc728e5748 | ||
|
|
6d849a4f6c | ||
|
|
093709386a | ||
|
|
b765ed3ec7 | ||
|
|
5ff1a04f10 | ||
|
|
2f6d363ee8 | ||
|
|
f453928f80 | ||
|
|
6e2c32ff84 | ||
|
|
9cf6a1ae71 | ||
|
|
e97f5f69b2 | ||
|
|
3bf5d0faf1 | ||
|
|
dd5d3fe1a4 | ||
|
|
061bc528ae | ||
|
|
d050e7d58d | ||
|
|
18cf24d35e | ||
|
|
7e2d69d0cb | ||
|
|
01b02f38d6 | ||
|
|
221cbe1142 | ||
|
|
483bfca969 | ||
|
|
0f21c16f43 | ||
|
|
34f9997df4 | ||
|
|
890877fcfd | ||
|
|
cde8bbc5ee | ||
|
|
5723fa2e67 | ||
|
|
d818930e0f | ||
|
|
c8aebb3c2b | ||
|
|
ab470def54 | ||
|
|
665ae4dd97 | ||
|
|
367cf7bf26 | ||
|
|
ddf03c50ae | ||
|
|
818f2a9931 | ||
|
|
e56cb4a50f | ||
|
|
53eb64e67d | ||
|
|
1912b921df | ||
|
|
ec7a6785d9 | ||
|
|
8c770b41ac | ||
|
|
8abf58112e | ||
|
|
e710c66dcb | ||
|
|
fb7f984389 | ||
|
|
93fb4379ff | ||
|
|
3a30a11c1f | ||
|
|
86c67af49c | ||
|
|
697c03fa07 | ||
|
|
04762fe68e | ||
|
|
79cbe5b58a | ||
|
|
5b444995a0 | ||
|
|
4e7d04f672 | ||
|
|
becdabe100 | ||
|
|
fd080e76e2 | ||
|
|
4f8eb37704 | ||
|
|
4ed7cd5aea | ||
|
|
1c217a7157 | ||
|
|
bc0ae17e64 | ||
|
|
48a8f3ac18 | ||
|
|
a0ef27ad21 | ||
|
|
6ce33dff90 | ||
|
|
823bc8ca22 | ||
|
|
73d466e7d6 | ||
|
|
48cf9671e1 | ||
|
|
a3633faf3f | ||
|
|
068cb6a97d | ||
|
|
b7ede11154 | ||
|
|
806517c2ba | ||
|
|
efacc16e3b | ||
|
|
fb0fbe87fc | ||
|
|
b67d539ab0 | ||
|
|
713358dca8 | ||
|
|
b32b7d7de9 | ||
|
|
5d324dd201 | ||
|
|
4f21669f6b | ||
|
|
19ad756261 | ||
|
|
f754578075 | ||
|
|
6d14ed61f1 | ||
|
|
9dd4941230 | ||
|
|
54cd1fa85f | ||
|
|
f5fd11fd78 | ||
|
|
8b3e89fbcc | ||
|
|
76c9d633ff | ||
|
|
ef8e4f48b9 | ||
|
|
e466f832b8 | ||
|
|
e1f6f369cb | ||
|
|
a061977523 | ||
|
|
bf51eeb26d | ||
|
|
347816820c | ||
|
|
e703669c79 | ||
|
|
d5c67deeca | ||
|
|
8127d00b89 | ||
|
|
e434bdb8de | ||
|
|
de6d274993 | ||
|
|
e30b878206 | ||
|
|
ec4f9f95fb | ||
|
|
12dbbbb43f | ||
|
|
340b18dcf6 | ||
|
|
e99a3ca7d7 | ||
|
|
26336ed500 | ||
|
|
692d3f879d | ||
|
|
5608924de6 | ||
|
|
b4cf195346 | ||
|
|
709e94f956 | ||
|
|
d7ccd1d7c1 | ||
|
|
f761d84312 | ||
|
|
638354de56 | ||
|
|
c622a32a65 | ||
|
|
9c28fd3eab | ||
|
|
22677d2832 | ||
|
|
2257bddbd8 | ||
|
|
c177e682c7 | ||
|
|
dc77bc9638 | ||
|
|
2079f0a554 | ||
|
|
42f12ba75b | ||
|
|
f1103ae677 | ||
|
|
0757abad17 | ||
|
|
15e2430fea | ||
|
|
79678c57ea | ||
|
|
ee06576557 | ||
|
|
0ebbdcb84d | ||
|
|
7baef947af | ||
|
|
ed19e202e8 | ||
|
|
7255f50beb | ||
|
|
07667697ba | ||
|
|
bfbfc912fe | ||
|
|
1f5b06dc04 | ||
|
|
99262e7ce8 | ||
|
|
2a2d4befe5 | ||
|
|
4a8c7a12e0 | ||
|
|
080c60c08e | ||
|
|
f06a749249 | ||
|
|
803eb33369 | ||
|
|
cdfba7d420 | ||
|
|
4566905a5c | ||
|
|
a50930fc14 | ||
|
|
6918114b1b | ||
|
|
a8b43475c1 | ||
|
|
d5a4361f4d | ||
|
|
9dbc2a4734 | ||
|
|
e419c569a8 | ||
|
|
a95c51998f | ||
|
|
ef232bd432 | ||
|
|
29b693181c | ||
|
|
ffbfdd7a29 | ||
|
|
369ee94c90 | ||
|
|
d897baff28 | ||
|
|
7b403b8052 | ||
|
|
8ae4fc5128 | ||
|
|
e360a8666a | ||
|
|
d04e897ef4 | ||
|
|
2a826ac432 | ||
|
|
2e2f6205c3 | ||
|
|
a9d1612316 | ||
|
|
ef5c2cee2e | ||
|
|
0428d983d9 | ||
|
|
1ebe142655 | ||
|
|
44e8ea36fd | ||
|
|
923adab737 | ||
|
|
5940b95cd2 | ||
|
|
bd79e6344a | ||
|
|
c651f1f944 | ||
|
|
66faeabc18 | ||
|
|
bc151116dc | ||
|
|
dbac5791ab | ||
|
|
547c338de9 | ||
|
|
aae5f75215 | ||
|
|
a0d03427d9 | ||
|
|
52f9dc8f28 | ||
|
|
948c38c035 | ||
|
|
aaaab5f6eb | ||
|
|
321c47297d | ||
|
|
877700710a | ||
|
|
fb1a1cfbfb | ||
|
|
2bb7499fd5 | ||
|
|
c86b28a210 | ||
|
|
1e5ab961c2 | ||
|
|
7c7053119a | ||
|
|
552bcc7931 | ||
|
|
8ebb890b26 | ||
|
|
fe2138e71e | ||
|
|
c48ae27da3 | ||
|
|
73c9f3b3ba | ||
|
|
a9cc6e301e | ||
|
|
19415f6363 | ||
|
|
73426de206 | ||
|
|
11379deca1 | ||
|
|
5ba275395d | ||
|
|
147e12f041 | ||
|
|
71b8d7fd37 | ||
|
|
d06837bc68 | ||
|
|
b7030fd629 | ||
|
|
a60427ecd7 | ||
|
|
0e3d0d03f0 | ||
|
|
7b6075232a | ||
|
|
50914da542 | ||
|
|
b3083f2c1d | ||
|
|
b115a80181 | ||
|
|
b39a666d73 | ||
|
|
c96668e402 | ||
|
|
973938134b | ||
|
|
66197ae416 | ||
|
|
bfd78e7c56 | ||
|
|
cbfb1b54b7 | ||
|
|
11cf09b6f3 | ||
|
|
37ec9f4638 | ||
|
|
3f5bbdf118 | ||
|
|
e819cd1fb5 | ||
|
|
588e56d4e5 | ||
|
|
d24d56d832 | ||
|
|
ace7c80534 | ||
|
|
5a80e1603e | ||
|
|
8dad1fa473 | ||
|
|
bf3b6d2dca | ||
|
|
b9396ac318 | ||
|
|
fd41f96cb7 | ||
|
|
7112153c46 | ||
|
|
e2d4b815d0 | ||
|
|
83f2441bfd | ||
|
|
405c34b668 | ||
|
|
8b8ba47f65 | ||
|
|
ffd8125925 | ||
|
|
ce6d4aaf34 | ||
|
|
5d4568188e | ||
|
|
eebe6627d7 | ||
|
|
bc63da1612 | ||
|
|
7af56d73e4 | ||
|
|
1d67ab02e5 | ||
|
|
23480a4eb4 | ||
|
|
b11925bd02 | ||
|
|
0d01083780 | ||
|
|
77b1e344e2 | ||
|
|
9409d21f74 | ||
|
|
70af222d9d | ||
|
|
bbb2907029 | ||
|
|
7fc03e4bb4 | ||
|
|
0b2f70247f | ||
|
|
1ea18a3771 | ||
|
|
d5b7524264 | ||
|
|
d30782403e | ||
|
|
b799ac7897 | ||
|
|
19e3e84e05 | ||
|
|
09ac438cc2 | ||
|
|
629d795980 | ||
|
|
36f1b30778 | ||
|
|
d4ac7365e0 | ||
|
|
20610687de | ||
|
|
774e4739ba | ||
|
|
7063021f19 | ||
|
|
a39cdc7e8c | ||
|
|
17bb2f93ad | ||
|
|
4880a3ebe6 | ||
|
|
7df81f1273 | ||
|
|
7cb972fdec | ||
|
|
407bd74a00 | ||
|
|
58cbfd987b | ||
|
|
f37a61a848 | ||
|
|
664d708f1c | ||
|
|
c8e170bba2 | ||
|
|
9bb200b193 | ||
|
|
89d07602e8 | ||
|
|
9ca3a3bd31 | ||
|
|
29c2fbb86d | ||
|
|
14362cdf5f | ||
|
|
500a4f9f60 | ||
|
|
11f0e1a566 | ||
|
|
13d38ba455 | ||
|
|
0f723a1e7c | ||
|
|
4c075e07e4 | ||
|
|
8ca21887be | ||
|
|
149fc261fa | ||
|
|
031080bfba | ||
|
|
a43e75ffd6 | ||
|
|
943dc69c66 | ||
|
|
1a764f3120 | ||
|
|
f5cdf89608 | ||
|
|
f6dd96a281 | ||
|
|
09dcd58ee8 | ||
|
|
5d07faa051 | ||
|
|
e3d6e433b2 | ||
|
|
faec6aeced | ||
|
|
e915e14612 | ||
|
|
4be3abdd81 | ||
|
|
c69852eb9f | ||
|
|
5422946eee | ||
|
|
e55559f727 | ||
|
|
c832819a76 | ||
|
|
cddd4ce581 | ||
|
|
1da01203ce | ||
|
|
23ba52a813 | ||
|
|
125e227976 | ||
|
|
b71278cc68 | ||
|
|
cebdd19c00 | ||
|
|
242c3d442f | ||
|
|
ad73a09c0e | ||
|
|
4ee84947c9 | ||
|
|
a85d593767 | ||
|
|
72d3afa698 | ||
|
|
ef0af1244d | ||
|
|
078cab1199 | ||
|
|
d4f5e57866 | ||
|
|
6c1c33e9ac | ||
|
|
f1fa47837a | ||
|
|
83b6d1e662 | ||
|
|
bb57d220d0 | ||
|
|
116d73f0b0 | ||
|
|
12c66351b3 | ||
|
|
ed5c958d76 | ||
|
|
05e963bb6f | ||
|
|
f1ebc854fe | ||
|
|
4f4e222d40 | ||
|
|
ffd66d514a | ||
|
|
64fc58cd80 | ||
|
|
985079371c | ||
|
|
df3130ec66 | ||
|
|
bda2017d0d | ||
|
|
cc71e2884e | ||
|
|
ff8ad66350 | ||
|
|
be29d791a8 | ||
|
|
5a0f056a42 | ||
|
|
768b0c4594 | ||
|
|
67b77c121a | ||
|
|
1235ad0f9a | ||
|
|
3f72507f77 | ||
|
|
89695d8f7a | ||
|
|
f5125a6f37 | ||
|
|
84430c60f8 | ||
|
|
a9e445e5a1 | ||
|
|
2282b2922d | ||
|
|
8387109166 | ||
|
|
294cfe403c | ||
|
|
d1b7c6edea | ||
|
|
25390103fd | ||
|
|
f685d9d036 | ||
|
|
7e0b19ad43 | ||
|
|
2863dce99c | ||
|
|
7fac0f1eb9 | ||
|
|
9c338c9b7f | ||
|
|
d25dd17510 | ||
|
|
c1eb47a262 | ||
|
|
95a6bc0d54 | ||
|
|
1e4315d1b8 | ||
|
|
0df46ab8ff | ||
|
|
7b76eaf956 | ||
|
|
fabc0c6ccd | ||
|
|
8eff166244 | ||
|
|
d525428f15 | ||
|
|
f058463685 | ||
|
|
403dd8fb3d | ||
|
|
4058afd40e | ||
|
|
0f37149740 | ||
|
|
051cae8b6e | ||
|
|
2aa4d26df2 | ||
|
|
299ca0515b | ||
|
|
2c7e559351 | ||
|
|
cdc4a4987d | ||
|
|
2932e24652 | ||
|
|
a888a340ae | ||
|
|
3ec7ced8cd | ||
|
|
a8eea0dfd7 | ||
|
|
36ab5ab299 | ||
|
|
3d45f62dd2 | ||
|
|
c1a48443d4 | ||
|
|
24d1de51a0 | ||
|
|
51b1fb58d2 | ||
|
|
5b459da10a | ||
|
|
588cda9eac | ||
|
|
e996351dc9 | ||
|
|
a359bd1746 | ||
|
|
0a9d7cbc6f | ||
|
|
28f986e201 | ||
|
|
bb50b6a942 | ||
|
|
220037c681 | ||
|
|
af6f94ef81 | ||
|
|
b6e65c08a8 | ||
|
|
6a76a73e18 | ||
|
|
8c37594006 | ||
|
|
3deb154fca | ||
|
|
02237c47ce | ||
|
|
0832b0a480 | ||
|
|
9b6929e745 | ||
|
|
d47290e996 | ||
|
|
5430fee1fd | ||
|
|
39e17f149b | ||
|
|
46892580c2 | ||
|
|
b95a40c4f2 | ||
|
|
b53be25b94 | ||
|
|
4c0578c56c | ||
|
|
789b8f701e | ||
|
|
097e45d180 | ||
|
|
f47f8b9ad1 | ||
|
|
277029caae | ||
|
|
2dd18e7cc6 | ||
|
|
a7d669b47b | ||
|
|
432680b2f3 | ||
|
|
1efed2c3c7 | ||
|
|
3cf3a83c49 | ||
|
|
9eb3c8189c | ||
|
|
b809dd55e8 | ||
|
|
a542227442 | ||
|
|
47bcb4be5e | ||
|
|
42dffdad84 | ||
|
|
ac957dada4 | ||
|
|
9fa5b600d9 | ||
|
|
000e88f0c6 | ||
|
|
c447bc3f2c | ||
|
|
9acf8145d0 | ||
|
|
07c9f58cf8 | ||
|
|
98ab1338ab | ||
|
|
4133c9f562 | ||
|
|
16911a54f0 | ||
|
|
6843eb6d2e | ||
|
|
e42603dac0 | ||
|
|
c7942badfb | ||
|
|
b1992e028d | ||
|
|
9df9566836 | ||
|
|
ef64e93238 | ||
|
|
e47e77c3d6 | ||
|
|
d90f4e7bac | ||
|
|
e143eb1cb1 | ||
|
|
f27098f877 | ||
|
|
af754d013f | ||
|
|
13773d0104 | ||
|
|
35e2cd9d05 | ||
|
|
55f9458f65 | ||
|
|
f6cd060c83 | ||
|
|
99c01b7261 | ||
|
|
cacb516e48 | ||
|
|
ce4702318a | ||
|
|
e056cb96aa | ||
|
|
dfbbd4fda5 | ||
|
|
23eaed140c | ||
|
|
af036f9d3a | ||
|
|
7d696f0dc5 | ||
|
|
63619fd66b | ||
|
|
90ac55d588 | ||
|
|
f519c35823 | ||
|
|
535b70093d | ||
|
|
0dc4c59794 | ||
|
|
35103f40ef | ||
|
|
4492db289e | ||
|
|
d382eb9fc9 | ||
|
|
1a4c627702 | ||
|
|
637f0bb757 | ||
|
|
6e4044c623 | ||
|
|
732d2b5a8b | ||
|
|
12d6afc885 | ||
|
|
6e86e69010 | ||
|
|
bda6c0f36e | ||
|
|
9385805423 | ||
|
|
18f5c566cc | ||
|
|
daa8eb06d7 | ||
|
|
ac4867daf7 | ||
|
|
15e54ef0a1 | ||
|
|
426e97d1df | ||
|
|
267c478e58 | ||
|
|
d6ac0687d9 | ||
|
|
c1f621930d | ||
|
|
ac8f9b4f8f | ||
|
|
9af436a0d4 | ||
|
|
cc21fcc9ef | ||
|
|
fcc57e08bc | ||
|
|
f6e52b37d5 | ||
|
|
e5a6c5b7a5 | ||
|
|
3764b52f3a | ||
|
|
225c04d784 | ||
|
|
957f97fd15 | ||
|
|
5d89c623c3 | ||
|
|
ef4bd8e5f6 | ||
|
|
99475511e0 | ||
|
|
d8ea844058 | ||
|
|
c71beafcd3 | ||
|
|
d4bf1d1a1d | ||
|
|
dddc32adfd | ||
|
|
952af31296 | ||
|
|
6bd17bad98 | ||
|
|
3a9022be04 | ||
|
|
e833fb2703 | ||
|
|
beb7d8a9a8 | ||
|
|
e7bcb2170a | ||
|
|
97298ab0f1 | ||
|
|
fa82ec5087 | ||
|
|
cc26984ab7 | ||
|
|
b0490a0161 | ||
|
|
a8f5ef7287 | ||
|
|
42bf790068 | ||
|
|
524a260c26 | ||
|
|
4bb2ba8b2c | ||
|
|
8efc710fb3 | ||
|
|
dceb3d7f10 | ||
|
|
d1cee42c9d | ||
|
|
82625b57dd | ||
|
|
35874fa5ce | ||
|
|
ac576bd6e7 | ||
|
|
94fc8298e6 | ||
|
|
9347bfd3d3 | ||
|
|
b731cf7f10 | ||
|
|
0a3149ae8a | ||
|
|
fa410a7b5e | ||
|
|
f5deafffb8 | ||
|
|
e955926ee9 | ||
|
|
1c1d4b531f | ||
|
|
745e2b0848 | ||
|
|
1fe1e46e71 | ||
|
|
b9524e5d6e | ||
|
|
7a3c30ab3f | ||
|
|
48a9ec6c0d | ||
|
|
ec479f049a | ||
|
|
17f35b4d48 | ||
|
|
4b4ada9617 | ||
|
|
3eafacac2b | ||
|
|
6bcc0e4a3f | ||
|
|
5890238666 | ||
|
|
4a5972f15e | ||
|
|
20cc3b4cdd | ||
|
|
512a6f2220 | ||
|
|
6f15b507c6 | ||
|
|
22f3464066 | ||
|
|
ab9d2a0c2c | ||
|
|
66e4d1936c | ||
|
|
ce5fdcd564 | ||
|
|
add033324b | ||
|
|
47cc09908a | ||
|
|
ae9eaa4bc4 | ||
|
|
703b517718 | ||
|
|
a4b97cb1e7 | ||
|
|
a942befc65 | ||
|
|
7e3b1f58d5 | ||
|
|
9f48048472 | ||
|
|
e18f4302a8 | ||
|
|
00091136d3 | ||
|
|
5ce7f2d67d | ||
|
|
454ed43ae4 | ||
|
|
42104a617d | ||
|
|
21fc124b1c | ||
|
|
a832b85ab5 | ||
|
|
69e58440ab | ||
|
|
e4d5988921 | ||
|
|
c39d4bc320 | ||
|
|
e6a2fdbb45 | ||
|
|
17a7129595 | ||
|
|
439a1b1053 | ||
|
|
4c816cbfba | ||
|
|
6aca41a48a | ||
|
|
11b066ae70 | ||
|
|
c01700c9c7 | ||
|
|
c8e6e7ad4c | ||
|
|
7462d86afd | ||
|
|
5014012bd6 | ||
|
|
5554619a9d | ||
|
|
00fd7820c3 | ||
|
|
4ffd08f360 | ||
|
|
e3413600c6 | ||
|
|
c18be0a157 | ||
|
|
14e053e0a3 | ||
|
|
43ba26e11a | ||
|
|
f8944f1286 | ||
|
|
562922a586 | ||
|
|
a8528e4a4a | ||
|
|
f4fb27be98 | ||
|
|
3800245849 | ||
|
|
798ec2e3d4 | ||
|
|
34bbea0204 | ||
|
|
7106c1554f | ||
|
|
6edc26c834 | ||
|
|
73d454be46 | ||
|
|
f4b9f8a59d | ||
|
|
ddc900a656 | ||
|
|
36e50e0f0d | ||
|
|
f8a18b56ec | ||
|
|
83925e432d | ||
|
|
7912aa764c | ||
|
|
d4ed910c22 | ||
|
|
fe9370e04b | ||
|
|
b5a1dce4ec | ||
|
|
f3a441ee3c | ||
|
|
9a8bf7d0c3 | ||
|
|
69ee221eda | ||
|
|
f6e3e81252 | ||
|
|
cab3307a07 | ||
|
|
d52ad92cb4 | ||
|
|
59cbfe43e0 | ||
|
|
b488c65d31 | ||
|
|
add7e7d216 | ||
|
|
0a877f2976 | ||
|
|
31f7732d4f | ||
|
|
4f70079f52 | ||
|
|
bf6f19dc97 | ||
|
|
b779f45407 | ||
|
|
f49178786c | ||
|
|
87acecba52 | ||
|
|
293dfbb8cb | ||
|
|
cbd8a2d07d | ||
|
|
29483d6740 | ||
|
|
7b32287943 | ||
|
|
3e74aac4a5 | ||
|
|
042934cc3c | ||
|
|
e0e3aa422e | ||
|
|
cf570cd913 | ||
|
|
d0d18f9837 | ||
|
|
76a6760516 | ||
|
|
70e0566647 | ||
|
|
12c29eb308 | ||
|
|
fb3d24b23c | ||
|
|
92dde5ce38 | ||
|
|
87b9d93911 | ||
|
|
6d540e2f06 | ||
|
|
d1bbf844de | ||
|
|
cde72ebc45 | ||
|
|
fed03289c4 | ||
|
|
d0abfefc9d | ||
|
|
a9502b1578 | ||
|
|
bfcd2fefdc | ||
|
|
129131020d | ||
|
|
3bcc392760 | ||
|
|
f0adfb450e | ||
|
|
06be620d71 | ||
|
|
a8247c9762 | ||
|
|
e26f26c1ba | ||
|
|
8deb96b931 | ||
|
|
567db4cf15 | ||
|
|
66867e1ddb | ||
|
|
f2ec857c66 | ||
|
|
514fc84cde | ||
|
|
75ffb3867d | ||
|
|
3cb85851ad | ||
|
|
7ab0ccd19e | ||
|
|
d7075ffad0 | ||
|
|
386cbd4ad6 | ||
|
|
6a4dd5cd26 | ||
|
|
c8c49f42fe | ||
|
|
6da8fc99b8 | ||
|
|
e6e82906f4 | ||
|
|
0c130b5a5d | ||
|
|
131d1c5e8d | ||
|
|
abd679292e | ||
|
|
4c8c8c09f2 | ||
|
|
4ebd4c392a | ||
|
|
71f5a3aae4 | ||
|
|
c49ec83746 | ||
|
|
c5d61996d4 | ||
|
|
21bb768e9f | ||
|
|
647ef40250 | ||
|
|
f7e881479b | ||
|
|
a2f7bb835e | ||
|
|
4f0795f522 | ||
|
|
38d3d3784b | ||
|
|
12cb5d637c | ||
|
|
bd08635793 | ||
|
|
ea62c99853 | ||
|
|
4c5e7cc86d | ||
|
|
b71b5d2c50 | ||
|
|
cb07196de9 | ||
|
|
b7ebf9c915 | ||
|
|
5ff9d8328a | ||
|
|
3e9ddc55bb | ||
|
|
3c6cf3f37e | ||
|
|
86d4a7319f | ||
|
|
6806398722 | ||
|
|
c6beb03635 | ||
|
|
2852ef01cc | ||
|
|
ad93155d4f | ||
|
|
350066858c | ||
|
|
5a2a756649 | ||
|
|
8011bb02bd | ||
|
|
d07c90bce3 | ||
|
|
657a88c348 | ||
|
|
15e71b0807 | ||
|
|
3dfc15f5a4 | ||
|
|
5652dc7e7f | ||
|
|
24c4c62ae3 | ||
|
|
acd9c389f9 | ||
|
|
906d009fc0 | ||
|
|
eddb098947 | ||
|
|
c39fc76702 | ||
|
|
ff460f323d | ||
|
|
1d2d155eaf | ||
|
|
f9cea604ad | ||
|
|
0014840506 | ||
|
|
cf1c8649c0 | ||
|
|
8a7c740292 | ||
|
|
625e062763 | ||
|
|
55f6577327 | ||
|
|
db8e839de1 | ||
|
|
2f1744cbc8 | ||
|
|
3d076b07cc | ||
|
|
b4984a5628 | ||
|
|
337096cde7 | ||
|
|
cc50b5f441 | ||
|
|
4925b51de7 | ||
|
|
76e2a241e7 | ||
|
|
330377bcd6 | ||
|
|
adbe1a830e | ||
|
|
f3630d2fb3 | ||
|
|
970ab1bee9 | ||
|
|
1ee580e254 | ||
|
|
e0b1c1b01e | ||
|
|
0ecee5bf94 | ||
|
|
478dd780b7 | ||
|
|
80a06a62f9 | ||
|
|
567b1b1c1f | ||
|
|
8286ebb689 | ||
|
|
e86aac02f9 | ||
|
|
d2e137d5d1 | ||
|
|
00b33dab4d | ||
|
|
ac307708ba | ||
|
|
f18ec3feeb | ||
|
|
e1cfdc6e23 | ||
|
|
da27843544 | ||
|
|
2b2e602eac | ||
|
|
ed17a190d2 | ||
|
|
bd0495f88b | ||
|
|
7194763c32 | ||
|
|
9e59c65e5c | ||
|
|
da6ba8a450 | ||
|
|
2526c4d9f3 | ||
|
|
225a68da06 | ||
|
|
94a4550f3d | ||
|
|
b16de694b9 | ||
|
|
d5c51cf6ad | ||
|
|
20f3da9db2 | ||
|
|
45109685e1 | ||
|
|
6087b94d32 | ||
|
|
36abd4152a | ||
|
|
0ae56e7098 | ||
|
|
cf55681114 | ||
|
|
1020a8c335 | ||
|
|
4dac03da26 | ||
|
|
5d84d75f80 | ||
|
|
848a73c666 | ||
|
|
8bcb2ea0cc | ||
|
|
53bd7cd0c0 | ||
|
|
322b30ad6f | ||
|
|
8add2d90b2 | ||
|
|
d968b96082 | ||
|
|
076fa07b00 | ||
|
|
db85195991 | ||
|
|
a0ace650f1 | ||
|
|
8e30cd350e | ||
|
|
430cc6b187 | ||
|
|
70fee2405c | ||
|
|
8c6efbbb37 | ||
|
|
bda38a384b | ||
|
|
b8e95aeadc | ||
|
|
97ed35fb3e | ||
|
|
85dea47573 | ||
|
|
1870e2729e | ||
|
|
2aa8c88822 | ||
|
|
d25019aeaf | ||
|
|
e898d1fea3 | ||
|
|
bf4e4a0283 | ||
|
|
34a6960aad | ||
|
|
95485ba8be | ||
|
|
6a7baf2a90 | ||
|
|
02cecb259d | ||
|
|
e95a10cf6b | ||
|
|
c9826b9694 | ||
|
|
6f133ed9f2 | ||
|
|
093f9828f0 | ||
|
|
69c1b65689 | ||
|
|
4e667679a5 | ||
|
|
86cb997def | ||
|
|
76c7167d2b | ||
|
|
c8e630ce75 | ||
|
|
88c621c1ec | ||
|
|
c1670e8670 | ||
|
|
99f6cd6ed4 | ||
|
|
66c0c8515f | ||
|
|
f941b394f4 | ||
|
|
642cea3e16 | ||
|
|
722de8ec75 | ||
|
|
40d34c27d7 | ||
|
|
d71c3622ec | ||
|
|
2bc935d3d8 | ||
|
|
2c871dfd1d | ||
|
|
0ce64d83fb | ||
|
|
bfe139eacc | ||
|
|
a026e1eeba | ||
|
|
74ba198201 | ||
|
|
1533a2d0b5 | ||
|
|
8936060d42 | ||
|
|
ee3aae6316 | ||
|
|
ca056984ba | ||
|
|
716d5ff94c | ||
|
|
a8883bd5f2 | ||
|
|
19b8e429bc | ||
|
|
7652295d84 | ||
|
|
95c53a9e49 | ||
|
|
8a22a11b8d | ||
|
|
dc3da33749 | ||
|
|
be96692739 | ||
|
|
7e570bcfdd | ||
|
|
7cf63245af | ||
|
|
0635e22810 | ||
|
|
ac2bc23365 | ||
|
|
2d81c3a8e3 | ||
|
|
ede9ed3466 | ||
|
|
fbcfb9a118 | ||
|
|
2749eb7149 | ||
|
|
126d2ff728 | ||
|
|
6c8f9a1038 | ||
|
|
194fe2e2b2 | ||
|
|
58532c76de | ||
|
|
14a1e83930 | ||
|
|
e048b30d02 | ||
|
|
ab674f8348 | ||
|
|
4229cab9b4 | ||
|
|
db908004c7 | ||
|
|
1d3392e60e | ||
|
|
aacbcc3602 | ||
|
|
d13f1295f1 | ||
|
|
0737e951a0 | ||
|
|
0b332431d3 | ||
|
|
c79d48cdde | ||
|
|
7262e1e709 | ||
|
|
7c608452b5 | ||
|
|
a426cddd4a | ||
|
|
c0e512e304 | ||
|
|
6a911fc54f | ||
|
|
ae047b5809 | ||
|
|
a44f66e9a1 | ||
|
|
ea88219ad6 | ||
|
|
8551817724 | ||
|
|
f58748ebbe | ||
|
|
5555ea4ede | ||
|
|
fa92537bdf | ||
|
|
6a47a4dc29 | ||
|
|
02da9336c4 | ||
|
|
04cd32b84b | ||
|
|
686a72e1b4 | ||
|
|
38c7bc1c17 | ||
|
|
45faf1ec63 | ||
|
|
38d18acd4d | ||
|
|
39284ae707 | ||
|
|
16e92fa581 | ||
|
|
bb3e453f62 | ||
|
|
e1408f2bfb | ||
|
|
6246e1e605 | ||
|
|
20285cb677 | ||
|
|
90d089e78b | ||
|
|
d69b8de80f | ||
|
|
333dc6bbf9 | ||
|
|
169f26e2b1 | ||
|
|
2ad4d3342c | ||
|
|
9e1cb2f9de | ||
|
|
515a78f979 | ||
|
|
c6c1be0fa1 | ||
|
|
2d91171dd9 | ||
|
|
8235ec7afd | ||
|
|
fcb2554ff3 | ||
|
|
0d59c0f43b | ||
|
|
bc8739a57e | ||
|
|
d72aa3158a | ||
|
|
874593bae9 | ||
|
|
1391f028bf | ||
|
|
0fae952d4d | ||
|
|
ca7520b25d | ||
|
|
a3e1337111 | ||
|
|
63b7ed3dab | ||
|
|
b81990cdee | ||
|
|
45c2f23d42 | ||
|
|
7fc14aaf08 | ||
|
|
b3f90a81ce | ||
|
|
bb3c95ea4e | ||
|
|
7c380d0156 | ||
|
|
2eb27ae183 | ||
|
|
f335716d1d | ||
|
|
f5d899bf6e | ||
|
|
2236203cbc | ||
|
|
19115df834 | ||
|
|
d0431b8bb6 | ||
|
|
0df893e081 | ||
|
|
7c3ea37a00 | ||
|
|
fbdbbcf1a9 | ||
|
|
9b705eeeea | ||
|
|
62207a101a | ||
|
|
937c2d1bd1 | ||
|
|
f5e2e73638 | ||
|
|
e64dbc7691 | ||
|
|
f59b0efab4 | ||
|
|
250b1e1c5f | ||
|
|
8819e1dc46 | ||
|
|
a5a0eb73d2 | ||
|
|
94cd930d4f | ||
|
|
5376acb80d | ||
|
|
8733bcb795 | ||
|
|
17694a328b | ||
|
|
00e65f0416 | ||
|
|
d31bcabeb2 | ||
|
|
acc8972a40 | ||
|
|
23704a7db6 | ||
|
|
338fc2ac13 | ||
|
|
0b300c134a | ||
|
|
d725499035 | ||
|
|
63c94fdd35 | ||
|
|
dab1020622 | ||
|
|
925271db01 | ||
|
|
938ab9723b | ||
|
|
97e933491c | ||
|
|
c143f9f716 | ||
|
|
abd551bb7d | ||
|
|
ac24efe5bd | ||
|
|
ae5943fc4b | ||
|
|
9e7e0a28c2 | ||
|
|
1736adb171 | ||
|
|
9f9f04b626 | ||
|
|
a5fbd80b06 | ||
|
|
1f9ef4eab4 | ||
|
|
24fbe8a855 | ||
|
|
b61a65fb9e | ||
|
|
1dd20b0a0c | ||
|
|
27198fe6bb | ||
|
|
e4a9660670 | ||
|
|
2c2237ec4c | ||
|
|
8a562222e8 | ||
|
|
849b4a223c | ||
|
|
1a3dc38d58 | ||
|
|
dd6d7624f2 | ||
|
|
6f95c82279 | ||
|
|
0e203e7bbb | ||
|
|
368dfe2d83 | ||
|
|
b2a4e63e45 | ||
|
|
4cc4a7204d | ||
|
|
77daea7362 | ||
|
|
61ca2720fd | ||
|
|
304b242148 | ||
|
|
24032734e7 | ||
|
|
7cbcd4440a | ||
|
|
4daef2fbcc | ||
|
|
8326825494 | ||
|
|
4823b2d4e7 | ||
|
|
ba8b9e9f19 | ||
|
|
e7b1c2f0e5 | ||
|
|
52f2728735 | ||
|
|
6c5f20f786 | ||
|
|
eb9c87b7fd | ||
|
|
86fff7afa2 | ||
|
|
549c2166b4 | ||
|
|
6de95254e8 | ||
|
|
59cd1a76c5 | ||
|
|
d208a115fc | ||
|
|
2d55ee8946 | ||
|
|
6351068f4a | ||
|
|
114e144c6c | ||
|
|
9220b983c5 | ||
|
|
095dd0db99 | ||
|
|
a41eececfb | ||
|
|
2136c0a19b | ||
|
|
d751976e30 | ||
|
|
e1f21b044f | ||
|
|
49bb63f0c0 | ||
|
|
79f8f92ef4 | ||
|
|
6eaecc3df0 | ||
|
|
44ed105432 | ||
|
|
8b9b132116 | ||
|
|
23e12a11ee | ||
|
|
77a95cf778 | ||
|
|
d81bcfcf76 | ||
|
|
b5c1b31cfc | ||
|
|
e519d0ee36 | ||
|
|
ce26997d31 | ||
|
|
34777e3d7a | ||
|
|
16fff3736f | ||
|
|
06123c78a8 | ||
|
|
b95e826179 | ||
|
|
079f662e0c | ||
|
|
47b973463a | ||
|
|
51a1d92b97 | ||
|
|
319f6ca4d2 | ||
|
|
a1b35bae8c | ||
|
|
11810916cc | ||
|
|
a7bf3ccc41 | ||
|
|
632cdea60a | ||
|
|
fa47444c4e | ||
|
|
3bda60d815 | ||
|
|
66c732e0b6 | ||
|
|
d70fb04186 | ||
|
|
931fadabb2 | ||
|
|
c4bb42df3e | ||
|
|
6dc6cbab12 | ||
|
|
57497f850b | ||
|
|
497bfb01da | ||
|
|
0f97da2d9c | ||
|
|
75ca9be7ce | ||
|
|
a932ce3fa7 | ||
|
|
14c33625ec | ||
|
|
f46c844474 | ||
|
|
ccce015216 | ||
|
|
bd84a42d36 | ||
|
|
bb4ef582d6 | ||
|
|
5305260fd4 | ||
|
|
c2938ebd0c | ||
|
|
fd9c82050b | ||
|
|
6efd927c67 | ||
|
|
09fcd97b9d | ||
|
|
55db949ca8 | ||
|
|
fecefc3f92 | ||
|
|
428b946f45 | ||
|
|
6a3594deeb | ||
|
|
4c704da85b | ||
|
|
a7bdbdb8d0 | ||
|
|
888d743a51 | ||
|
|
1be2378e28 | ||
|
|
80b372e0b2 | ||
|
|
70292f2015 | ||
|
|
e039777935 | ||
|
|
6b5850e92e | ||
|
|
d8ac8756eb | ||
|
|
280730cbac | ||
|
|
73647b9f89 | ||
|
|
e85ea4f013 | ||
|
|
f2b50e1f9d | ||
|
|
f4d6bebddd | ||
|
|
8607fe64a1 | ||
|
|
fd37e7ae36 | ||
|
|
85e7988e08 | ||
|
|
693c6d90aa | ||
|
|
2e025b0ee1 | ||
|
|
12a8e65078 | ||
|
|
c6f2d36767 | ||
|
|
f96fcc58b6 | ||
|
|
bd241af705 | ||
|
|
3d27677186 | ||
|
|
721e3a4fdb | ||
|
|
ebb5adeafd | ||
|
|
3f4e9b8283 | ||
|
|
0f2ce84b42 | ||
|
|
c135052a35 | ||
|
|
075543d206 | ||
|
|
2314c82a1a | ||
|
|
f3deca41d7 | ||
|
|
e05b6903ec | ||
|
|
8b61d855a8 | ||
|
|
7b1e9cbe62 | ||
|
|
cbe1210e62 | ||
|
|
f4478769df | ||
|
|
6b6493c4d8 | ||
|
|
1f49e71964 | ||
|
|
922de495e1 | ||
|
|
ee22efdb40 | ||
|
|
4819a9b434 | ||
|
|
bae7c8ad88 | ||
|
|
e3ee4d2119 | ||
|
|
e309b49e1b | ||
|
|
bbf144fbce | ||
|
|
b3942a2dde | ||
|
|
25966e273f | ||
|
|
e1f1fbdaff | ||
|
|
647f0d46be | ||
|
|
fa1421eb75 | ||
|
|
da30e30d7d | ||
|
|
3755b24601 | ||
|
|
a194a2d720 | ||
|
|
b608277535 | ||
|
|
eb8b3f3aaf | ||
|
|
10f6aa00a9 | ||
|
|
6a89012660 | ||
|
|
ed2edc0d00 | ||
|
|
5e15150560 | ||
|
|
b0be0db5af | ||
|
|
33cc3d0702 | ||
|
|
76096d3760 | ||
|
|
610763415d | ||
|
|
4c1a4fbbbc | ||
|
|
4d686b8e5c | ||
|
|
2c86f87c35 | ||
|
|
ad100cb4d4 | ||
|
|
c371e50a2b | ||
|
|
19c497d6b8 | ||
|
|
e520f4092d | ||
|
|
85fde995f0 | ||
|
|
21e3e283c1 | ||
|
|
d55e972999 | ||
|
|
41b6cfe0f7 | ||
|
|
29fa0dd1df | ||
|
|
728e935973 | ||
|
|
d1550794a3 | ||
|
|
697c5b6152 | ||
|
|
00dd395f54 | ||
|
|
84834433c1 | ||
|
|
84932c6704 | ||
|
|
d5962419b0 | ||
|
|
8c277bd10e | ||
|
|
3b60d2c6e2 | ||
|
|
e27b9a6410 | ||
|
|
4c4f7105e3 | ||
|
|
aefdd36868 | ||
|
|
80dd1e99db | ||
|
|
391dec4a50 | ||
|
|
e88dc25709 | ||
|
|
663a2710dd | ||
|
|
98a53f8261 | ||
|
|
f3d15b42aa | ||
|
|
29414947f4 | ||
|
|
6323a47d62 | ||
|
|
eee5d3218a | ||
|
|
d6e5df659c | ||
|
|
7a8e8a1b9d | ||
|
|
c3524d6156 | ||
|
|
44d632718d | ||
|
|
a95808bf9e | ||
|
|
7b8745806f | ||
|
|
af3128527a | ||
|
|
83f16421c0 | ||
|
|
661019e494 | ||
|
|
56a7f9d404 | ||
|
|
d153c4d73e | ||
|
|
91f7344586 | ||
|
|
0adfcd636b | ||
|
|
d6de7a1298 | ||
|
|
502a14b505 | ||
|
|
1489e003f2 | ||
|
|
a04a09c018 | ||
|
|
b269b37ecf | ||
|
|
9a80a47cfa | ||
|
|
db5466d3c4 | ||
|
|
a6b9dd1969 | ||
|
|
537da71c6e | ||
|
|
4bbe1f642a | ||
|
|
f9f2147156 | ||
|
|
409380dbc3 | ||
|
|
2fdc7cffbc | ||
|
|
88f0aada4b | ||
|
|
5ed66f0fe9 | ||
|
|
62e8193b6d | ||
|
|
569d44b498 | ||
|
|
03bdbf65be | ||
|
|
709e291a82 | ||
|
|
9661d8e337 | ||
|
|
6b68f1aa58 | ||
|
|
8db51cd3ef | ||
|
|
5f31adb5da | ||
|
|
157d6dcdfc | ||
|
|
bbdac251ca | ||
|
|
b5f48cb00e | ||
|
|
57f1d03dea | ||
|
|
7c419de066 | ||
|
|
84f2fd2be0 | ||
|
|
f9d3c30166 | ||
|
|
39e59f2806 | ||
|
|
f23723abeb | ||
|
|
1e0887673a | ||
|
|
5399f8b7cc | ||
|
|
66a92c55d5 | ||
|
|
4dc2e8f278 | ||
|
|
0f522e9c4c | ||
|
|
2dfffa4c22 | ||
|
|
077d8b1ac8 | ||
|
|
9218a3e2b1 | ||
|
|
29e3fa00d4 | ||
|
|
42e3f44fcb | ||
|
|
fc11d6d0cb | ||
|
|
3f9e137df2 | ||
|
|
16673573b0 | ||
|
|
c725c3be0b | ||
|
|
ec0275575a | ||
|
|
3ac53572a3 | ||
|
|
5bf36618ff | ||
|
|
894d704092 | ||
|
|
67c33b2270 | ||
|
|
6ed33d259e | ||
|
|
facb3b564a | ||
|
|
f00fcd66c1 | ||
|
|
18f9a7e362 | ||
|
|
3ff7ae641f | ||
|
|
8376a5897f | ||
|
|
ba7237c0c6 | ||
|
|
af2da59d05 | ||
|
|
c35955010e | ||
|
|
52f1296467 | ||
|
|
69d4a4d1ed | ||
|
|
e305990dff | ||
|
|
1ebe7c6b4c | ||
|
|
d156f20132 | ||
|
|
3ae817a028 | ||
|
|
6d35221881 | ||
|
|
6516e97a58 | ||
|
|
550071d350 | ||
|
|
0b94dda97f | ||
|
|
22604aa884 | ||
|
|
e7d088d0b8 | ||
|
|
95841dfed4 | ||
|
|
7fbdd2ef77 | ||
|
|
50fb631979 | ||
|
|
aa0d8d1506 | ||
|
|
82aab029c2 | ||
|
|
04500f2448 | ||
|
|
86ea4bbc9a | ||
|
|
c94b4f9148 | ||
|
|
a74cb810f5 | ||
|
|
76aa7f8f9b | ||
|
|
1381f3e563 | ||
|
|
e65457cf29 | ||
|
|
9cdd81c37b | ||
|
|
6ded59e6f1 | ||
|
|
ad03edba2c | ||
|
|
c66696f4d0 | ||
|
|
1f3d366c0c | ||
|
|
7bf2230f1b | ||
|
|
8da8b3ffb8 | ||
|
|
14f452a904 | ||
|
|
51133263f2 | ||
|
|
a152a44c87 | ||
|
|
bc47d858a0 | ||
|
|
99a747e951 | ||
|
|
333c0b4d60 | ||
|
|
536b2ed570 | ||
|
|
41ede17be0 | ||
|
|
d45430fbf1 | ||
|
|
607c5530d2 | ||
|
|
d8a16eeb1a | ||
|
|
3e66570596 | ||
|
|
42fb620703 | ||
|
|
b73940861f | ||
|
|
76dd775991 | ||
|
|
db4c1d049d | ||
|
|
d4f9e89577 | ||
|
|
0a2c7fd3f8 | ||
|
|
e5ee8adea1 | ||
|
|
8769616d27 | ||
|
|
13fa72f1d1 | ||
|
|
348e770ce6 | ||
|
|
fec71fd984 | ||
|
|
526a5daf5c | ||
|
|
6c9006036a | ||
|
|
7c43189715 | ||
|
|
36cf1a8d70 | ||
|
|
cb90445468 | ||
|
|
222907f436 | ||
|
|
ae0241be7d | ||
|
|
7be5a793af | ||
|
|
2d77fd6254 | ||
|
|
d8da037af9 | ||
|
|
9ff93d1c4e | ||
|
|
99e6866794 | ||
|
|
4eba4be21f | ||
|
|
aa906ada24 | ||
|
|
40ac1675ee |
586 changed files with 61668 additions and 4400 deletions
6
.build/bb.edn
Normal file
6
.build/bb.edn
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{:paths ["script"]
|
||||
:deps {borkdude/gh-release-artifact
|
||||
#_{:local/root "../gh-release-artifact"}
|
||||
{:git/url "https://github.com/borkdude/gh-release-artifact"
|
||||
:git/sha "4a9a74f0e50e897c45df8cc70684360eb30fce80"}}
|
||||
:tasks {release-artifact babashka.release-artifact/release}}
|
||||
4
.carve/ignore
Normal file
4
.carve/ignore
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
babashka.impl.pipe-signal-handler/pipe-signal-received?
|
||||
babashka.impl.pipe-signal-handler/handle-pipe!
|
||||
babashka.impl.sigint-handler/handle-sigint!
|
||||
babashka.impl.classes/generate-reflection-file
|
||||
|
|
@ -3,340 +3,38 @@
|
|||
# Check https://circleci.com/docs/2.0/language-clojure/ for more details
|
||||
#
|
||||
version: 2.1
|
||||
jobs:
|
||||
jvm:
|
||||
docker:
|
||||
# specify the version you desire here
|
||||
- image: circleci/clojure:lein-2.9.1
|
||||
working_directory: ~/repo
|
||||
environment:
|
||||
LEIN_ROOT: "true"
|
||||
BABASHKA_PLATFORM: linux # could be used in jar name
|
||||
resource_class: large
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: "Pull Submodules"
|
||||
command: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-dependencies-{{ checksum "project.clj" }}-{{ checksum "deps.edn" }}
|
||||
# fallback to using the latest cache if no exact match is found
|
||||
- v1-dependencies-
|
||||
- run:
|
||||
name: Install Clojure
|
||||
command: |
|
||||
wget -nc https://download.clojure.org/install/linux-install-1.10.1.447.sh
|
||||
chmod +x linux-install-1.10.1.447.sh
|
||||
sudo ./linux-install-1.10.1.447.sh
|
||||
- run:
|
||||
name: Install lsof
|
||||
command: |
|
||||
sudo apt-get install lsof
|
||||
- run:
|
||||
name: Run JVM tests
|
||||
command: |
|
||||
export BABASHKA_FEATURE_JDBC=true
|
||||
export BABASHKA_FEATURE_POSTGRESQL=true
|
||||
script/test
|
||||
script/run_lib_tests
|
||||
# - run:
|
||||
# name: Run as tools.deps dependency
|
||||
# command: |
|
||||
# .circleci/script/tools.deps
|
||||
- run:
|
||||
name: Run as lein command
|
||||
command: |
|
||||
.circleci/script/lein
|
||||
- run:
|
||||
name: Create uberjar
|
||||
command: |
|
||||
mkdir -p /tmp/release
|
||||
script/uberjar
|
||||
VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
cp target/babashka-$VERSION-standalone.jar /tmp/release/babashka-$VERSION-standalone.jar
|
||||
- store_artifacts:
|
||||
path: /tmp/release
|
||||
destination: release
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
key: v1-dependencies-{{ checksum "project.clj" }}-{{ checksum "deps.edn" }}
|
||||
linux:
|
||||
docker:
|
||||
- image: circleci/clojure:lein-2.9.1
|
||||
working_directory: ~/repo
|
||||
environment:
|
||||
LEIN_ROOT: "true"
|
||||
GRAALVM_HOME: /home/circleci/graalvm-ce-java11-20.2.0
|
||||
BABASHKA_PLATFORM: linux # used in release script
|
||||
BABASHKA_TEST_ENV: native
|
||||
BABASHKA_XMX: "-J-Xmx6500m"
|
||||
resource_class: large
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: "Pull Submodules"
|
||||
command: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
- restore_cache:
|
||||
keys:
|
||||
- linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- run:
|
||||
name: Install Clojure
|
||||
command: |
|
||||
wget https://download.clojure.org/install/linux-install-1.10.1.447.sh
|
||||
chmod +x linux-install-1.10.1.447.sh
|
||||
sudo ./linux-install-1.10.1.447.sh
|
||||
- run:
|
||||
name: Install lsof
|
||||
command: |
|
||||
sudo apt-get install lsof
|
||||
- run:
|
||||
name: Install native dev tools
|
||||
command: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install gcc g++ zlib1g-dev
|
||||
- run:
|
||||
name: Download GraalVM
|
||||
command: |
|
||||
cd ~
|
||||
if ! [ -d graalvm-ce-java11-20.2.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-linux-amd64-20.2.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-linux-amd64-20.2.0.tar.gz
|
||||
fi
|
||||
- run:
|
||||
name: Build binary
|
||||
command: |
|
||||
script/uberjar
|
||||
script/compile
|
||||
no_output_timeout: 30m
|
||||
- run:
|
||||
name: Run tests
|
||||
command: |
|
||||
script/test
|
||||
script/run_lib_tests
|
||||
- run:
|
||||
name: Release
|
||||
command: |
|
||||
.circleci/script/release
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
- ~/graalvm-ce-java11-20.2.0
|
||||
key: linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- store_artifacts:
|
||||
path: /tmp/release
|
||||
destination: release
|
||||
- run:
|
||||
name: Publish artifact link to Slack
|
||||
command: |
|
||||
./bb .circleci/script/publish_artifact.clj
|
||||
linux-static:
|
||||
docker:
|
||||
- image: circleci/clojure:lein-2.9.1
|
||||
working_directory: ~/repo
|
||||
environment:
|
||||
LEIN_ROOT: "true"
|
||||
GRAALVM_HOME: /home/circleci/graalvm-ce-java11-20.2.0
|
||||
BABASHKA_PLATFORM: linux-static # used in release script
|
||||
BABASHKA_TEST_ENV: native
|
||||
BABASHKA_STATIC: true
|
||||
BABASHKA_XMX: "-J-Xmx6500m"
|
||||
resource_class: large
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: "Pull Submodules"
|
||||
command: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
- restore_cache:
|
||||
keys:
|
||||
- linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- run:
|
||||
name: Install Clojure
|
||||
command: |
|
||||
wget https://download.clojure.org/install/linux-install-1.10.1.447.sh
|
||||
chmod +x linux-install-1.10.1.447.sh
|
||||
sudo ./linux-install-1.10.1.447.sh
|
||||
- run:
|
||||
name: Install lsof
|
||||
command: |
|
||||
sudo apt-get install lsof
|
||||
- run:
|
||||
name: Install native dev tools
|
||||
command: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install gcc g++ zlib1g-dev
|
||||
- run:
|
||||
name: Download GraalVM
|
||||
command: |
|
||||
cd ~
|
||||
if ! [ -d graalvm-ce-java11-20.2.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-linux-amd64-20.2.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-linux-amd64-20.2.0.tar.gz
|
||||
fi
|
||||
- run:
|
||||
name: Build binary
|
||||
command: |
|
||||
script/uberjar
|
||||
script/compile
|
||||
no_output_timeout: 30m
|
||||
- run:
|
||||
name: Run tests
|
||||
command: |
|
||||
script/test
|
||||
script/run_lib_tests
|
||||
- run:
|
||||
name: Release
|
||||
command: |
|
||||
.circleci/script/release
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
- ~/graalvm-ce-java11-20.2.0
|
||||
key: linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- store_artifacts:
|
||||
path: /tmp/release
|
||||
destination: release
|
||||
- run:
|
||||
name: Publish artifact link to Slack
|
||||
command: |
|
||||
./bb .circleci/script/publish_artifact.clj
|
||||
mac:
|
||||
macos:
|
||||
xcode: "12.0.0"
|
||||
environment:
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.13 # 10.12 is EOL
|
||||
GRAALVM_HOME: /Users/distiller/graalvm-ce-java11-20.2.0/Contents/Home
|
||||
BABASHKA_PLATFORM: macos # used in release script
|
||||
BABASHKA_TEST_ENV: native
|
||||
BABASHKA_XMX: "-J-Xmx6500m"
|
||||
resource_class: large
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: "Pull Submodules"
|
||||
command: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
- restore_cache:
|
||||
keys:
|
||||
- mac-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- run:
|
||||
name: Install Clojure
|
||||
command: |
|
||||
script/install-clojure /usr/local
|
||||
- run:
|
||||
name: Install Leiningen
|
||||
command: |
|
||||
script/install-leiningen
|
||||
- run:
|
||||
name: Download GraalVM
|
||||
command: |
|
||||
cd ~
|
||||
ls -la
|
||||
if ! [ -d graalvm-ce-java11-20.2.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-darwin-amd64-20.2.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-darwin-amd64-20.2.0.tar.gz
|
||||
fi
|
||||
- run:
|
||||
name: Build binary
|
||||
command: |
|
||||
export PATH=$GRAALVM_HOME/bin:$PATH
|
||||
script/uberjar
|
||||
script/compile
|
||||
no_output_timeout: 30m
|
||||
- run:
|
||||
name: Run tests
|
||||
command: |
|
||||
export PATH=$GRAALVM_HOME/bin:$PATH
|
||||
script/test
|
||||
script/run_lib_tests
|
||||
- run:
|
||||
name: Release
|
||||
command: |
|
||||
.circleci/script/release
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
- ~/graalvm-ce-java11-20.2.0
|
||||
key: mac-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- store_artifacts:
|
||||
path: /tmp/release
|
||||
destination: release
|
||||
- run:
|
||||
name: Publish artifact link to Slack
|
||||
command: |
|
||||
./bb .circleci/script/publish_artifact.clj
|
||||
deploy:
|
||||
resource_class: large
|
||||
docker:
|
||||
- image: circleci/clojure:lein-2.9.1
|
||||
working_directory: ~/repo
|
||||
environment:
|
||||
LEIN_ROOT: "true"
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: "Pull Submodules"
|
||||
command: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-dependencies-{{ checksum "project.clj" }}
|
||||
# fallback to using the latest cache if no exact match is found
|
||||
- v1-dependencies-
|
||||
- run: .circleci/script/deploy
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
key: v1-dependencies-{{ checksum "project.clj" }}
|
||||
docker:
|
||||
resource_class: large
|
||||
docker:
|
||||
- image: circleci/buildpack-deps:stretch
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: "Pull Submodules"
|
||||
command: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
- setup_remote_docker:
|
||||
version: 19.03.12
|
||||
- run:
|
||||
name: Build Docker image
|
||||
command: .circleci/script/docker
|
||||
|
||||
# this allows you to use CircleCI's dynamic configuration feature
|
||||
setup: true
|
||||
|
||||
# the continuation orb is required in order to use dynamic configuration
|
||||
orbs:
|
||||
continuation: circleci/continuation@0.1.2
|
||||
|
||||
# our defined job, and its steps
|
||||
jobs:
|
||||
setup:
|
||||
docker:
|
||||
- image: cimg/clojure:1.11.1
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Bootstrap Babashka
|
||||
command: |
|
||||
curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
|
||||
sudo bash install --dir /tmp
|
||||
- run:
|
||||
name: Rename bb binary
|
||||
command: mv /tmp/bb /tmp/bbb
|
||||
- run:
|
||||
name: Generate config
|
||||
command: |
|
||||
/tmp/bbb .circleci/script/gen_ci.clj > generated_config.yml
|
||||
- continuation/continue:
|
||||
configuration_path: generated_config.yml
|
||||
|
||||
# our single workflow, that triggers the setup job defined above
|
||||
workflows:
|
||||
version: 2
|
||||
ci:
|
||||
setup:
|
||||
jobs:
|
||||
- jvm
|
||||
- linux
|
||||
- linux-static
|
||||
- mac
|
||||
- deploy:
|
||||
filters:
|
||||
branches:
|
||||
only: master
|
||||
requires:
|
||||
- jvm
|
||||
- linux
|
||||
- linux-static
|
||||
- mac
|
||||
- docker:
|
||||
filters:
|
||||
branches:
|
||||
only: master
|
||||
requires:
|
||||
- jvm
|
||||
- linux
|
||||
- linux-static
|
||||
- mac
|
||||
- setup
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
image_name="borkdude/babashka"
|
||||
image_tag=$(cat resources/BABASHKA_VERSION)
|
||||
latest_tag="latest"
|
||||
|
||||
if [[ $image_tag =~ SNAPSHOT$ ]]; then
|
||||
echo "This is a snapshot version"
|
||||
snapshot="true"
|
||||
else
|
||||
echo "This is a non-snapshot version"
|
||||
snapshot="false"
|
||||
fi
|
||||
|
||||
if [ -z "$CIRCLE_PULL_REQUEST" ] && [ "$CIRCLE_BRANCH" = "master" ]; then
|
||||
echo "Building Docker image $image_name:$image_tag"
|
||||
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USER" --password-stdin
|
||||
docker build -t "$image_name" --build-arg BABASHKA_XMX="-J-Xmx6300m" .
|
||||
docker tag "$image_name:$latest_tag" "$image_name:$image_tag"
|
||||
# we only update latest when it's not a SNAPSHOT version
|
||||
if [ "false" = "$snapshot" ]; then
|
||||
echo "Pushing image $image_name:$latest_tag"
|
||||
docker push "$image_name:$latest_tag"
|
||||
fi
|
||||
# we update the version tag, even if it's a SNAPSHOT version
|
||||
echo "Pushing image $image_name:$image_tag"
|
||||
docker push "$image_name:$image_tag"
|
||||
else
|
||||
echo "Not publishing Docker image"
|
||||
fi
|
||||
|
||||
exit 0;
|
||||
125
.circleci/script/docker.clj
Normal file
125
.circleci/script/docker.clj
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
(require '[babashka.fs :as fs]
|
||||
'[babashka.process :as proc]
|
||||
'[clojure.string :as str])
|
||||
(import '[java.time Instant])
|
||||
|
||||
(defn read-env
|
||||
([k]
|
||||
(read-env k nil))
|
||||
([k default]
|
||||
(or (System/getenv k)
|
||||
default)))
|
||||
|
||||
(def image-name "babashka/babashka")
|
||||
|
||||
(def ghcr-image-name "ghcr.io/babashka/babashka")
|
||||
|
||||
(def image-tag (str/trim (slurp "resources/BABASHKA_VERSION")))
|
||||
|
||||
(def latest-tag "latest")
|
||||
|
||||
(def platforms (read-env "PLATFORMS" "linux/amd64"))
|
||||
|
||||
(def circle-repository-url (read-env "CIRCLE_REPOSITORY_URL"))
|
||||
|
||||
(def label-args
|
||||
["--label" "'org.opencontainers.image.description=Native, fast starting Clojure interpreter for scripting'"
|
||||
"--label" "org.opencontainers.image.title=Babashka"
|
||||
"--label" (str "org.opencontainers.image.created=" (Instant/now))
|
||||
"--label" (str "org.opencontainers.image.url=" circle-repository-url)
|
||||
"--label" (str "org.opencontainers.image.documentation=" circle-repository-url)
|
||||
"--label" (str "org.opencontainers.image.source=" circle-repository-url)
|
||||
"--label" (str "org.opencontainers.image.revision=" (read-env "CIRCLE_SHA1"))
|
||||
"--label"
|
||||
(format "org.opencontainers.image.ref.name=%s:%s"
|
||||
(read-env "CIRCLE_TAG")
|
||||
(read-env "CIRCLE_BRANCH"))
|
||||
"--label" (str "org.opencontainers.image.version=" image-tag)])
|
||||
|
||||
(def snapshot? (str/includes? image-tag "SNAPSHOT"))
|
||||
|
||||
(defn exec
|
||||
[cmd]
|
||||
(-> cmd
|
||||
(proc/process {:out :inherit :err :inherit})
|
||||
(proc/check)))
|
||||
|
||||
(defn docker-login
|
||||
[username password]
|
||||
(exec ["docker" "login" "-u" username "-p" password]))
|
||||
|
||||
(defn docker-login-ghcr
|
||||
[username password]
|
||||
(exec ["docker" "login" "ghcr.io" "-u" username "-p" password]))
|
||||
|
||||
;; TODO: Remove this when Dockerhub goes off
|
||||
(defn build-push
|
||||
[image-tag platform docker-file]
|
||||
(println (format "Building and pushing %s Docker image(s) %s:%s"
|
||||
platform
|
||||
image-name
|
||||
image-tag))
|
||||
(let [base-cmd ["docker" "buildx" "build"
|
||||
"-t" (str image-name ":" image-tag)
|
||||
"--platform" platform
|
||||
"--progress" "plain"
|
||||
"--push"
|
||||
"-f" docker-file]]
|
||||
(exec (concat base-cmd label-args ["."]))))
|
||||
|
||||
(defn build-push-ghcr
|
||||
[image-tag platform docker-file]
|
||||
(println (format "Building and pushing %s Docker image(s) %s:%s to GHCR"
|
||||
platform
|
||||
ghcr-image-name
|
||||
image-tag))
|
||||
(let [base-cmd ["docker" "buildx" "build"
|
||||
"-t" (str ghcr-image-name ":" image-tag)
|
||||
"--platform" platform
|
||||
"--progress" "plain"
|
||||
"--push"
|
||||
"-f" docker-file]]
|
||||
(exec (concat base-cmd label-args ["."]))))
|
||||
|
||||
(defn build-push-images
|
||||
[]
|
||||
(doseq [platform (str/split platforms #",")]
|
||||
(let [tarball-platform (str/replace platform #"\/" "-")
|
||||
tarball-platform (if (= "linux-arm64" tarball-platform)
|
||||
"linux-aarch64-static"
|
||||
tarball-platform)
|
||||
tarball-path (format "/tmp/release/babashka-%s-%s.tar.gz"
|
||||
image-tag
|
||||
tarball-platform)]
|
||||
(fs/create-dirs platform)
|
||||
(exec ["tar" "zxvf" tarball-path "-C" platform])
|
||||
; this overwrites, but this is to work around having built the uberjar/metabom multiple times
|
||||
(fs/copy (format "/tmp/release/%s-metabom.jar" tarball-platform) "metabom.jar" {:replace-existing true})))
|
||||
(build-push image-tag platforms "Dockerfile.ci")
|
||||
(build-push-ghcr image-tag platforms "Dockerfile.ci")
|
||||
(when-not snapshot?
|
||||
(build-push latest-tag platforms "Dockerfile.ci")
|
||||
(build-push-ghcr latest-tag platforms "Dockerfile.ci")))
|
||||
|
||||
(defn build-push-alpine-images
|
||||
"Build alpine image for linux-amd64 only (no upstream arm64 support yet)"
|
||||
[]
|
||||
(exec ["tar" "zxvf" (str "/tmp/release/babashka-" image-tag "-linux-amd64-static.tar.gz")])
|
||||
(build-push (str image-tag "-alpine") "linux/amd64" "Dockerfile.alpine")
|
||||
(build-push-ghcr (str image-tag "-alpine") "linux/amd64" "Dockerfile.alpine")
|
||||
(when-not snapshot?
|
||||
(build-push "alpine" "linux/amd64" "Dockerfile.alpine")
|
||||
(build-push-ghcr "alpine" "linux/amd64" "Dockerfile.alpine")))
|
||||
|
||||
(when (= *file* (System/getProperty "babashka.file"))
|
||||
(if (and (nil? (read-env "CIRCLE_PULL_REQUEST"))
|
||||
(= "master" (read-env "CIRCLE_BRANCH")))
|
||||
(do
|
||||
(if snapshot?
|
||||
(println "This is a snapshot version")
|
||||
(println "This is a non-snapshot version"))
|
||||
(docker-login (read-env "DOCKERHUB_USER") (read-env "DOCKERHUB_PASS"))
|
||||
(docker-login-ghcr (read-env "CONTAINER_REGISTRY_USER") (read-env "BB_GHCR_TOKEN"))
|
||||
(build-push-images)
|
||||
(build-push-alpine-images))
|
||||
(println "Not publishing docker image(s).")))
|
||||
281
.circleci/script/gen_ci.clj
Normal file
281
.circleci/script/gen_ci.clj
Normal file
|
|
@ -0,0 +1,281 @@
|
|||
(ns gen-ci
|
||||
(:require
|
||||
[babashka.tasks :as tasks]
|
||||
[clj-yaml.core :as yaml]
|
||||
[clojure.string :as str]
|
||||
[flatland.ordered.map :refer [ordered-map]]))
|
||||
|
||||
(def graalvm-version "24")
|
||||
|
||||
(defn run
|
||||
([cmd-name cmd]
|
||||
(run cmd-name cmd nil))
|
||||
([cmd-name cmd no-output-timeout]
|
||||
(let [base {:run {:name cmd-name
|
||||
:command cmd}}]
|
||||
(if no-output-timeout
|
||||
(assoc-in base [:run :no_output_timeout] no-output-timeout)
|
||||
base))))
|
||||
|
||||
(defn gen-steps
|
||||
[shorted? steps]
|
||||
(if shorted?
|
||||
[(run "Shorted" "echo 'Skipping Run'")]
|
||||
steps))
|
||||
|
||||
(defn gen-job
|
||||
[shorted? conf]
|
||||
(if shorted?
|
||||
(-> conf
|
||||
(dissoc :machine :macos)
|
||||
(assoc :resource_class "small" :docker [{:image "ubuntu:latest"}]))
|
||||
conf))
|
||||
|
||||
(defn pull-submodules
|
||||
[]
|
||||
(run "Pull Submodules" "git submodule init\ngit submodule update"))
|
||||
|
||||
(defn deploy
|
||||
[shorted?]
|
||||
(gen-job shorted?
|
||||
(ordered-map
|
||||
:resource_class "large"
|
||||
:docker [{:image "circleci/clojure:lein-2.9.8"}]
|
||||
:working_directory "~/repo"
|
||||
:environment {:LEIN_ROOT "true"}
|
||||
:steps (gen-steps
|
||||
shorted?
|
||||
[:checkout
|
||||
(pull-submodules)
|
||||
{:restore_cache {:keys ["v1-dependencies-{{ checksum \"project.clj\" }}"
|
||||
"v1-dependencies-"]}}
|
||||
{:run ".circleci/script/deploy"}
|
||||
{:save_cache {:paths ["~/.m2"]
|
||||
:key "v1-dependencies-{{ checksum \"project.clj\" }}"}}]))))
|
||||
|
||||
(defn docker
|
||||
[shorted?]
|
||||
(gen-job
|
||||
shorted?
|
||||
(ordered-map
|
||||
:machine {:image "ubuntu-2004:2024.05.1"}
|
||||
:steps
|
||||
(gen-steps
|
||||
shorted?
|
||||
[:checkout
|
||||
(pull-submodules)
|
||||
"setup-docker-buildx"
|
||||
{:attach_workspace {:at "/tmp"}}
|
||||
(run "Build uberjar" "script/uberjar")
|
||||
{:run
|
||||
{:name "Build Docker image"
|
||||
:environment {:PLATFORMS "linux/amd64,linux/arm64"}
|
||||
:command
|
||||
"java -jar ./target/babashka-$(cat resources/BABASHKA_VERSION)-standalone.jar .circleci/script/docker.clj"}}]))))
|
||||
|
||||
(defn jvm
|
||||
[shorted? graalvm-home]
|
||||
(gen-job
|
||||
shorted?
|
||||
(ordered-map
|
||||
:docker [{:image "circleci/clojure:openjdk-11-lein-2.9.8-bullseye"}]
|
||||
:working_directory "~/repo"
|
||||
:environment {:LEIN_ROOT "true"
|
||||
:BABASHKA_PLATFORM "linux"
|
||||
:GRAALVM_VERSION graalvm-version
|
||||
:GRAALVM_HOME graalvm-home
|
||||
:BABASHKA_TEST_ENV "jvm"
|
||||
:BABASHKA_SHA (System/getenv "CIRCLE_SHA1")}
|
||||
:resource_class "large"
|
||||
:steps
|
||||
(gen-steps
|
||||
shorted?
|
||||
[:checkout
|
||||
(pull-submodules)
|
||||
{:restore_cache {:keys ["v1-dependencies-{{ checksum \"project.clj\" }}-{{ checksum \"deps.edn\" }}"
|
||||
"v1-dependencies-"]}}
|
||||
(run "Install Clojure" "sudo script/install-clojure")
|
||||
(run "Download GraalVM" "script/install-graalvm")
|
||||
(run
|
||||
"Run JVM tests"
|
||||
"export BABASHKA_FEATURE_JDBC=true
|
||||
export BABASHKA_FEATURE_POSTGRESQL=true
|
||||
script/test\nscript/run_lib_tests")
|
||||
(run
|
||||
"Create uberjar"
|
||||
"mkdir -p /tmp/release
|
||||
script/uberjar
|
||||
VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
jar=target/babashka-$VERSION-standalone.jar
|
||||
cp $jar /tmp/release
|
||||
export PATH=$GRAALVM_HOME/bin:$PATH
|
||||
export JAVA_HOME=$GRAALVM_HOME
|
||||
java -jar $jar script/reflection.clj
|
||||
reflection=\"babashka-$VERSION-reflection.json\"
|
||||
java -jar \"$jar\" --config .build/bb.edn --deps-root . release-artifact \"$jar\"
|
||||
java -jar \"$jar\" --config .build/bb.edn --deps-root . release-artifact \"$reflection\"")
|
||||
{:store_artifacts {:path "/tmp/release"
|
||||
:destination "release"}}
|
||||
{:save_cache {:paths ["~/.m2"]
|
||||
:key "v1-dependencies-{{ checksum \"project.clj\" }}-{{ checksum \"deps.edn\" }}"}}]))))
|
||||
|
||||
(defn unix
|
||||
[shorted? static? musl? arch executor-conf resource-class graalvm-home platform]
|
||||
(let [env {:LEIN_ROOT "true"
|
||||
:GRAALVM_VERSION graalvm-version
|
||||
:GRAALVM_HOME graalvm-home
|
||||
:BABASHKA_PLATFORM (if (= "mac" platform)
|
||||
"macos"
|
||||
platform)
|
||||
:BABASHKA_TEST_ENV "native"
|
||||
:BABASHKA_XMX "-J-Xmx6500m"
|
||||
:BABASHKA_SHA (System/getenv "CIRCLE_SHA1")}
|
||||
env (if (= "aarch64" arch)
|
||||
(assoc env :BABASHKA_ARCH arch)
|
||||
env)
|
||||
env (if static?
|
||||
(assoc env :BABASHKA_STATIC "true")
|
||||
env)
|
||||
env (if musl?
|
||||
(assoc env :BABASHKA_MUSL "true")
|
||||
env)
|
||||
env (if (= "mac" platform)
|
||||
(assoc env :MACOSX_DEPLOYMENT_TARGET 10.13)
|
||||
env)
|
||||
base-install-cmd "sudo apt-get update\nsudo apt-get -y install build-essential zlib1g-dev"
|
||||
cache-key (format "%s-%s{{ checksum \"project.clj\" }}-{{ checksum \".circleci/config.yml\" }}"
|
||||
platform
|
||||
(if (= "aarch64" arch)
|
||||
"aarch64-"
|
||||
""))]
|
||||
(gen-job shorted?
|
||||
(merge
|
||||
executor-conf
|
||||
(ordered-map
|
||||
:working_directory "~/repo"
|
||||
:environment env
|
||||
:resource_class resource-class
|
||||
:steps (gen-steps shorted?
|
||||
(filter some?
|
||||
[:checkout
|
||||
(when (contains? #{"linux" "linux-aarch64"} platform)
|
||||
(run "Check max glibc version" "script/check_glibc.sh"))
|
||||
{:attach_workspace {:at "/tmp"}}
|
||||
(run "Pull Submodules" "git submodule init\ngit submodule update")
|
||||
{:restore_cache
|
||||
{:keys [cache-key]}}
|
||||
(when (= "mac" platform)
|
||||
(run "Install Rosetta" "sudo /usr/sbin/softwareupdate --install-rosetta --agree-to-license"))
|
||||
(run "Install Clojure" "sudo script/install-clojure")
|
||||
(when (= "mac" platform)
|
||||
(run "Install Leiningen" "script/install-leiningen"))
|
||||
(when (not= "mac" platform)
|
||||
(run "Install native dev tools"
|
||||
(if (and static? musl? (not= "aarch64" arch))
|
||||
(str base-install-cmd "\nsudo -E script/setup-musl")
|
||||
base-install-cmd)))
|
||||
(run "Download GraalVM" "script/install-graalvm")
|
||||
#_(run "Download iprof" "curl -sLO 'https://github.com/babashka/pgo-profiles/releases/download/2023.10.11/default.iprof'")
|
||||
(run "Build binary" (if (= "aarch64" arch)
|
||||
"script/uberjar\nscript/compile -H:PageSize=64K # --pgo=default.iprof"
|
||||
"script/uberjar\nscript/compile # --pgo=default.iprof") "30m")
|
||||
(run "Release" ".circleci/script/release")
|
||||
{:persist_to_workspace {:root "/tmp"
|
||||
:paths ["release"]}}
|
||||
(run "Run tests" "script/test\nscript/run_lib_tests")
|
||||
(run "Release + publish"
|
||||
(str/join "\n" ["export BABASHKA_RELEASE=true"
|
||||
".circleci/script/release"]))
|
||||
{:save_cache
|
||||
{:paths ["~/.m2" "~/graalvm"]
|
||||
:key cache-key}}
|
||||
{:store_artifacts {:path "/tmp/release"
|
||||
:destination "release"}}
|
||||
(run "Publish artifact link to Slack"
|
||||
"./bb .circleci/script/publish_artifact.clj || true")])))))))
|
||||
|
||||
(defn make-config
|
||||
[shorted?]
|
||||
(let [docker-executor-conf {:docker [{:image "circleci/clojure:openjdk-11-lein-2.9.8-bullseye"}]}
|
||||
machine-executor-conf {:machine {:image "ubuntu-2004:2024.05.1"}}
|
||||
mac-executor-conf {:macos {:xcode "13.4.1"}}
|
||||
linux-graalvm-home (str "/home/circleci/graalvm-" graalvm-version)
|
||||
mac-graalvm-home (format "/Users/distiller/graalvm-%s/Contents/Home" graalvm-version)]
|
||||
(ordered-map
|
||||
:version 2.1
|
||||
:commands
|
||||
{:setup-docker-buildx
|
||||
{:steps
|
||||
[{:run
|
||||
{:name "Create multi-platform capabale buildx builder"
|
||||
:command
|
||||
"docker run --privileged --rm tonistiigi/binfmt --install all\ndocker buildx create --name ci-builder --use"}}]}}
|
||||
:jobs (ordered-map
|
||||
:jvm (jvm shorted? linux-graalvm-home)
|
||||
:linux (unix shorted? false false "amd64" docker-executor-conf "large" linux-graalvm-home "linux")
|
||||
:linux-static
|
||||
(unix shorted? true true "amd64" docker-executor-conf "large" linux-graalvm-home "linux")
|
||||
:linux-aarch64-static
|
||||
(unix shorted? true false "aarch64" machine-executor-conf "arm.large" linux-graalvm-home "linux")
|
||||
:mac (unix shorted? false false "amd64" mac-executor-conf "macos.m1.medium.gen1" mac-graalvm-home "mac")
|
||||
:deploy (deploy shorted?)
|
||||
:docker (docker shorted?))
|
||||
:workflows (ordered-map
|
||||
:version 2
|
||||
:ci {:jobs ["jvm"
|
||||
"linux"
|
||||
"linux-static"
|
||||
"mac"
|
||||
"linux-aarch64-static"
|
||||
{:deploy {:filters {:branches {:only "master"}}
|
||||
:requires ["jvm" "linux"]}}
|
||||
{:docker {:filters {:branches {:only "master"}}
|
||||
:requires ["linux" "linux-static" "linux-aarch64-static"]}}]}))))
|
||||
|
||||
(def skip-config
|
||||
{:skip-if-only [#".*.md$"
|
||||
#"^logo\/.*$"]})
|
||||
|
||||
(defn get-changes
|
||||
[]
|
||||
(-> (tasks/shell {:out :string} "git diff --name-only HEAD~1")
|
||||
(:out)
|
||||
(str/split-lines)))
|
||||
|
||||
(defn irrelevant-change?
|
||||
[change regexes]
|
||||
(some? (some #(re-matches % change) regexes)))
|
||||
|
||||
(defn relevant?
|
||||
[change-set regexes]
|
||||
(some? (some #(not (irrelevant-change? % regexes)) change-set)))
|
||||
|
||||
(defn main
|
||||
[]
|
||||
(let [{:keys [skip-if-only]} skip-config
|
||||
changed-files (get-changes)
|
||||
conf (make-config (not (relevant? changed-files skip-if-only)))]
|
||||
(println (yaml/generate-string conf
|
||||
:dumper-options
|
||||
{:flow-style :block}))))
|
||||
|
||||
(when (= *file* (System/getProperty "babashka.file"))
|
||||
(main))
|
||||
|
||||
(comment
|
||||
(main)
|
||||
|
||||
(def regexes
|
||||
[#".*.md$"
|
||||
#".*.clj$" ; ignore clojure files
|
||||
#"^logo\/.*$"])
|
||||
|
||||
(:out (tasks/shell {:out :string} "ls"))
|
||||
|
||||
(irrelevant-change? "src/file.png" regexes)
|
||||
|
||||
(re-matches #".*.clj$" "src/file.clj.dfff")
|
||||
|
||||
(re-matches #"^logo\/.*$" "logo/foo/bar.jpg")
|
||||
|
||||
(relevant? ["src/file.clj"] regexes))
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
'[clojure.java.io :as io]
|
||||
'[clojure.string :as str])
|
||||
|
||||
(def channel "#babashka_circleci_builds")
|
||||
(def channel "#babashka-circleci-builds")
|
||||
#_(def channel "#_test")
|
||||
(def babashka-version (str/trim (slurp (io/file "resources" "BABASHKA_VERSION"))))
|
||||
(def slack-hook-url (System/getenv "SLACK_HOOK_URL"))
|
||||
|
|
@ -16,19 +16,28 @@
|
|||
(curl/post slack-hook-url {:headers {"content-type" "application/json"}
|
||||
:body json}))))
|
||||
|
||||
(def release-text (format "[%s - %s@%s]: https://%s-201467090-gh.circle-artifacts.com/0/release/babashka-%s-%s-amd64.zip"
|
||||
(System/getenv "BABASHKA_PLATFORM")
|
||||
(def platform
|
||||
(str (System/getenv "BABASHKA_PLATFORM")
|
||||
"-"
|
||||
(or (System/getenv "BABASHKA_ARCH") "amd64")
|
||||
(when (= "true" (System/getenv "BABASHKA_STATIC"))
|
||||
"-static")))
|
||||
|
||||
(def release-text (format "[%s - %s@%s - %s]: https://%s-201467090-gh.circle-artifacts.com/0/release/babashka-%s-%s.tar.gz"
|
||||
platform
|
||||
(System/getenv "CIRCLE_BRANCH")
|
||||
(System/getenv "CIRCLE_SHA1")
|
||||
(slurp (io/file "/tmp/bb_size/size"))
|
||||
(System/getenv "CIRCLE_BUILD_NUM")
|
||||
babashka-version
|
||||
(System/getenv "BABASHKA_PLATFORM")))
|
||||
platform
|
||||
))
|
||||
|
||||
(slack! release-text)
|
||||
|
||||
(def binary-size-text
|
||||
#_#_(def binary-size-text
|
||||
(format "[%s - %s@%s] binary size: %s"
|
||||
(System/getenv "BABASHKA_PLATFORM")
|
||||
platform
|
||||
(System/getenv "CIRCLE_BRANCH")
|
||||
(System/getenv "CIRCLE_SHA1")
|
||||
(slurp (io/file "/tmp/bb_size/size"))))
|
||||
|
|
|
|||
|
|
@ -3,18 +3,37 @@
|
|||
rm -rf /tmp/release
|
||||
mkdir -p /tmp/release
|
||||
cp bb /tmp/release
|
||||
# cp src-bash/bbk /tmp/release
|
||||
|
||||
VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
|
||||
|
||||
|
||||
## release binary as tar.gz archive
|
||||
|
||||
arch=${BABASHKA_ARCH:-amd64}
|
||||
|
||||
if [ "$BABASHKA_STATIC" = "true" ]; then
|
||||
arch="$arch-static"
|
||||
fi
|
||||
|
||||
# because circle won't allow the same file to be saved/restored in the same workspace concurrently
|
||||
cp metabom.jar "/tmp/release/$BABASHKA_PLATFORM-$arch-metabom.jar"
|
||||
|
||||
cd /tmp/release
|
||||
mkdir -p /tmp/bb_size
|
||||
./bb '(spit "/tmp/bb_size/size" (.length (io/file "bb")))'
|
||||
|
||||
## release binary as zip archive
|
||||
archive="babashka-$VERSION-$BABASHKA_PLATFORM-$arch.tar.gz"
|
||||
|
||||
zip "babashka-$VERSION-$BABASHKA_PLATFORM-amd64.zip" bb # bbk
|
||||
tar zcvf "$archive" bb # bbk
|
||||
|
||||
cd -
|
||||
|
||||
if [ "$BABASHKA_RELEASE" = "true" ]; then
|
||||
./bb --config .build/bb.edn --deps-root . release-artifact "/tmp/release/$archive"
|
||||
fi
|
||||
|
||||
## cleanup
|
||||
|
||||
cd /tmp/release
|
||||
rm bb # bbk
|
||||
|
|
|
|||
42
.cirrus.yml
Normal file
42
.cirrus.yml
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
macos_instance:
|
||||
image: ghcr.io/cirruslabs/macos-monterey-base:latest
|
||||
|
||||
task:
|
||||
skip: "changesIncludeOnly('logo/*', '**.md')"
|
||||
env:
|
||||
LEIN_ROOT: "true"
|
||||
GRAALVM_VERSION: "24"
|
||||
GRAALVM_HOME: ${HOME}/graalvm-${GRAALVM_VERSION}/Contents/Home
|
||||
BABASHKA_PLATFORM: macos # used in release script
|
||||
BABASHKA_ARCH: aarch64
|
||||
BABASHKA_TEST_ENV: native
|
||||
BABASHKA_XMX: "-J-Xmx6500m"
|
||||
GITHUB_TOKEN: ENCRYPTED[d6ff8cdc392157f211c754fa0763875434d1bfde0c00a05e48ba9470003a76c14c9213adb80623f81e13f2f0fa8fbd57]
|
||||
script: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
|
||||
sudo script/install-clojure
|
||||
sudo script/install-leiningen
|
||||
script/install-graalvm
|
||||
export PATH=$GRAALVM_HOME/bin:$PATH
|
||||
export JAVA_HOME=$GRAALVM_HOME
|
||||
sudo /usr/sbin/softwareupdate --install-rosetta --agree-to-license
|
||||
java -version
|
||||
|
||||
export BABASHKA_SHA=$(git rev-parse HEAD)
|
||||
|
||||
script/uberjar
|
||||
# curl -sLO 'https://github.com/babashka/pgo-profiles/releases/download/2023.10.11/default.iprof'
|
||||
script/compile # --pgo=default.iprof
|
||||
|
||||
# script/test
|
||||
# script/run_lib_tests
|
||||
|
||||
VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
arch=${BABASHKA_ARCH:-amd64}
|
||||
archive="babashka-$VERSION-$BABASHKA_PLATFORM-$arch.tar.gz"
|
||||
tar zcvf "$archive" bb
|
||||
./bb --config .build/bb.edn --deps-root . release-artifact "$archive" || true
|
||||
binaries_artifacts:
|
||||
path: "babashka-*.tar.gz"
|
||||
1
.clj-kondo/babashka/fs/config.edn
Normal file
1
.clj-kondo/babashka/fs/config.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
{:lint-as {babashka.fs/with-temp-dir clojure.core/let}}
|
||||
1
.clj-kondo/babashka/sci/config.edn
Normal file
1
.clj-kondo/babashka/sci/config.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
{:hooks {:macroexpand {sci.core/copy-ns sci.core/copy-ns}}}
|
||||
9
.clj-kondo/babashka/sci/sci/core.clj
Normal file
9
.clj-kondo/babashka/sci/sci/core.clj
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
(ns sci.core)
|
||||
|
||||
(defmacro copy-ns
|
||||
([ns-sym sci-ns]
|
||||
`(copy-ns ~ns-sym ~sci-ns nil))
|
||||
([ns-sym sci-ns opts]
|
||||
`[(quote ~ns-sym)
|
||||
~sci-ns
|
||||
(quote ~opts)]))
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
{:lint-as {me.raynes.conch/let-programs clojure.core/let
|
||||
{:config-paths ["babashka/sci"]
|
||||
:lint-as {me.raynes.conch/let-programs clojure.core/let
|
||||
babashka.impl.File/gen-wrapper-fn clojure.core/def
|
||||
babashka.impl.Pattern/gen-wrapper-fn clojure.core/def
|
||||
babashka.impl.File/gen-wrapper-fn-2 clojure.core/def
|
||||
babashka.impl.Pattern/gen-wrapper-fn-2 clojure.core/def
|
||||
babashka.impl.Pattern/gen-constants clojure.core/declare}
|
||||
:linters {:unsorted-required-namespaces {:level :warning}}}
|
||||
:linters {:unsorted-required-namespaces {:level :warning}}
|
||||
:hooks {:analyze-call {clojure.core/requiring-resolve hooks.mine/req-resolve}}}
|
||||
|
|
|
|||
5
.clj-kondo/rewrite-clj/rewrite-clj/config.edn
Normal file
5
.clj-kondo/rewrite-clj/rewrite-clj/config.edn
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{:lint-as
|
||||
{rewrite-clj.zip/subedit-> clojure.core/->
|
||||
rewrite-clj.zip/subedit->> clojure.core/->>
|
||||
rewrite-clj.zip/edit-> clojure.core/->
|
||||
rewrite-clj.zip/edit->> clojure.core/->>}}
|
||||
2
.dir-locals.el
Normal file
2
.dir-locals.el
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
((clojure-mode
|
||||
(cider-clojure-cli-aliases . "test")))
|
||||
|
|
@ -12,7 +12,8 @@ test/
|
|||
.gitmodules
|
||||
appveyor.yml
|
||||
CHANGES.md
|
||||
deps.edn
|
||||
Dockerfile
|
||||
LICENSE
|
||||
README.md
|
||||
.cpcache/
|
||||
target/
|
||||
|
|
|
|||
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
|
|
@ -1,7 +1,6 @@
|
|||
# These are supported funding model platforms
|
||||
|
||||
github: borkdude # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: borkdude
|
||||
open_collective: babashka
|
||||
ko_fi: borkdude
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
|
|
|
|||
3
.github/ISSUE_TEMPLATE/bug_report.md
vendored
3
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
|
@ -7,6 +7,9 @@ assignees: ''
|
|||
|
||||
---
|
||||
|
||||
[ To keep development of this project going, consider sponsoring. If you are
|
||||
already a sponsor, thank you! ]
|
||||
|
||||
**version**
|
||||
|
||||
[ Please specify which version of babashka you're using. You can find this with `babashka --version`. The documentation on the master branch may be ahead of the most released version. ]
|
||||
|
|
|
|||
3
.github/ISSUE_TEMPLATE/feature_request.md
vendored
3
.github/ISSUE_TEMPLATE/feature_request.md
vendored
|
|
@ -7,6 +7,9 @@ assignees: ''
|
|||
|
||||
---
|
||||
|
||||
[ To keep development of this project going, consider sponsoring. If you are
|
||||
already a sponsor, thank you! ]
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
|
|
|
|||
9
.github/pull_request_template.md
vendored
Normal file
9
.github/pull_request_template.md
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
Please answer the following questions and leave the below in as part of your PR.
|
||||
|
||||
- [ ] I have read the [developer documentation](https://github.com/babashka/babashka/blob/master/doc/dev.md).
|
||||
|
||||
- [ ] This PR corresponds to an [issue with a clear problem statement](https://github.com/babashka/babashka/blob/master/doc/dev.md#start-with-an-issue-before-writing-code).
|
||||
|
||||
- [ ] This PR contains a [test](https://github.com/babashka/babashka/blob/master/doc/dev.md#tests) to prevent against future regressions
|
||||
|
||||
- [ ] I have updated the [CHANGELOG.md](https://github.com/babashka/babashka/blob/master/CHANGELOG.md) file with a description of the addressed issue.
|
||||
15
.github/script/docker
vendored
15
.github/script/docker
vendored
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
set -eo pipefail
|
||||
|
||||
image_name="borkdude/babashka"
|
||||
image_name="babashka/babashka"
|
||||
image_tag=$(cat resources/BABASHKA_VERSION)
|
||||
latest_tag="latest"
|
||||
|
||||
|
|
@ -19,16 +19,27 @@ if [ -z "$GITHUB_HEAD_REF" ] && [ "${GITHUB_REF##*/}" = "master" ]
|
|||
then
|
||||
echo "Building Docker image $image_name:$image_tag"
|
||||
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USER" --password-stdin
|
||||
docker build -t "$image_name" --build-arg BABASHKA_XMX="-J-Xmx6300m" .
|
||||
mv /tmp/release/bb .
|
||||
docker build -t "$image_name" -f Dockerfile.ci .
|
||||
docker tag "$image_name:$latest_tag" "$image_name:$image_tag"
|
||||
if [[ $snapshot == "false" ]]; then
|
||||
mv /tmp/release-static/bb .
|
||||
docker build -t "$image_name:alpine" -f Dockerfile.alpine .
|
||||
docker tag "$image_name:alpine" "$image_name:$image_tag-alpine"
|
||||
fi
|
||||
# we only update latest when it's not a SNAPSHOT version
|
||||
if [ "false" = "$snapshot" ]; then
|
||||
echo "Pushing image $image_name:$latest_tag"
|
||||
docker push "$image_name:$latest_tag"
|
||||
echo "Pushing image $image_name:alpine"
|
||||
docker push "$image_name:alpine"
|
||||
fi
|
||||
# we update the version tag, even if it's a SNAPSHOT version
|
||||
echo "Pushing image $image_name:$image_tag"
|
||||
docker push "$image_name:$image_tag"
|
||||
if [[ $snapshot == "false" ]]; then
|
||||
docker push "$image_name:$image_tag-alpine"
|
||||
fi
|
||||
else
|
||||
echo "Not publishing Docker image"
|
||||
fi
|
||||
|
|
|
|||
99
.github/workflows/build-windows.yml
vendored
Normal file
99
.github/workflows/build-windows.yml
vendored
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "logo/**"
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "logo/**"
|
||||
|
||||
# TODO: Add deploy if needed
|
||||
jobs:
|
||||
native:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-2022
|
||||
name: windows
|
||||
static: false
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
LEIN_ROOT: "true"
|
||||
GRAALVM_VERSION: "24"
|
||||
BABASHKA_PLATFORM: ${{ matrix.name }} # used in release script
|
||||
BABASHKA_TEST_ENV: native
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BABASHKA_SHA: ${{ github.sha }}
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
||||
- name: Cache deps
|
||||
uses: actions/cache@v4
|
||||
id: cache-deps
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }}
|
||||
restore-keys: ${{ runner.os }}-maven-
|
||||
|
||||
- name: Setup GraalVM
|
||||
if: "matrix.static == false"
|
||||
uses: graalvm/setup-graalvm@v1.3.3
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'graalvm'
|
||||
components: 'native-image'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install clojure tools
|
||||
uses: DeLaGuardo/setup-clojure@13.2
|
||||
with:
|
||||
cli: latest
|
||||
# lein: latest -- skipped because this uses some PS bullshit
|
||||
|
||||
- name: Babashka version
|
||||
id: babashka-version
|
||||
shell: bash
|
||||
run: |
|
||||
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
echo "##[set-output name=version;]${BABASHKA_VERSION}"
|
||||
|
||||
- name: Build
|
||||
shell: cmd
|
||||
run: |
|
||||
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.bat', 'lein.bat')"
|
||||
call lein self-install
|
||||
|
||||
set GRAALVM_HOME=%JAVA_HOME%
|
||||
call script/uberjar.bat
|
||||
|
||||
call script/compile.bat
|
||||
|
||||
echo Creating zip archive
|
||||
|
||||
set zip=babashka-%BABASHKA_VERSION%-windows-amd64.zip
|
||||
|
||||
jar -cMf %zip% bb.exe
|
||||
|
||||
bb --config .build/bb.edn --deps-root . release-artifact %zip%
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: bb.exe
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-${{ matrix.name }}-amd64
|
||||
|
||||
- name: Test binary and libs
|
||||
shell: cmd
|
||||
run: |
|
||||
set BABASHKA_CLASSPATH=
|
||||
set BABASHKA_TEST_ENV=native
|
||||
call script/test.bat :windows
|
||||
call script/run_lib_tests.bat
|
||||
463
.github/workflows/build.yml
vendored
463
.github/workflows/build.yml
vendored
|
|
@ -1,82 +1,76 @@
|
|||
name: build
|
||||
|
||||
on: [push
|
||||
, pull_request
|
||||
]
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "logo/**"
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "logo/**"
|
||||
branches:
|
||||
- master
|
||||
|
||||
# TODO: Add deploy if needed
|
||||
jobs:
|
||||
|
||||
scratch:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
||||
- name: Scratch
|
||||
run: |
|
||||
echo "Scratch"
|
||||
|
||||
jvm:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
# ubuntu 18.04 comes with lein + java8 installed
|
||||
runs-on: ubuntu-18.04
|
||||
if: ${{ false }} # Disabled
|
||||
# if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
LEIN_ROOT: "true"
|
||||
BABASHKA_PLATFORM: linux # could be used in jar name
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BABASHKA_SHA: ${{ github.sha }}
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v1
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
||||
- name: Cache deps
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v4
|
||||
id: cache-deps
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
restore-keys: ${{ runner.os }}-maven-
|
||||
|
||||
- name: Cache GraalVM
|
||||
uses: actions/cache@v1
|
||||
id: cache-graalvm
|
||||
- name: Prepare java
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
path: ~/graalvm-ce-java11-20.2.0
|
||||
key: ${{ runner.os }}-graalvm-20.2.0
|
||||
restore-keys: |
|
||||
${{ runner.os }}-graalvm-20.2.0
|
||||
distribution: 'adopt-hotspot'
|
||||
java-version: '19'
|
||||
|
||||
- name: Download GraalVM
|
||||
run: |
|
||||
cd ~
|
||||
if ! [ -d graalvm-ce-java11-20.2.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-linux-amd64-20.2.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-linux-amd64-20.2.0.tar.gz
|
||||
fi
|
||||
|
||||
- name: Fetch deps
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
lein deps
|
||||
- name: Install clojure tools
|
||||
uses: DeLaGuardo/setup-clojure@5.0
|
||||
with:
|
||||
cli: 1.10.3.1040
|
||||
lein: 2.9.8
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
BABASHKA_FEATURE_JDBC: "true"
|
||||
BABASHKA_FEATURE_POSTGRESQL: "true"
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-20.2.0"
|
||||
script/test
|
||||
|
||||
- name: Test libraries
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-20.2.0"
|
||||
sudo script/install-clojure
|
||||
script/run_lib_tests
|
||||
|
||||
- name: Build uberjar
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-20.2.0"
|
||||
mkdir -p /tmp/release
|
||||
script/uberjar
|
||||
VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
jar=target/babashka-$VERSION-standalone.jar
|
||||
cp $jar /tmp/release
|
||||
java -jar $jar script/reflection.clj
|
||||
reflection="babashka-$VERSION-reflection.json"
|
||||
java -jar "$jar" --config .build/bb.edn --deps-root . release-artifact "$jar"
|
||||
java -jar "$jar" --config .build/bb.edn --deps-root . release-artifact "$reflection"
|
||||
|
||||
- name: Babashka version
|
||||
id: babashka-version
|
||||
|
|
@ -84,66 +78,79 @@ jobs:
|
|||
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
echo "##[set-output name=version;]${BABASHKA_VERSION}"
|
||||
|
||||
- name: Reflection artifact
|
||||
run: |
|
||||
cp reflection.json babashka-${{ steps.babashka-version.outputs.version }}-reflection.json
|
||||
|
||||
- uses: actions/upload-artifact@v1
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: jar
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar
|
||||
path: target/babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar
|
||||
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: reflection.json
|
||||
path: babashka-${{ steps.babashka-version.outputs.version }}-reflection.json
|
||||
|
||||
linux:
|
||||
native:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
needs: [jvm]
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: macos-13
|
||||
name: macos
|
||||
static: false
|
||||
#- os: ubuntu-latest
|
||||
# name: linux
|
||||
# static: false
|
||||
#- os: ubuntu-latest
|
||||
# name: linux
|
||||
# static: true
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
LEIN_ROOT: "true"
|
||||
GRAALVM_VERSION: "24"
|
||||
BABASHKA_PLATFORM: ${{ matrix.name }} # used in release script
|
||||
BABASHKA_TEST_ENV: native
|
||||
BABASHKA_XMX: "-J-Xmx6500m"
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BABASHKA_SHA: ${{ github.sha }}
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v1
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: jar
|
||||
path: .
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: reflection.json
|
||||
path: .
|
||||
|
||||
- name: Cache deps
|
||||
uses: actions/cache@v1
|
||||
uses: actions/cache@v4
|
||||
id: cache-deps
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
restore-keys: ${{ runner.os }}-maven-
|
||||
|
||||
- name: Cache GraalVM
|
||||
uses: actions/cache@v1
|
||||
id: cache-graalvm
|
||||
- name: Setup GraalVM
|
||||
if: "matrix.static == false"
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
path: ~/graalvm-ce-java11-20.2.0
|
||||
key: ${{ runner.os }}-graalvm-20.2.0
|
||||
restore-keys: |
|
||||
${{ runner.os }}-graalvm-20.2.0
|
||||
java-version: '24'
|
||||
distribution: 'graalvm'
|
||||
components: 'native-image'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Download GraalVM
|
||||
- name: Setup GraalVM+musl
|
||||
if: "matrix.static == true"
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '24'
|
||||
distribution: 'graalvm'
|
||||
components: 'native-image'
|
||||
native-image-musl: true
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install clojure tools
|
||||
uses: DeLaGuardo/setup-clojure@5.0
|
||||
with:
|
||||
cli: 1.10.3.1040
|
||||
lein: 2.9.8
|
||||
|
||||
- name: Install native dev tools
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
cd ~
|
||||
if ! [ -d graalvm-ce-java11-20.2.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-linux-amd64-20.2.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-linux-amd64-20.2.0.tar.gz
|
||||
fi
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install build-essential zlib1g-dev
|
||||
|
||||
- name: Babashka version
|
||||
id: babashka-version
|
||||
|
|
@ -151,225 +158,85 @@ jobs:
|
|||
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
echo "##[set-output name=version;]${BABASHKA_VERSION}"
|
||||
|
||||
- name: Build Linux native image
|
||||
run: |
|
||||
export BABASHKA_JAR=babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar
|
||||
export BABASHKA_XMX="-J-Xmx6g"
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-20.2.0"
|
||||
cp babashka-${{ steps.babashka-version.outputs.version }}-reflection.json reflection.json
|
||||
script/compile
|
||||
- name: Build uberjar
|
||||
run: script/uberjar
|
||||
|
||||
- name: Test binary
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-20.2.0"
|
||||
BABASHKA_TEST_ENV=native script/test
|
||||
- name: Build native image
|
||||
if: "matrix.static == false"
|
||||
run: script/compile
|
||||
|
||||
- name: Install clojure
|
||||
run: |
|
||||
sudo script/install-clojure /usr/local
|
||||
|
||||
- name: Test libraries
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-20.2.0"
|
||||
BABASHKA_TEST_ENV=native script/run_lib_tests
|
||||
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
path: bb
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-linux-amd64.zip
|
||||
|
||||
linux-static:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
needs: [jvm]
|
||||
runs-on: ubuntu-16.04
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: jar
|
||||
path: .
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: reflection.json
|
||||
path: .
|
||||
|
||||
- name: Cache deps
|
||||
uses: actions/cache@v1
|
||||
id: cache-deps
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Cache GraalVM
|
||||
uses: actions/cache@v1
|
||||
id: cache-graalvm
|
||||
with:
|
||||
path: ~/graalvm-ce-java11-20.2.0
|
||||
key: ${{ runner.os }}-graalvm-20.2.0
|
||||
restore-keys: |
|
||||
${{ runner.os }}-graalvm-20.2.0
|
||||
|
||||
- name: Download GraalVM
|
||||
run: |
|
||||
cd ~
|
||||
if ! [ -d graalvm-ce-java11-20.2.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-linux-amd64-20.2.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-linux-amd64-20.2.0.tar.gz
|
||||
fi
|
||||
|
||||
- name: Babashka version
|
||||
id: babashka-version
|
||||
run: |
|
||||
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
echo "##[set-output name=version;]${BABASHKA_VERSION}"
|
||||
|
||||
- name: Build Linux native image
|
||||
run: |
|
||||
export BABASHKA_JAR=babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar
|
||||
export BABASHKA_XMX="-J-Xmx6g"
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-20.2.0"
|
||||
export BABASHKA_STATIC=true
|
||||
cp babashka-${{ steps.babashka-version.outputs.version }}-reflection.json reflection.json
|
||||
script/compile
|
||||
|
||||
- name: Test binary
|
||||
run: |
|
||||
./bb '(+ 1 2 3)'
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-20.2.0"
|
||||
BABASHKA_TEST_ENV=native script/test
|
||||
|
||||
- name: Install clojure
|
||||
run: |
|
||||
sudo script/install-clojure
|
||||
|
||||
- name: Test libraries
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-20.2.0"
|
||||
BABASHKA_TEST_ENV=native script/run_lib_tests
|
||||
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
path: bb
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-linux-static-amd64.zip
|
||||
|
||||
mac:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
needs: [jvm]
|
||||
runs-on: macOS-latest
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: jar
|
||||
path: .
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: reflection.json
|
||||
path: .
|
||||
|
||||
- name: Cache GraalVM
|
||||
uses: actions/cache@v1
|
||||
id: cache-graalvm
|
||||
with:
|
||||
path: ~/graalvm-ce-java11-20.2.0
|
||||
key: ${{ runner.os }}-graalvm-20.2.0
|
||||
restore-keys: |
|
||||
${{ runner.os }}-graalvm-20.2.0
|
||||
|
||||
- name: Download GraalVM
|
||||
run: |
|
||||
cd ~
|
||||
if ! [ -d graalvm-ce-java11-20.2.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-darwin-amd64-20.2.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-darwin-amd64-20.2.0.tar.gz
|
||||
fi
|
||||
|
||||
- name: Babashka version
|
||||
id: babashka-version
|
||||
run: |
|
||||
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
echo "##[set-output name=version;]${BABASHKA_VERSION}"
|
||||
|
||||
- name: Build macOS native image
|
||||
run: |
|
||||
export BABASHKA_JAR=babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar
|
||||
export BABASHKA_XMX="-J-Xmx6g"
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-20.2.0/Contents/Home"
|
||||
cp babashka-${{ steps.babashka-version.outputs.version }}-reflection.json reflection.json
|
||||
script/compile
|
||||
|
||||
- name: Test binary
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-20.2.0/Contents/Home"
|
||||
sudo script/install-leiningen
|
||||
BABASHKA_TEST_ENV=native script/test
|
||||
|
||||
- name: Test libraries
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-20.2.0/Contents/Home"
|
||||
sudo script/install-clojure
|
||||
BABASHKA_TEST_ENV=native script/run_lib_tests
|
||||
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
path: bb
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-macos-amd64.zip
|
||||
|
||||
deploy:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name == 'push' && github.ref == 'refs/heads/master'"
|
||||
needs: [jvm, linux, linux-static, mac]
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
||||
- name: Cache deps
|
||||
uses: actions/cache@v1
|
||||
id: cache-deps
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Deploy
|
||||
- name: Build static native image
|
||||
if: "matrix.static == true"
|
||||
env:
|
||||
CLOJARS_USER: "${{ secrets.CLOJARS_USER }}"
|
||||
CLOJARS_PASS: "${{ secrets.CLOJARS_PASS }}"
|
||||
BABASHKA_STATIC: "true"
|
||||
BABASHKA_MUSL: "true"
|
||||
run: script/compile
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: bb
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-${{ matrix.name }}-amd64
|
||||
|
||||
- name: Upload static artifact
|
||||
if: "matrix.static == true"
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: bb
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-${{ matrix.name }}-static-amd64
|
||||
|
||||
- name: Test binary and libs
|
||||
run: |
|
||||
.github/script/deploy
|
||||
script/test
|
||||
script/run_lib_tests
|
||||
|
||||
- name: Release
|
||||
run: .circleci/script/release
|
||||
|
||||
docker:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name == 'push' && github.ref == 'refs/heads/master'"
|
||||
needs: [jvm, linux, linux-static, mac]
|
||||
runs-on: ubuntu-18.04
|
||||
if: ${{ false }} # Disabled
|
||||
# if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name == 'push' && github.ref == 'refs/heads/master'"
|
||||
needs:
|
||||
- native
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v1
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
||||
- name: Babashka version
|
||||
id: babashka-version
|
||||
run: |
|
||||
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
echo "##[set-output name=version;]${BABASHKA_VERSION}"
|
||||
|
||||
- name: Make release dir
|
||||
run: mkdir -p /tmp/release
|
||||
|
||||
- name: Download linux binary
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
with:
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-linux-amd64.zip
|
||||
path: /tmp/release
|
||||
|
||||
- name: Download static linux binary
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
with:
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-linux-static-amd64.zip
|
||||
path: /tmp/release-static
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Build uberjar
|
||||
run: script/uberjar
|
||||
|
||||
- name: Docker build
|
||||
env:
|
||||
DOCKERHUB_USER: "${{ secrets.DOCKERHUB_USER }}"
|
||||
DOCKERHUB_PASS: "${{ secrets.DOCKERHUB_PASS }}"
|
||||
run: |
|
||||
.github/script/docker
|
||||
PLATFORMS: linux/amd64,linux/arm64
|
||||
run: java -jar ./target/babashka-$(cat resources/BABASHKA_VERSION)-standalone.jar .circleci/script/docker.clj
|
||||
|
|
|
|||
11
.gitignore
vendored
11
.gitignore
vendored
|
|
@ -16,7 +16,7 @@ pom.xml.asc
|
|||
!test-resources/babashka/src_for_classpath_test/foo.jar
|
||||
!test-resources/pom.xml
|
||||
.cpcache
|
||||
*reflection.json
|
||||
*reflect-config.json
|
||||
/tmp
|
||||
/reports
|
||||
*.dylib
|
||||
|
|
@ -30,3 +30,12 @@ org_babashka*.h
|
|||
/bb.stripped.pdb
|
||||
/.calva
|
||||
!test-resources/divide_by_zero.jar
|
||||
.envrc
|
||||
.lsp
|
||||
bb.build_artifacts.txt
|
||||
target
|
||||
.nrepl-port
|
||||
.DS_Store
|
||||
.portal
|
||||
default.iprof
|
||||
scratch.clj
|
||||
|
|
|
|||
11
.gitmodules
vendored
11
.gitmodules
vendored
|
|
@ -4,7 +4,7 @@
|
|||
branch = master
|
||||
[submodule "babashka.curl"]
|
||||
path = babashka.curl
|
||||
url = https://github.com/borkdude/babashka.curl
|
||||
url = https://github.com/babashka/babashka.curl
|
||||
[submodule "babashka.nrepl"]
|
||||
path = babashka.nrepl
|
||||
url = https://github.com/babashka/babashka.nrepl
|
||||
|
|
@ -17,3 +17,12 @@
|
|||
[submodule "pods"]
|
||||
path = pods
|
||||
url = https://github.com/babashka/pods
|
||||
[submodule "deps.clj"]
|
||||
path = deps.clj
|
||||
url = https://github.com/borkdude/deps.clj
|
||||
[submodule "fs"]
|
||||
path = fs
|
||||
url = https://github.com/babashka/fs
|
||||
[submodule "babashka.core"]
|
||||
path = babashka.core
|
||||
url = https://github.com/babashka/babashka.core.git
|
||||
|
|
|
|||
1518
CHANGELOG.md
1518
CHANGELOG.md
File diff suppressed because it is too large
Load diff
74
Dockerfile
74
Dockerfile
|
|
@ -1,23 +1,81 @@
|
|||
FROM clojure:lein-2.9.1 AS BASE
|
||||
ARG BABASHKA_XMX="-J-Xmx3g"
|
||||
FROM clojure:openjdk-11-lein-2.9.6-bullseye AS BASE
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt update
|
||||
RUN apt install --no-install-recommends -yy curl unzip build-essential zlib1g-dev
|
||||
RUN apt install --no-install-recommends -yy build-essential zlib1g-dev
|
||||
WORKDIR "/opt"
|
||||
RUN curl -sLO https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-linux-amd64-20.2.0.tar.gz
|
||||
RUN tar -xzf graalvm-ce-java11-linux-amd64-20.2.0.tar.gz
|
||||
|
||||
ENV GRAALVM_HOME="/opt/graalvm-ce-java11-20.2.0"
|
||||
ENV JAVA_HOME="/opt/graalvm-ce-java11-20.2.0/bin"
|
||||
ENV GRAALVM_VERSION="24"
|
||||
ARG TARGETARCH
|
||||
# Do not set those directly, use TARGETARCH instead
|
||||
ENV BABASHKA_ARCH=
|
||||
ENV GRAALVM_ARCH=
|
||||
RUN if [ "${TARGETARCH}" = "" ] || [ "${TARGETARCH}" = "amd64" ]; then \
|
||||
export GRAALVM_ARCH=x64; export BABASHKA_ARCH=x86_64; \
|
||||
elif [ "${TARGETARCH}" = "arm64" ]; then \
|
||||
export GRAALVM_ARCH=aarch64; \
|
||||
fi && \
|
||||
echo "Installing GraalVM for ${GRAALVM_ARCH}" && \
|
||||
curl -sLO https://download.oracle.com/graalvm/${GRAALVM_VERSION}/archive/graalvm-jdk-${GRAALVM_VERSION}_linux-${GRAALVM_ARCH}_bin.tar.gz && \
|
||||
mkdir "graalvm-$GRAALVM_VERSION" && \
|
||||
tar -xzf graalvm-jdk-${GRAALVM_VERSION}_linux-${GRAALVM_ARCH}_bin.tar.gz -C graalvm-$GRAALVM_VERSION --strip-components 1
|
||||
|
||||
ARG BABASHKA_XMX="-J-Xmx4500m"
|
||||
|
||||
ENV GRAALVM_HOME="/opt/graalvm-$GRAALVM_VERSION"
|
||||
ENV JAVA_HOME="$GRAALVM_HOME/bin"
|
||||
ENV PATH="$JAVA_HOME:$PATH"
|
||||
ENV BABASHKA_XMX=$BABASHKA_XMX
|
||||
|
||||
# Make it possible to use Docker to build bb with a particular set of features
|
||||
# by setting them at build time via `docker build --build-arg ARG_NAME=true ...`
|
||||
ARG BABASHKA_LEAN=
|
||||
ARG BABASHKA_MUSL=
|
||||
ARG BABASHKA_FEATURE_CSV=
|
||||
ARG BABASHKA_FEATURE_JAVA_NET_HTTP=
|
||||
ARG BABASHKA_FEATURE_JAVA_NIO=
|
||||
ARG BABASHKA_FEATURE_JAVA_TIME=
|
||||
ARG BABASHKA_FEATURE_TRANSIT=
|
||||
ARG BABASHKA_FEATURE_XML=
|
||||
ARG BABASHKA_FEATURE_YAML=
|
||||
ARG BABASHKA_FEATURE_HTTPKIT_CLIENT=
|
||||
ARG BABASHKA_FEATURE_HTTPKIT_SERVER=
|
||||
ARG BABASHKA_FEATURE_JDBC=
|
||||
ARG BABASHKA_FEATURE_POSTGRESQL=
|
||||
ARG BABASHKA_FEATURE_HSQLDB=
|
||||
ARG BABASHKA_FEATURE_ORACLEDB=
|
||||
ARG BABASHKA_FEATURE_DATASCRIPT=
|
||||
ARG BABASHKA_FEATURE_LANTERNA=
|
||||
ARG BABASHKA_STATIC=
|
||||
ENV BABASHKA_LEAN=$BABASHKA_LEAN
|
||||
ENV BABASHKA_FEATURE_CSV=$BABASHKA_FEATURE_CSV
|
||||
ENV BABASHKA_FEATURE_JAVA_NET_HTTP=$BABASHKA_FEATURE_JAVA_NET_HTTP
|
||||
ENV BABASHKA_FEATURE_JAVA_NIO=$BABASHKA_FEATURE_JAVA_NIO
|
||||
ENV BABASHKA_FEATURE_JAVA_TIME=$BABASHKA_FEATURE_JAVA_TIME
|
||||
ENV BABASHKA_FEATURE_TRANSIT=$BABASHKA_FEATURE_TRANSIT
|
||||
ENV BABASHKA_FEATURE_XML=$BABASHKA_FEATURE_XML
|
||||
ENV BABASHKA_FEATURE_YAML=$BABASHKA_FEATURE_YAML
|
||||
ENV BABASHKA_FEATURE_HTTPKIT_CLIENT=$BABASHKA_FEATURE_HTTPKIT_CLIENT
|
||||
ENV BABASHKA_FEATURE_HTTPKIT_SERVER=$BABASHKA_FEATURE_HTTPKIT_SERVER
|
||||
ENV BABASHKA_FEATURE_JDBC=$BABASHKA_FEATURE_JDBC
|
||||
ENV BABASHKA_FEATURE_POSTGRESQL=$BABASHKA_FEATURE_POSTGRESQL
|
||||
ENV BABASHKA_FEATURE_HSQLDB=$BABASHKA_FEATURE_HSQLDB
|
||||
ENV BABASHKA_FEATURE_ORACLEDB=$BABASHKA_FEATURE_ORACLEDB
|
||||
ENV BABASHKA_FEATURE_DATASCRIPT=$BABASHKA_FEATURE_DATASCRIPT
|
||||
ENV BABASHKA_FEATURE_LANTERNA=$BABASHKA_FEATURE_LANTERNA
|
||||
ENV BABASHKA_STATIC=$BABASHKA_STATIC
|
||||
ENV BABASHKA_MUSL=$BABASHKA_MUSL
|
||||
|
||||
COPY . .
|
||||
RUN ./script/uberjar
|
||||
RUN ./script/setup-musl
|
||||
RUN ./script/compile
|
||||
|
||||
FROM ubuntu:latest
|
||||
RUN apt-get update && apt-get install -y curl \
|
||||
&& mkdir -p /usr/local/bin
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& mkdir -p /usr/local/bin
|
||||
|
||||
COPY --from=BASE /opt/target/metabom.jar /opt/babashka-metabom.jar
|
||||
COPY --from=BASE /opt/bb /usr/local/bin/bb
|
||||
CMD ["bb"]
|
||||
|
|
|
|||
35
Dockerfile.alpine
Normal file
35
Dockerfile.alpine
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
FROM alpine:3 AS tester
|
||||
|
||||
COPY bb /bin/bb
|
||||
|
||||
RUN chmod +x /bin/bb
|
||||
|
||||
# TODO: See https://github.com/sgerrand/alpine-pkg-glibc/issues/185 and remove the `--force-overwrite`s when resolved.
|
||||
|
||||
RUN apk --no-cache add curl ca-certificates tar && \
|
||||
curl -Ls https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk > /tmp/glibc-2.28-r0.apk && \
|
||||
apk add --allow-untrusted --force-overwrite /tmp/glibc-2.28-r0.apk
|
||||
RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf
|
||||
|
||||
# TODO: Run actual native tests when they are ported
|
||||
|
||||
RUN curl --version
|
||||
# RUN bb -e '(prn (java.io.File/createTempFile "babashka.curl" ".headers"))'
|
||||
# RUN bb -e '(spit (java.io.File/createTempFile "babashka.curl" ".headers") "hello")'
|
||||
# RUN bb -e "(curl/get \"https://clojure.org\")" # cURL http test
|
||||
RUN bb -e "(require '[org.httpkit.client :as http]) (when-let [error (:error @(http/get \"https://clojure.org\"))] (throw error))" # JVM http test
|
||||
RUN bb -e "(.length \"Hello, Babashka\")" # Java interop test
|
||||
RUN bb -e "(require '[babashka.pods :as pods]) (pods/load-pod 'org.babashka/go-sqlite3 \"0.0.1\") (require '[pod.babashka.go-sqlite3 :as sqlite]) (sqlite/execute! \"/tmp/foo.db\" [\"SELECT 1 + 1\"])" # Pod test
|
||||
|
||||
|
||||
FROM alpine:3
|
||||
|
||||
RUN apk --no-cache add curl ca-certificates tar && \
|
||||
curl -Ls https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk > /tmp/glibc-2.28-r0.apk && \
|
||||
apk add --allow-untrusted --force-overwrite /tmp/glibc-2.28-r0.apk && rm /tmp/glibc-2.28-r0.apk
|
||||
RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf
|
||||
|
||||
COPY metabom.jar /opt/babashka-metabom.jar
|
||||
COPY --from=tester /bin/bb /bin/bb
|
||||
|
||||
CMD ["bb"]
|
||||
16
Dockerfile.ci
Normal file
16
Dockerfile.ci
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
FROM ubuntu:latest
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y curl \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& mkdir -p /usr/local/bin
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG TARGETOS
|
||||
|
||||
COPY metabom.jar /opt/babashka-metabom.jar
|
||||
COPY ${TARGETOS}/${TARGETARCH}/bb /usr/local/bin/bb
|
||||
|
||||
RUN chmod +x /usr/local/bin/bb
|
||||
|
||||
CMD ["bb"]
|
||||
54
appveyor.yml
54
appveyor.yml
|
|
@ -2,20 +2,30 @@
|
|||
|
||||
version: "v-{build}"
|
||||
|
||||
image: Visual Studio 2017
|
||||
image: Visual Studio 2022
|
||||
|
||||
clone_folder: C:\projects\babashka
|
||||
|
||||
environment:
|
||||
GRAALVM_HOME: C:\projects\babashka\graalvm\graalvm-ce-java11-20.2.0
|
||||
GRAALVM_HOME: C:\projects\babashka\graalvm\graalvm-jdk-24+36.1
|
||||
JAVA_HOME: C:\projects\babashka\graalvm\graalvm-jdk-24+36.1
|
||||
BABASHKA_XMX: "-J-Xmx5g"
|
||||
|
||||
skip_commits:
|
||||
files:
|
||||
- "logo/*"
|
||||
- "**/*.md"
|
||||
|
||||
cache:
|
||||
- C:\ProgramData\chocolatey\lib -> project.clj, appveyor.yml
|
||||
- '%USERPROFILE%\.m2 -> project.clj'
|
||||
- 'graalvm -> appveyor.yml'
|
||||
|
||||
clone_script:
|
||||
- cmd: git config --global core.autocrlf true
|
||||
|
||||
- cmd: git config --global core.symlinks true
|
||||
|
||||
- ps: >-
|
||||
if(-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
|
||||
git clone -q --branch=$env:APPVEYOR_REPO_BRANCH https://github.com/$env:APPVEYOR_REPO_NAME.git $env:APPVEYOR_BUILD_FOLDER
|
||||
|
|
@ -29,35 +39,53 @@ clone_script:
|
|||
}
|
||||
- cmd: git submodule update --init --recursive
|
||||
|
||||
- cmd: git reset --hard
|
||||
|
||||
build_script:
|
||||
# TODO: Extract the zip by removing the top level folder to remove the hardcoded path for GRAALVM_HOME
|
||||
- cmd: >-
|
||||
powershell -Command "if (Test-Path('graalvm')) { return } else { (New-Object Net.WebClient).DownloadFile('https://download.oracle.com/graalvm/24/archive/graalvm-jdk-24_windows-x64_bin.zip', 'graalvm.zip') }"
|
||||
|
||||
powershell -Command "if (Test-Path('graalvm')) { return } else { Expand-Archive graalvm.zip graalvm }"
|
||||
|
||||
- cmd: >-
|
||||
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.bat', 'lein.bat')"
|
||||
|
||||
call lein self-install
|
||||
|
||||
# set CLJ_KONDO_TEST_ENV=jvm
|
||||
#- cmd: >-
|
||||
# set BABASHKA_TEST_ENV=jvm
|
||||
|
||||
# call script/test.bat
|
||||
# call script/test.bat
|
||||
|
||||
# see https://github.com/quarkusio/quarkus/pull/7663
|
||||
|
||||
- cmd: >-
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||
|
||||
powershell -Command "if (Test-Path('graalvm')) { return } else { (New-Object Net.WebClient).DownloadFile('https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-windows-amd64-20.2.0.zip', 'graalvm.zip') }"
|
||||
|
||||
powershell -Command "if (Test-Path('graalvm')) { return } else { Expand-Archive graalvm.zip graalvm }"
|
||||
set BABASHKA_SHA=%APPVEYOR_REPO_COMMIT%
|
||||
|
||||
call script/uberjar.bat
|
||||
|
||||
call script/compile.bat
|
||||
|
||||
# - cmd: >-
|
||||
# lein clean
|
||||
echo Creating zip archive
|
||||
|
||||
# set CLJ_KONDO_TEST_ENV=native
|
||||
set zip=babashka-%BABASHKA_VERSION%-windows-amd64.zip
|
||||
|
||||
# call script/test.bat
|
||||
jar -cMf %zip% bb.exe
|
||||
|
||||
bb --config .build/bb.edn --deps-root . release-artifact %zip%
|
||||
|
||||
before_test:
|
||||
- cmd: >-
|
||||
set BABASHKA_CLASSPATH=
|
||||
|
||||
set BABASHKA_TEST_ENV=native
|
||||
|
||||
test_script:
|
||||
- cmd: >-
|
||||
call script/test.bat :windows
|
||||
|
||||
call script/run_lib_tests.bat
|
||||
|
||||
artifacts:
|
||||
- path: babashka-*-windows-amd64.zip
|
||||
|
|
|
|||
1
babashka.core
Submodule
1
babashka.core
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 52a6037bd4b632bffffb04394fb4efd0cdab6b1e
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit eee04eb929baad39b8f46b6158a7d66979e40829
|
||||
Subproject commit e936acd40544eb637b6041c7e89454b21eb7ee34
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit d14901c6e538ad06f685c464b55ed0abbadab9b8
|
||||
Subproject commit edd3d613bfb9bf3adabfd0bda5c3f5c6ee85ec20
|
||||
1
deps.clj
Submodule
1
deps.clj
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 976cf7b0e54901ada3f7e83f12a4c0aed039adc9
|
||||
203
deps.edn
203
deps.edn
|
|
@ -1,54 +1,76 @@
|
|||
{:paths ["src" "feature-xml" "feature-core-async"
|
||||
{:paths ["src" "feature-xml"
|
||||
"feature-yaml" "feature-csv" "feature-transit"
|
||||
"feature-java-time" "feature-java-nio"
|
||||
"feature-httpkit-client" "feature-httpkit-server"
|
||||
"feature-lanterna"
|
||||
"sci/src" "babashka.curl/src" "pods/src"
|
||||
"feature-core-match"
|
||||
"feature-hiccup"
|
||||
"feature-test-check"
|
||||
"feature-spec-alpha"
|
||||
"feature-selmer"
|
||||
"feature-logging"
|
||||
"feature-priority-map"
|
||||
"feature-rrb-vector"
|
||||
"feature-jdbc"
|
||||
"pods/src"
|
||||
"babashka.nrepl/src"
|
||||
"depstar/src" "process/src"
|
||||
"resources" "sci/resources"],
|
||||
:deps {org.clojure/clojure {:mvn/version "1.10.2-alpha2"},
|
||||
org.clojure/tools.reader {:mvn/version "1.3.3"},
|
||||
borkdude/edamame {:mvn/version "0.0.11-alpha.15"},
|
||||
borkdude/graal.locking {:mvn/version "0.0.2"},
|
||||
borkdude/sci.impl.reflector {:mvn/version "0.0.1"}
|
||||
org.clojure/core.async {:mvn/version "1.3.610"},
|
||||
org.clojure/tools.cli {:mvn/version "1.0.194"},
|
||||
"deps.clj/src" "deps.clj/resources"
|
||||
"resources" "sci/resources"
|
||||
"impl-java/src"],
|
||||
:deps {org.clojure/clojure {:mvn/version "1.12.0"},
|
||||
org.babashka/sci {:local/root "sci"}
|
||||
org.babashka/babashka.impl.java {:mvn/version "0.1.10"}
|
||||
org.babashka/sci.impl.types {:mvn/version "0.0.2"}
|
||||
babashka/babashka.curl {:local/root "babashka.curl"}
|
||||
babashka/fs {:local/root "fs"}
|
||||
babashka/babashka.core {:local/root "babashka.core"}
|
||||
org.clojure/core.async {:mvn/version "1.8.741"},
|
||||
org.clojure/tools.cli {:mvn/version "1.0.214"},
|
||||
org.clojure/data.csv {:mvn/version "1.0.0"},
|
||||
cheshire/cheshire {:mvn/version "5.10.0"}
|
||||
org.clojure/data.xml {:mvn/version "0.2.0-alpha6"}
|
||||
clj-commons/clj-yaml {:mvn/version "0.7.2"}
|
||||
com.cognitect/transit-clj {:mvn/version "1.0.324"}
|
||||
nrepl/bencode {:mvn/version "1.1.0"}
|
||||
cheshire/cheshire {:mvn/version "6.0.0"}
|
||||
org.clojure/data.xml {:mvn/version "0.2.0-alpha8"}
|
||||
clj-commons/clj-yaml {:mvn/version "1.0.29"}
|
||||
com.cognitect/transit-clj {:mvn/version "1.0.333"}
|
||||
org.clojure/test.check {:mvn/version "1.1.1"}
|
||||
nrepl/bencode {:mvn/version "1.2.0"}
|
||||
seancorfield/next.jdbc {:mvn/version "1.1.610"}
|
||||
org.postgresql/postgresql {:mvn/version "42.2.18"}
|
||||
org.hsqldb/hsqldb {:mvn/version "2.5.1"}
|
||||
datascript/datascript {:mvn/version "1.0.1"}
|
||||
http-kit/http-kit {:mvn/version "2.5.0"}
|
||||
http-kit/http-kit {:mvn/version "2.8.0-RC1"}
|
||||
babashka/clojure-lanterna {:mvn/version "0.9.8-SNAPSHOT"}
|
||||
org.clojure/math.combinatorics {:mvn/version "0.1.6"}}
|
||||
:aliases {:main
|
||||
org.clojure/core.match {:mvn/version "1.0.0"}
|
||||
hiccup/hiccup {:mvn/version "2.0.0-RC1"}
|
||||
rewrite-clj/rewrite-clj {:mvn/version "1.1.49"}
|
||||
selmer/selmer {:mvn/version "1.12.59"}
|
||||
com.taoensso/timbre {:mvn/version "6.6.0"}
|
||||
org.clojure/tools.logging {:mvn/version "1.1.0"}
|
||||
org.clojure/data.priority-map {:mvn/version "1.1.0"}
|
||||
insn/insn {:mvn/version "0.5.2"}
|
||||
org.clojure/core.rrb-vector {:mvn/version "0.1.2"}
|
||||
org.babashka/cli {:mvn/version "0.8.65"}
|
||||
org.babashka/http-client {:mvn/version "0.4.22"}
|
||||
org.flatland/ordered {:mvn/version "1.15.12"}
|
||||
org.jsoup/jsoup {:mvn/version "1.20.1"}}
|
||||
:aliases {:babashka/dev
|
||||
{:main-opts ["-m" "babashka.main"]}
|
||||
:profile
|
||||
{:extra-deps
|
||||
{com.clojure-goes-fast/clj-async-profiler {:mvn/version "0.4.1"}}
|
||||
{com.clojure-goes-fast/clj-async-profiler {:mvn/version "0.5.0"}}
|
||||
:extra-paths ["test"]
|
||||
:jvm-opts ["-Djdk.attach.allowAttachSelf"]
|
||||
:jvm-opts ["-Djdk.attach.allowAttachSelf"
|
||||
"-Dclojure.compiler.direct-linking=true"]
|
||||
:main-opts ["-m" "babashka.profile"]}
|
||||
:lib-tests
|
||||
{:extra-deps {babashka/clj-http-lite
|
||||
{:git/url "https://github.com/babashka/clj-http-lite"
|
||||
:sha "f44ebe45446f0f44f2b73761d102af3da6d0a13e"}
|
||||
borkdude/spartan.spec {:git/url "https://github.com/borkdude/spartan.spec"
|
||||
:sha "16f7eec4b6589c77c96c9fcf989f78fffcee7c4c"}
|
||||
lambdaisland/regal {:git/url "https://github.com/lambdaisland/regal"
|
||||
:sha "f902d2c43121f9e1c48603d6eb99f5900eb6a9f6"}
|
||||
weavejester/medley {:git/url "https://github.com/weavejester/medley"
|
||||
:sha "a4e5fb5383f5c0d83cb2d005181a35b76d8a136d"}
|
||||
babashka/babasha.curl {:local/root "babashka.curl"}
|
||||
{:extra-paths ["process/src" "process/test" "test-resources/lib_tests"]
|
||||
:extra-deps {org.clj-commons/clj-http-lite {:mvn/version "0.4.392"}
|
||||
#_#_org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha"
|
||||
:sha "0dec1f88cbde74a0470b454396f09a03adb4ae39"}
|
||||
lambdaisland/regal {:mvn/version "0.0.143"}
|
||||
cprop/cprop {:mvn/version "0.1.16"}
|
||||
comb/comb {:mvn/version "0.1.1"}
|
||||
mvxcvi/arrangement {:mvn/version "1.2.0"}
|
||||
mvxcvi/arrangement {:mvn/version "2.0.0"}
|
||||
org.clojure/data.zip {:mvn/version "1.0.0"}
|
||||
clojure-csv/clojure-csv {:mvn/version "2.0.2"}
|
||||
org.clojure/math.combinatorics {:mvn/version "0.1.6"}
|
||||
|
|
@ -56,14 +78,121 @@
|
|||
henryw374/cljc.java-time
|
||||
{:git/url "https://github.com/henryw374/cljc.java-time.git"
|
||||
:sha "e3d184b78e933322b3fcaa6ca66cbb8f42a6b35c"}
|
||||
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.1"}
|
||||
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.2"}
|
||||
aero/aero {:mvn/version "1.1.6"}
|
||||
org.clojure/data.generators {:mvn/version "1.0.0"}
|
||||
honeysql/honeysql {:mvn/version "1.0.444"}
|
||||
minimallist/minimallist {:mvn/version "0.0.6"}
|
||||
circleci/bond {:mvn/version "0.4.0"}
|
||||
version-clj/version-clj {:mvn/version "0.1.2"}}}
|
||||
honeysql/honeysql {:mvn/version "1.0.461"}
|
||||
com.github.seancorfield/honeysql {:mvn/version "2.2.840"}
|
||||
minimallist/minimallist {:mvn/version "0.0.10"}
|
||||
circleci/bond {:mvn/version "0.6.0"}
|
||||
version-clj/version-clj {:mvn/version "2.0.2"}
|
||||
gaka/gaka {:mvn/version "0.3.0"}
|
||||
failjure/failjure {:mvn/version "2.2.0"}
|
||||
io.helins/binf {:mvn/version "1.1.0-beta0"}
|
||||
rm-hull/jasentaa {:mvn/version "0.2.5"}
|
||||
slingshot/slingshot {:mvn/version "0.12.2"}
|
||||
io.replikativ/hasch {:mvn/version "0.3.7"}
|
||||
com.grammarly/omniconf {:mvn/version "0.4.3"}
|
||||
crispin/crispin {:mvn/version "0.3.8"}
|
||||
org.clojure/data.json {:mvn/version "2.4.0"}
|
||||
clj-commons/multigrep {:mvn/version "0.5.0"}
|
||||
amperity/vault-clj {:mvn/version "1.0.4"}
|
||||
java-http-clj/java-http-clj {:mvn/version "0.4.3"}
|
||||
com.stuartsierra/component {:mvn/version "1.0.0"}
|
||||
org.clojars.askonomm/ruuter {:mvn/version "1.2.2"}
|
||||
org.clj-commons/digest {:mvn/version "1.4.100"}
|
||||
hato/hato {:mvn/version "0.8.2"}
|
||||
better-cond/better-cond {:mvn/version "2.1.1"}
|
||||
org.clojure/core.specs.alpha {:mvn/version "0.2.62"}
|
||||
reifyhealth/specmonstah {:git/url "https://github.com/reifyhealth/specmonstah", :sha "a2b357009a3aa99a0c2d2361f3bbcd0b0e36505e"}
|
||||
exoscale/coax {:mvn/version "1.0.0-alpha14"}
|
||||
orchestra/orchestra {:mvn/version "2021.01.01-1"}
|
||||
expound/expound {:mvn/version "0.8.10"}
|
||||
integrant/integrant {:git/url "https://github.com/weavejester/integrant", :git/sha "a9fd7c02bd7201f36344b47142badc3c3ef22f88"}
|
||||
com.stuartsierra/dependency {:mvn/version "1.0.0"}
|
||||
listora/again {:mvn/version "1.0.0"}
|
||||
org.clojure/tools.gitlibs {:mvn/version "2.4.172"}
|
||||
environ/environ {:mvn/version "1.2.0"}
|
||||
table/table {:git/url "https://github.com/cldwalker/table", :sha "f6293c5f3dac1dd6f525a80fc80930f8ccdf16b7"}
|
||||
markdown-clj/markdown-clj {:mvn/version "1.10.8"}
|
||||
org.clojure/tools.namespace {:git/sha "daf82a10e70182aea4c0716a48f3922163441b32",
|
||||
:git/url "https://github.com/clojure/tools.namespace"}
|
||||
medley/medley {:mvn/version "1.3.0"}
|
||||
io.github.cognitect-labs/test-runner {:git/url "https://github.com/cognitect-labs/test-runner",
|
||||
:git/sha "7284cda41fb9edc0f3bc6b6185cfb7138fc8a023"}
|
||||
borkdude/missing.test.assertions {:git/url "https://github.com/borkdude/missing.test.assertions", :sha "603cb01bee72fb17addacc53c34c85612684ad70"}
|
||||
dev.nubank/docopt {:mvn/version "0.6.1-fix7"}
|
||||
testdoc/testdoc {:mvn/version "1.4.1"}
|
||||
org.clojars.lispyclouds/contajners {:mvn/version "0.0.6"}
|
||||
borkdude/rewrite-edn {:mvn/version "0.1.0"}
|
||||
clojure-term-colors/clojure-term-colors {:mvn/version "0.1.0"}
|
||||
io.aviso/pretty {:mvn/version "1.1.1"}
|
||||
progrock/progrock {:mvn/version "0.1.2"}
|
||||
djblue/portal {:mvn/version "0.19.0"}
|
||||
com.wsscode/cljc-misc {:mvn/version "2021.10.16"}
|
||||
edn-query-language/eql {:mvn/version "2021.07.18"}
|
||||
meta-merge/meta-merge {:mvn/version "1.0.0"}
|
||||
com.exoscale/lingo {:mvn/version "1.0.0-alpha14"}
|
||||
io.github.swirrl/dogstatsd {:mvn/version "0.1.39"}
|
||||
org.clojure/algo.monads {:mvn/version "0.1.6"}
|
||||
io.lambdaforge/datalog-parser {:mvn/version "0.1.9"}
|
||||
clj-stacktrace/clj-stacktrace {:mvn/version "0.2.8"}
|
||||
clojure-msgpack/clojure-msgpack {:mvn/version "1.2.1"}
|
||||
cli-matic/cli-matic {:git/url "https://github.com/l3nz/cli-matic.git", :git/sha "9cd53ba7336363e3d06650dbad413b6f8b06e471"}
|
||||
aysylu/loom {:mvn/version "1.0.2"}
|
||||
com.layerware/hugsql-core {:mvn/version "0.5.3"}
|
||||
com.github.seancorfield/expectations {:mvn/version "2.0.157"}
|
||||
com.rpl/specter {:mvn/version "1.1.4"}
|
||||
com.github.askonomm/clarktown {:mvn/version "1.1.2"}
|
||||
org.clojure/math.numeric-tower {:git/tag "math.numeric-tower-0.0.5", :git/sha "12eb9c5", :git/url "https://github.com/clojure/math.numeric-tower"}
|
||||
prismatic/schema {:git/url "https://github.com/plumatic/schema"
|
||||
:git/sha "6846dc7c3a9df5bfd718f68f183c683ce0f621ff"
|
||||
:git/tag "schema-1.3.0"}
|
||||
metosin/malli {:git/url "https://github.com/metosin/malli"
|
||||
:git/sha "588147ef49b2e41c7d12a8aa994b39c1c6fedd99"
|
||||
:git/tag "0.8.9"}
|
||||
meander/epsilon {:git/url "https://github.com/noprompt/meander"
|
||||
:git/sha "55f5ce70e6ef717e95c58260f6bc725d70c0cb6d"}
|
||||
cc.qbits/auspex {:git/url "https://github.com/mpenet/auspex"
|
||||
:git/sha "1a9d7427e60e1a434a764aa820d1c53f7e22504a"
|
||||
:deps/manifest :deps}
|
||||
exoscale/interceptor {:git/url "https://github.com/exoscale/interceptor"
|
||||
:git/sha "ca115fe00a0abf3a2f78452ab309c3aa4c00fc4e"
|
||||
:deps/manifest :deps}
|
||||
lambdaisland/uri {:git/url "https://github.com/lambdaisland/uri"
|
||||
:git/sha "ac4f1f9c8e4f45a088db1c6383ce2191c973987c"
|
||||
:deps/manifest :deps}
|
||||
clj-commons/fs {:mvn/version "1.6.310"}
|
||||
postmortem/postmortem {:git/url "https://github.com/athos/Postmortem"
|
||||
:git/sha "1a29775a3d286f9f6fe3f979c78b6e2bf298d5ba"}
|
||||
com.github.rawleyfowler/sluj {:git/url "https://github.com/rawleyfowler/sluj"
|
||||
:git/sha "4a92e772b4e07bf127423448d4140748b5782198"
|
||||
:deps/manifest :deps}
|
||||
net.cgrand/xforms {:git/url "https://github.com/cgrand/xforms"
|
||||
:git/sha "550dbc150a79c6ecc148d8a7e260e10bc36321c6"
|
||||
:deps/manifest :deps}
|
||||
prismatic/plumbing {:git/url "https://github.com/plumatic/plumbing",
|
||||
:git/sha "424bc704f2db422de34269c139a5494314b3a43b"}
|
||||
org.clj-commons/hickory {:git/url "https://github.com/clj-commons/hickory"
|
||||
:git/sha "9385b6708ef35f161732d8464b3a3aa57dd79f30"}
|
||||
com.potetm/fusebox {:git/url "https://github.com/potetm/fusebox"
|
||||
:git/sha "ac6d6a0a69510b009b3c1bb2247cd110fd9f7246"}
|
||||
net.sekao/odoyle-rules {:git/url "https://github.com/oakes/odoyle-rules"
|
||||
:git/sha "0b1d825ec45a998c4d3481dfb292e08ce6a47f0b"}}
|
||||
:classpath-overrides {org.clojure/clojure nil
|
||||
org.clojure/spec.alpha nil}}
|
||||
:clj-nvd
|
||||
{:extra-deps {clj-nvd/clj-nvd {:git/url "https://github.com/miikka/clj-nvd.git"
|
||||
:sha "f2ec98699e057a379baf170cb49cf7ad76874a70"}}
|
||||
:main-opts ["-m" "clj-nvd.core"]}}}
|
||||
:main-opts ["-m" "clj-nvd.core"]}
|
||||
:test
|
||||
{:extra-paths ["test"]
|
||||
:extra-deps {io.github.cognitect-labs/test-runner
|
||||
{:git/tag "v0.5.0" :git/sha "b3fd0d2"}
|
||||
nubank/matcher-combinators {:mvn/version "3.6.0"}}
|
||||
:main-opts ["-m" "cognitect.test-runner"]
|
||||
:exec-fn cognitect.test-runner.api/test}
|
||||
:test-pod
|
||||
{:extra-paths ["test-resources"]
|
||||
:main-opts ["-m" "babashka.main" "test-resources/pod.clj"]}}}
|
||||
;; release
|
||||
|
|
|
|||
2
depstar
2
depstar
|
|
@ -1 +1 @@
|
|||
Subproject commit e74b8ac05c64efb815153fbfdd2d31e3cad098cb
|
||||
Subproject commit 2bf9d3c9f15298d7dd9de033674a42f830e23d6f
|
||||
47
doc/build.md
47
doc/build.md
|
|
@ -3,24 +3,24 @@
|
|||
## Prerequisites
|
||||
|
||||
- Install [lein](https://leiningen.org/) for producing uberjars
|
||||
- Download [GraalVM](https://www.graalvm.org/downloads/). Currently we use *java11-20.1.0*.
|
||||
- Download [GraalVM](https://www.graalvm.org/downloads/). Currently we use *Oracle GraalVM 24*.
|
||||
- For Windows, installing Visual Studio 2019 with the "Desktop development
|
||||
with C++" workload is recommended.
|
||||
- Set `$GRAALVM_HOME` to the GraalVM distribution directory. On macOS this can look like:
|
||||
|
||||
``` shell
|
||||
export GRAALVM_HOME=~/Downloads/graalvm-ce-java11-20.1.0/Contents/Home
|
||||
export GRAALVM_HOME=~/Downloads/graalvm-jdk-21.0.0.1/Contents/Home
|
||||
```
|
||||
|
||||
On linux:
|
||||
|
||||
``` shell
|
||||
export GRAALVM_HOME=~/Downloads/graalvm-ce-java11-20.1.0
|
||||
export GRAALVM_HOME=~/Downloads/graalvm-jdk-21.0.0.1
|
||||
```
|
||||
|
||||
On Windows, from the [Visual Studio 2019 x64 Native Tools Command Prompt](https://github.com/oracle/graal/issues/2116#issuecomment-590470806) or `cmd.exe` (not Powershell):
|
||||
```
|
||||
set GRAALVM_HOME=%USERPROFILE%\Downloads\graalvm-ce-java11-20.1.0
|
||||
set GRAALVM_HOME=%USERPROFILE%\Downloads\graalvm-ce-jdk-21.0.0.1
|
||||
```
|
||||
If you are not running from the x64 Native Tools Command Prompt, you will need to set additional environment variables using:
|
||||
```
|
||||
|
|
@ -33,13 +33,13 @@ NOTE: the babashka repository contains submodules. You need to use the
|
|||
`--recursive` flag to clone these submodules along with the main repo.
|
||||
|
||||
``` shellsession
|
||||
$ git clone https://github.com/borkdude/babashka --recursive
|
||||
$ git clone https://github.com/babashka/babashka --recursive
|
||||
```
|
||||
|
||||
To update later on:
|
||||
|
||||
``` shellsession
|
||||
$ git submodule update --recursive
|
||||
$ git submodule update --init --recursive
|
||||
```
|
||||
|
||||
## Build
|
||||
|
|
@ -60,18 +60,41 @@ $ export BABASHKA_XMX="-J-Xmx6500m"
|
|||
Note: setting the max heap size to a low value can cause the build to crash or
|
||||
take long to complete.
|
||||
|
||||
### Alternative: Build inside Docker
|
||||
|
||||
To build a Linux version of babashka, you can use `docker build`, enabling the
|
||||
desired features via `--build-arg` like this:
|
||||
|
||||
```shell
|
||||
docker build --build-arg BABASHKA_FEATURE_JDBC=true --target BASE -t bb-builder .
|
||||
container_id=$(docker create bb-builder)
|
||||
docker cp $container_id:/opt/bb bb # copy to ./bb on the host file system
|
||||
docker rm $container_id
|
||||
```
|
||||
|
||||
NOTE: If you get _Error: Image build request failed with exit status 137_ then
|
||||
check whether Docker is allowed to use enough memory (e.g. in Docker Desktop
|
||||
preferences). If it is, then increase the memory GraalVM can use, for example
|
||||
by adding `--build-arg BABASHKA_XMX="-J-Xmx8g"`
|
||||
(or whatever Docker has available, bigger than the default).
|
||||
|
||||
## Windows
|
||||
|
||||
Run `script\uberjar.bat` followed by `script\compile.bat`.
|
||||
|
||||
## Static
|
||||
|
||||
To compile babashka as a static binary for linux, set the `BABASHKA_STATIC`
|
||||
environment variable to `true`.
|
||||
|
||||
## Feature flags
|
||||
|
||||
Babashka supports the following feature flags:
|
||||
|
||||
| Name | Description | Default |
|
||||
|--------|----------------------------------------------|----------|
|
||||
| `BABASHKA_FEATURE_CORE_ASYNC` | Includes the [clojure.core.async](https://github.com/clojure/core.async) library | `true` |
|
||||
| `BABASHKA_FEATURE_CSV` | Includes the [clojure.data.csv](https://github.com/clojure/data.csv) library | `true` |
|
||||
| `BABASHKA_FEATURE_JAVA_NET_HTTP` | Includes commonly used classes from the `java.net.http` package | `true` |
|
||||
| `BABASHKA_FEATURE_JAVA_NIO` | Includes commonly used classes from the `java.nio` package | `true` |
|
||||
| `BABASHKA_FEATURE_JAVA_TIME` | Includes commonly used classes from the `java.time` package | `true` |
|
||||
| `BABASHKA_FEATURE_TRANSIT` | Includes the [transit-clj](https://github.com/cognitect/transit-clj) library | `true` |
|
||||
|
|
@ -79,18 +102,26 @@ Babashka supports the following feature flags:
|
|||
| `BABASHKA_FEATURE_YAML` | Includes the [clj-yaml](https://github.com/clj-commons/clj-yaml) library | `true` |
|
||||
| `BABASHKA_FEATURE_HTTPKIT_CLIENT` | Includes the [http-kit](https://github.com/http-kit/http-kit) client library | `true` |
|
||||
| `BABASHKA_FEATURE_HTTPKIT_SERVER` | Includes the [http-kit](https://github.com/http-kit/http-kit) server library | `true` |
|
||||
| `BABASHKA_FEATURE_CORE_MATCH` | Includes the [clojure.core.match](https://github.com/clojure/core.match) library | `true` |
|
||||
| `BABASHKA_FEATURE_HICCUP` | Includes the [hiccup](https://github.com/weavejester/hiccup) library | `true` |
|
||||
| `BABASHKA_FEATURE_TEST_CHECK` | Includes the [clojure.test.check](https://github.com/clojure/test.check) library | `true` |
|
||||
| `BABASHKA_FEATURE_SPEC_ALPHA` | Includes the [clojure.spec.alpha](https://github.com/clojure/spec.alpha) library (WIP) | `false` |
|
||||
| `BABASHKA_FEATURE_JDBC` | Includes the [next.jdbc](https://github.com/seancorfield/next-jdbc) library | `false` |
|
||||
| `BABASHKA_FEATURE_SQLITE` | Includes the [sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) library | `false` |
|
||||
| `BABASHKA_FEATURE_POSTGRESQL` | Includes the [PostgresSQL](https://jdbc.postgresql.org/) JDBC driver | `false` |
|
||||
| `BABASHKA_FEATURE_HSQLDB` | Includes the [HSQLDB](http://www.hsqldb.org/) JDBC driver | `false` |
|
||||
| `BABASHKA_FEATURE_ORACLEDB` | Includes the [Oracle](https://www.oracle.com/database/technologies/appdev/jdbc.html) JDBC driver | `false` |
|
||||
| `BABASHKA_FEATURE_DATASCRIPT` | Includes [datascript](https://github.com/tonsky/datascript) | `false` |
|
||||
| `BABASHKA_FEATURE_LANTERNA` | Includes [clojure-lanterna](https://github.com/babashka/clojure-lanterna) | `false` |
|
||||
| `BABASHKA_FEATURE_LOGGING` | Includes [clojure.tools.logging](https://github.com/clojure/tools.logging) with [taoensso.timbre](https://github.com/ptaoussanis/timbre) as the default implementation| `true` |
|
||||
| `BABASHKA_FEATURE_PRIORITY_MAP` | Includes [clojure.data.priority-map](https://github.com/clojure/data.priority-map) | `true` |
|
||||
|
||||
Note that httpkit server is currently experimental, the feature flag could be toggled to `false` in a future release.
|
||||
|
||||
To disable all of the above features, you can set `BABASHKA_LEAN` to `true`.
|
||||
|
||||
Here is an [example
|
||||
commit](https://github.com/borkdude/babashka/commit/13f65f05aeff891678e88965d9fbd146bfa87f4e)
|
||||
commit](https://github.com/babashka/babashka/commit/13f65f05aeff891678e88965d9fbd146bfa87f4e)
|
||||
that can be used as a checklist when you want to create a new feature flag.
|
||||
|
||||
### HyperSQL
|
||||
|
|
|
|||
77
doc/companies.md
Normal file
77
doc/companies.md
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
# Companies using babashka
|
||||
|
||||
Is your company using babashka? Mention it in
|
||||
[this](https://github.com/babashka/babashka/discussions/1026) discussion to get
|
||||
yours listed!
|
||||
|
||||
If your company is using clj-kondo as well, mention it
|
||||
[here](https://github.com/clj-kondo/clj-kondo/discussions/1397).
|
||||
|
||||
If your company is sponsoring, it will be listed first (in order of sponsorship
|
||||
size) with a logo and hiring link (if applicable)!
|
||||
|
||||
## Sponsoring companies
|
||||
|
||||
### [Adgoji](https://www.adgoji.com/)
|
||||
|
||||

|
||||
|
||||
### [Nubank](https://nubank.com.br/)
|
||||
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/f/f7/Nubank_logo_2021.svg" width="200">
|
||||
|
||||
Sponsoring via [Cognitect](https://www.cognitect.com/).
|
||||
|
||||
### [Nextjournal](https://nextjournal.com/)
|
||||
|
||||
<img src="https://cdn.nextjournal.com/images/nextjournal-logo.svg" width="300">
|
||||
|
||||
### [ATA](https://ata-llc.com) - [hiring](https://www.ziprecruiter.com/c/ATA-LLC/Jobs)
|
||||
|
||||
<img width="250" alt="Screen Shot 2022-01-07 at 21 21 00" src="https://user-images.githubusercontent.com/284934/148602984-6c333501-505b-4692-ad7a-62383510fb9a.png">
|
||||
|
||||
### [Cognician](https://www.cognician.com)
|
||||
|
||||
<img src="https://avatars.githubusercontent.com/u/1450774?s=150&v=4">
|
||||
|
||||
### [Fluent](https://fluent.to)
|
||||
|
||||
<img src="https://uploads-ssl.webflow.com/600fdbbcf0cbfe02f1a48030/600fdf0fffe881c3e8e298f4_Fluent%20logotype-p-500.png" width="300">
|
||||
|
||||
### [180seg](https://www.180s.com.br)
|
||||
|
||||
<img src="https://avatars.githubusercontent.com/u/75583439?s=200&v=4">
|
||||
|
||||
### [Dr. Evidence](https://www.drevidence.com/)
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/284934/138914250-f447ca3d-c1c1-4c60-bfaf-9000541d4a0d.png" width="325">
|
||||
|
||||
### [EnjoyHQ](https://getenjoyhq.com/)
|
||||
|
||||
<img src="https://getenjoyhq.com/wp-content/uploads/2021/07/EnjoyHQ_uz-blue_cropp.svg" width="300">
|
||||
|
||||
### [Epic Castle](https://epiccastle.io)
|
||||
|
||||
<img src="https://epiccastle.io/images/logo.png" width="100">
|
||||
|
||||
## Companies
|
||||
|
||||
- [AWS](https://aws.amazon.com/)
|
||||
- [Barracuda](https://www.barracuda.com/)
|
||||
- [Datil](https://datil.com/)
|
||||
- [Deon Digital](https://www.deondigital.com/)
|
||||
- [Fluent](https://fluent.to/)
|
||||
- [Fluree](https://flur.ee/)
|
||||
- [Hi](https://www.hi.group/)
|
||||
- [Juxt](https://www.juxt.pro/)
|
||||
- [Kleene](https://www.kleene.ai/)
|
||||
- [Latacora](https://www.latacora.com/)
|
||||
- [Metosin](https://www.metosin.fi/en/)
|
||||
- [Nextdoc](https://www.nextdoc.io/)
|
||||
- [PractiTest](https://www.practitest.com/)
|
||||
- [Reify Health](https://www.reifyhealth.com/)
|
||||
- [Schnaq](https://schnaq.com/)
|
||||
- [Splash Financial](https://www.splashfinancial.com/)
|
||||
- [TOYOKUMO, Inc.](https://toyokumo.co.jp/)
|
||||
- [Xcoo](https://xcoo.com/)
|
||||
- [Zero one group](https://zero-one-group.com/)
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
### Deps.clj
|
||||
|
||||
The [`deps.clj`](https://github.com/borkdude/deps.clj/) script can be used to work with `deps.edn`-based projects:
|
||||
|
||||
``` shell
|
||||
$ deps.clj -A:my-script -Scommand "bb -cp {{classpath}} {{main-opts}}"
|
||||
Hello from gist script!
|
||||
```
|
||||
|
||||
Create these aliases for brevity:
|
||||
|
||||
``` shell
|
||||
$ alias bbk='deps.clj -Scommand "bb -cp {{classpath}} {{main-opts}}"'
|
||||
$ alias babashka='rlwrap deps.clj -Scommand "bb -cp {{classpath}} {{main-opts}}"'
|
||||
$ bbk -A:my-script
|
||||
Hello from gist script!
|
||||
$ babashka
|
||||
Babashka v0.0.58 REPL.
|
||||
Use :repl/quit or :repl/exit to quit the REPL.
|
||||
Clojure rocks, Bash reaches.
|
||||
|
||||
user=> (require '[my-gist-script :as mgs])
|
||||
nil
|
||||
user=> (mgs/-main)
|
||||
Hello from gist script!
|
||||
nil
|
||||
```
|
||||
|
||||
You can also use for example `deps.clj` to produce the classpath for a
|
||||
`babashka` REPL:
|
||||
|
||||
```shellsession
|
||||
$ cat script/start-repl.sh
|
||||
#!/bin/sh -e
|
||||
git_root=$(git rev-parse --show-toplevel)
|
||||
export BABASHKA_CLASSPATH=$("$git_root"/script/deps.clj -Spath)
|
||||
bb --socket-repl 1666
|
||||
$ ./script/start-repl.sh
|
||||
Babashka socket REPL started at localhost:1666
|
||||
```
|
||||
|
||||
Now, given that your `deps.edn` and source tree looks something like
|
||||
|
||||
```shellsession
|
||||
$ cat deps.edn
|
||||
{:paths ["src" "test"]
|
||||
:deps {}}
|
||||
$ tree -L 3
|
||||
├── deps.edn
|
||||
├── README
|
||||
├── script
|
||||
│ ├── deps.clj
|
||||
│ └── start-repl.sh
|
||||
├── src
|
||||
│ └── project_namespace
|
||||
│ ├── main.clj
|
||||
│ └── utilities.clj
|
||||
└── test
|
||||
└── project_namespace
|
||||
├── test_main.clj
|
||||
└── test_utilities.clj
|
||||
|
||||
```
|
||||
|
||||
you should now be able to `(require '[multi-machine-rsync.utilities :as util])`
|
||||
in your REPL and the source code in `/src/multi_machine_rsync/utilities.clj`
|
||||
will be evaluated and made available through the symbol `util`.
|
||||
148
doc/dev.md
148
doc/dev.md
|
|
@ -1,13 +1,53 @@
|
|||
# Developing Babashka
|
||||
|
||||
You need [lein](https://leiningen.org/) for running JVM tests and/or producing uberjars. For building binaries you need GraalVM. Currently we use java11-20.2.0.
|
||||
## Workflow
|
||||
|
||||
### Start with an issue before writing code
|
||||
|
||||
Before writing any code, please create an issue first that describes the problem
|
||||
you are trying to solve with alternatives that you have considered. A little bit
|
||||
of prior communication can save a lot of time on coding. Keep the problem as
|
||||
small as possible. If there are two problems, make two issues. We discuss the
|
||||
issue and if we reach an agreement on the approach, it's time to move on to a
|
||||
PR.
|
||||
|
||||
### Follow up with a pull request
|
||||
|
||||
Post a corresponding PR with the smallest change possible to address the
|
||||
issue. Then we discuss the PR, make changes as needed and if we reach an
|
||||
agreement, the PR will be merged.
|
||||
|
||||
### Tests
|
||||
|
||||
Each bug fix, change or new feature should be tested well to prevent future
|
||||
regressions.
|
||||
|
||||
If possible, tests should use public APIs. If the bug is in private/internal
|
||||
code, try to trigger it from a public API.
|
||||
|
||||
### Force-push
|
||||
|
||||
Please do not use `git push --force` on your PR branch for the following
|
||||
reasons:
|
||||
|
||||
- It makes it more difficult for others to contribute to your branch if needed.
|
||||
- It makes it harder to review incremental commits.
|
||||
- Links (in e.g. e-mails and notifications) go stale and you're confronted with:
|
||||
this code isn't here anymore, when clicking on them.
|
||||
- CircleCI doesn't play well with it: it might try to fetch a commit which
|
||||
doesn't exist anymore.
|
||||
- Your PR will be squashed anyway.
|
||||
|
||||
## Requirements
|
||||
|
||||
You need [lein](https://leiningen.org/) for running JVM tests and/or producing uberjars. For building binaries you need GraalVM. Currently we use Oracle GraalVM 24.
|
||||
|
||||
## Clone repository
|
||||
|
||||
To work on Babashka itself make sure Git submodules are checked out.
|
||||
|
||||
``` shellsession
|
||||
$ git clone https://github.com/borkdude/babashka --recursive
|
||||
$ git clone https://github.com/babashka/babashka --recursive
|
||||
```
|
||||
|
||||
To update later on:
|
||||
|
|
@ -44,12 +84,76 @@ Test the native version:
|
|||
## Tests for Libraries
|
||||
|
||||
Babashka runs tests of libraries that are compatible with it through
|
||||
`script/run_lib_tests`. To add tests for a new library, do the following:
|
||||
`script/run_lib_tests`.
|
||||
|
||||
You can check out [this
|
||||
commit](https://github.com/babashka/babashka/commit/8d9ac4c4d18a5588a4a258a61a9db3835b4f4e5c)
|
||||
for how to add tests for a library that needs no changes to its tests.
|
||||
The library is cloned as a git dependency, which also includes the tests, that are then added to the test's classpath and ran.
|
||||
|
||||
If a library's tests needs changes, we copy the tests using the `add-libtest.clj` script. Examples:
|
||||
|
||||
```sh
|
||||
# To add tests for a new library on clojars
|
||||
script/add-libtest.clj com.exoscale/lingo -t
|
||||
|
||||
# To add tests for a new library that is git based only
|
||||
script/add-libtest.clj '{borkdude/carve {:git/url "https://github.com/borkdude/carve" :sha "df552797a198b6701fb2d92390fce7c59205ea77"}}' -t
|
||||
|
||||
# There are a number of options for specifying how to copy tests
|
||||
script/add-libtest.clj -h
|
||||
```
|
||||
|
||||
If the library you want to add doesn't work automatically, you can manually do the following:
|
||||
|
||||
* Add an entry for the library in `deps.edn` under the `:lib-tests` alias.
|
||||
* Create a directory for the library in `test-resources/lib_tests/` and copy its tests to there.
|
||||
* Add an entry in `run_all_libtests.clj` to run the added test namespaces.
|
||||
* Add a manual lib entry using `add-libtest.clj` e.g. `script/add-libtest.clj http-kit/http-kit -m '{:test-namespaces [httpkit.client-test]}'`.
|
||||
* Run the tests `script/lib_tests/run_all_libtests NS1 NS2`
|
||||
|
||||
Note: If you have to modify any test file or configuration to have it work with
|
||||
bb, add an inline comment with prefix `BB-TEST-PATCH:` explaining what you did.
|
||||
|
||||
## Windows
|
||||
We have corresponding `.bat` scripts for Windows, examples from a CMD Shell:
|
||||
|
||||
```shell
|
||||
script\test.bat
|
||||
script\run_lib_tests.bat
|
||||
set BABASHKA_TEST_ENV=native
|
||||
script\run_lib_tests.bat
|
||||
```
|
||||
|
||||
### Enable Windows Symbolic Links
|
||||
You'll need to **enable symbolic links**.
|
||||
You must do this before you git clone babashka otherwise some tests will fail.
|
||||
There seems to be many ways to achieve this; I found the following worked from PowerShell:
|
||||
```shell
|
||||
Install-Module -Name Carbon -Force
|
||||
Import-Module Carbon
|
||||
Grant-CPrivilege -Identity lee -Privilege SeCreateSymbolicLinkPrivilege
|
||||
```
|
||||
You'll need to reboot:
|
||||
```shell
|
||||
shutdown /r /t 0
|
||||
```
|
||||
After reboot, verify the new privilege via:
|
||||
```shell
|
||||
whoami /priv
|
||||
```
|
||||
Test if you can create a symbolic link via:
|
||||
```
|
||||
mklink foofoo barbar
|
||||
```
|
||||
|
||||
> **TIP**: Symbolic links are not supported in some folder-sharing technologies.
|
||||
For example, if you are running Windows as a VirtualBox guest, sharing babashka
|
||||
source folders from your host OS will not share the symbolic links as symbolic links.
|
||||
One solution is to re-clone babashka to a non-shared folder on Windows.
|
||||
|
||||
### Git for Windows
|
||||
Install [Git for Windows](https://gitforwindows.org/).
|
||||
It includes a version of `cat` that babashka tests currently rely on.
|
||||
|
||||
## Build
|
||||
|
||||
|
|
@ -66,7 +170,7 @@ Findings from various experiments with JDBC drivers in babashka:
|
|||
20MB to the binary. Since sqlite has a nice CLI we could also just shell out
|
||||
to it (there's an example in the examples dir). We could also build a
|
||||
`babashka.sqlite` namespace around the CLI maybe similar to
|
||||
`babashka.curl`. See [#385](https://github.com/borkdude/babashka/issues/385)
|
||||
`babashka.curl`. See [#385](https://github.com/babashka/babashka/issues/385)
|
||||
for details.
|
||||
- HSQLDB: easy to get going with Graalvm. Adds 10 MB to the binary. It's under a
|
||||
feature flag right now on master. See [build.md](build.md) for details. Derby
|
||||
|
|
@ -75,17 +179,49 @@ Findings from various experiments with JDBC drivers in babashka:
|
|||
got it to crash. 4800m did work, but it took 17 minutes (compared to 10
|
||||
minutes without this feature).
|
||||
- MySQL / MariaDB: can't get those to work yet. Work in progress in issue
|
||||
[#387](https://github.com/borkdude/babashka/issues/387).
|
||||
[#387](https://github.com/babashka/babashka/issues/387).
|
||||
|
||||
To progress work on sqlite and mySQL, I need a working Clojure example. If you
|
||||
want to contribute, consider making a an example Clojure GraalVM CLI that puts
|
||||
something in a sqlite / mysql DB and reads something from it.
|
||||
|
||||
## Design decisions
|
||||
|
||||
Some design decisions:
|
||||
|
||||
### bb.edn
|
||||
|
||||
- We chose the name `bb.edn` (rather than `babashka.edn`) for the configuration
|
||||
file based on this
|
||||
[poll](https://twitter.com/borkdude/status/1374720217608302595). The name `bb`
|
||||
combined with `.edn` is not likely to cause conflicts with other tools.
|
||||
- We did not choose to put the babashka configuration in `deps.edn` to keep bb config isolated (and more flexible) and also support it in projects that do not use `deps.edn`
|
||||
|
||||
### .babashka
|
||||
|
||||
- Rather than naming the home config dir `~/.bb` we chose `~/.babashka` to
|
||||
prevent conflicts with other global tools. We might introduce a project local
|
||||
`~/.babashka` directory for storing caches or whatnot too.
|
||||
|
||||
### Tasks
|
||||
|
||||
Some of these design decisions were formed in [these discussions](https://github.com/babashka/babashka/discussions/779).
|
||||
|
||||
- Tasks do not allow passing arguments to dependent tasks, other than by rebinding `*command-line-args*` (see discussion).
|
||||
- Does the list of dependencies need to be dynamic? No, see discussion (same reason as args)
|
||||
- bb <foo> is resolved as file > task > bb subcommand. Shadowing future subcommand is a problem that a user can solve by renaming a task or file. (same as lein aliases). Also see Conflicts.
|
||||
- It is a feature that tasks are defined as top-level vars (instead of local let-bound symbols). This plays well with the Gilardi scenario, e.g. here: https://github.com/babashka/babashka.github.io/blob/ad276625f6c41f269d19450f236cb54cab2591e1/bb.edn#L7.
|
||||
- The parallel option trickles down into run calls. People who use parallel will be confused if it’s dropped magically, people who don’t use parallel won’t notice anything either way so it doesn’t matter
|
||||
|
||||
## Binary size
|
||||
|
||||
Keep notes here about how adding libraries and classes to Babashka affects the binary size.
|
||||
We're registering the size of the macOS binary (as built on CircleCI).
|
||||
|
||||
2021/06/13 Upgrading from GraalvM 21.0 to 21.1 added roughly 3mb. Issue [here](https://github.com/oracle/graal/issues/3280#issuecomment-846402115).
|
||||
|
||||
2020/10/30 Without httpkit client+server: 68113436. With: 69503316 = 1390kb added.
|
||||
|
||||
2020/05/01 Removed `next.jdbc` and postgres JDBC driver: 48304980
|
||||
|
||||
2020/04/23 Added `next.jdbc` and postgres JDBC driver:
|
||||
|
|
|
|||
5
doc/fly_io/Dockerfile
Normal file
5
doc/fly_io/Dockerfile
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
FROM babashka/babashka:0.8.2
|
||||
|
||||
COPY example.clj /
|
||||
|
||||
ENTRYPOINT bb /example.clj
|
||||
19
doc/fly_io/README.md
Normal file
19
doc/fly_io/README.md
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Deploying a babashka app to fly.io
|
||||
|
||||
[Fly.io](https://fly.io/) is a service that can run full stack apps with minimal
|
||||
configuration. If you like the ease of Heroku, you might like fly.io and perhaps
|
||||
even better! This document shows how to get a minimal babashka application up
|
||||
and running on `fly.io`.
|
||||
|
||||
In `example.clj` we start an http-kit web server which spits out some HTML. You
|
||||
can run this locally by invoking `bb example.clj` from the command line.
|
||||
|
||||
To get this site running on `fly.io`, you need to
|
||||
[install](https://fly.io/docs/getting-started/installing-flyctl/) and [log
|
||||
in](https://fly.io/docs/getting-started/log-in-to-fly/).
|
||||
|
||||
Then run `flyctl launch` to create a new application. After making changes, you
|
||||
can re-deploy the site with `flyctl deploy`.
|
||||
|
||||
That's it! See this
|
||||
[tweet](https://twitter.com/borkdude/status/1526175120825401344) for a demo.
|
||||
21
doc/fly_io/example.clj
Normal file
21
doc/fly_io/example.clj
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
(ns example
|
||||
(:require [hiccup2.core :refer [html]]
|
||||
[org.httpkit.server :refer [run-server]]))
|
||||
|
||||
(def port (or (some-> (System/getenv "PORT")
|
||||
parse-long)
|
||||
8092))
|
||||
|
||||
(run-server
|
||||
(fn [_]
|
||||
{:body
|
||||
(str (html
|
||||
[:html
|
||||
[:body
|
||||
[:h1 "Hello world!"]
|
||||
[:p (str "This site is running with babashka v"
|
||||
(System/getProperty "babashka.version"))]]]))})
|
||||
{:port port})
|
||||
|
||||
(println "Site running on port" port)
|
||||
@(promise)
|
||||
41
doc/fly_io/fly.toml
Normal file
41
doc/fly_io/fly.toml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# fly.toml file generated for shy-sound-2847 on 2022-05-16T14:12:38+02:00
|
||||
|
||||
app = "shy-sound-2847"
|
||||
|
||||
kill_signal = "SIGINT"
|
||||
kill_timeout = 5
|
||||
processes = []
|
||||
|
||||
[env]
|
||||
PORT = "8092"
|
||||
|
||||
[experimental]
|
||||
allowed_public_ports = []
|
||||
auto_rollback = true
|
||||
|
||||
[[services]]
|
||||
http_checks = []
|
||||
internal_port = 8092
|
||||
processes = ["app"]
|
||||
protocol = "tcp"
|
||||
script_checks = []
|
||||
|
||||
[services.concurrency]
|
||||
hard_limit = 25
|
||||
soft_limit = 20
|
||||
type = "connections"
|
||||
|
||||
[[services.ports]]
|
||||
force_https = true
|
||||
handlers = ["http"]
|
||||
port = 80
|
||||
|
||||
[[services.ports]]
|
||||
handlers = ["tls", "http"]
|
||||
port = 443
|
||||
|
||||
[[services.tcp_checks]]
|
||||
grace_period = "1s"
|
||||
interval = "15s"
|
||||
restart_limit = 0
|
||||
timeout = "2s"
|
||||
99
doc/libraries.csv
Normal file
99
doc/libraries.csv
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
maven-name,git-url
|
||||
aero/aero,http://github.com/juxt/aero
|
||||
amperity/vault-clj,https://github.com/amperity/vault-clj
|
||||
aysylu/loom,https://github.com/aysylu/loom
|
||||
babashka/babashka.curl,https://github.com/babashka/babashka.curl
|
||||
better-cond/better-cond,https://github.com/Engelberg/better-cond
|
||||
borkdude/deps,https://github.com/borkdude/deps.clj
|
||||
borkdude/missing.test.assertions,https://github.com/borkdude/missing.test.assertions
|
||||
borkdude/rewrite-edn,https://github.com/borkdude/rewrite-edn
|
||||
camel-snake-kebab/camel-snake-kebab,https://github.com/clj-commons/camel-snake-kebab
|
||||
cc.qbits/auspex,https://github.com/mpenet/auspex
|
||||
cheshire/cheshire,https://github.com/dakrone/cheshire
|
||||
circleci/bond,https://github.com/circleci/bond
|
||||
cli-matic/cli-matic,https://github.com/l3nz/cli-matic.git
|
||||
clj-commons/clj-yaml,https://github.com/clj-commons/clj-yaml
|
||||
clj-commons/fs,https://github.com/clj-commons/fs
|
||||
clj-commons/multigrep,https://github.com/clj-commons/multigrep
|
||||
clj-stacktrace/clj-stacktrace,https://github.com/mmcgrana/clj-stacktrace
|
||||
clojure-csv/clojure-csv,https://github.com/davidsantiago/clojure-csv
|
||||
clojure-msgpack/clojure-msgpack,https://github.com/edma2/clojure-msgpack
|
||||
clojure-term-colors/clojure-term-colors,https://github.com/trhura/clojure-term-colors
|
||||
com.exoscale/lingo,https://github.com/exoscale/lingo
|
||||
com.github.askonomm/clarktown,https://github.com/askonomm/clarktown
|
||||
com.github.rawleyfowler/sluj,https://github.com/rawleyfowler/sluj
|
||||
com.github.seancorfield/expectations,https://github.com/clojure-expectations/clojure-test
|
||||
com.github.seancorfield/honeysql,https://github.com/seancorfield/honeysql
|
||||
com.grammarly/omniconf,https://github.com/grammarly/omniconf
|
||||
com.layerware/hugsql-core,
|
||||
com.rpl/specter,https://github.com/redplanetlabs/specter
|
||||
com.stuartsierra/component,https://github.com/stuartsierra/component
|
||||
com.stuartsierra/dependency,https://github.com/stuartsierra/dependency
|
||||
com.wsscode/cljc-misc,https://github.com/wilkerlucio/cljc-misc
|
||||
comb/comb,https://github.com/weavejester/comb
|
||||
cprop/cprop,https://github.com/tolitius/cprop
|
||||
crispin/crispin,https://github.com/dunaj-project/crispin
|
||||
dev.nubank/docopt,https://github.com/nubank/docopt.clj
|
||||
djblue/portal,https://github.com/djblue/portal
|
||||
doric/doric,https://github.com/joegallo/doric
|
||||
douglass/clj-psql,https://github.com/DarinDouglass/clj-psql
|
||||
edn-query-language/eql,https://github.com/edn-query-language/eql
|
||||
environ/environ,https://github.com/weavejester/environ
|
||||
exoscale/coax,https://github.com/exoscale/coax
|
||||
exoscale/interceptor,https://github.com/exoscale/interceptor
|
||||
expound/expound,https://github.com/bhb/expound
|
||||
failjure/failjure,https://github.com/adambard/failjure
|
||||
ffclj/ffclj,https://github.com/luissantos/ffclj
|
||||
gaka/gaka,https://github.com/cdaddr/gaka
|
||||
hato/hato,https://github.com/gnarroway/hato
|
||||
henryw374/cljc.java-time,https://github.com/henryw374/cljc.java-time
|
||||
hiccup/hiccup,http://github.com/weavejester/hiccup
|
||||
honeysql/honeysql,https://github.com/seancorfield/honeysql
|
||||
http-kit/http-kit,https://github.com/http-kit/http-kit
|
||||
integrant/integrant,https://github.com/weavejester/integrant
|
||||
io.aviso/pretty,https://github.com/AvisoNovate/pretty
|
||||
io.github.cognitect-labs/test-runner,https://github.com/cognitect-labs/test-runner
|
||||
io.github.swirrl/dogstatsd,https://github.com/swirrl/dogstatsd
|
||||
io.github.technomancy/limit-break,https://github.com/technomancy/limit-break
|
||||
io.helins/binf,https://github.com/helins/binf.cljc
|
||||
io.lambdaforge/datalog-parser,https://github.com/lambdaforge/datalog-parser
|
||||
io.replikativ/hasch,https://github.com/replikativ/hasch
|
||||
java-http-clj/java-http-clj,http://www.github.com/schmee/java-http-clj
|
||||
lambdaisland/regal,https://github.com/lambdaisland/regal
|
||||
listora/again,https://github.com/liwp/again
|
||||
markdown-clj/markdown-clj,https://github.com/yogthos/markdown-clj
|
||||
meander/epsilon,https://github.com/noprompt/meander
|
||||
medley/medley,https://github.com/weavejester/medley
|
||||
meta-merge/meta-merge,https://github.com/weavejester/meta-merge
|
||||
metosin/malli,https://github.com/metosin/malli
|
||||
minimallist/minimallist,https://github.com/green-coder/minimallist
|
||||
mvxcvi/arrangement,https://github.com/greglook/clj-arrangement
|
||||
net.cgrand/xforms,https://github.com/cgrand/xforms
|
||||
orchestra/orchestra,https://github.com/jeaye/orchestra
|
||||
org.babashka/spec.alpha,https://github.com/babashka/spec.alpha
|
||||
org.clj-commons/clj-http-lite,https://github.com/clj-commons/clj-http-lite
|
||||
org.clj-commons/digest,https://github.com/clj-commons/clj-digest
|
||||
org.clojars.askonomm/ruuter,https://github.com/askonomm/ruuter
|
||||
org.clojars.lispyclouds/contajners,https://github.com/lispyclouds/contajners
|
||||
org.clojure/algo.monads,https://github.com/clojure/algo.monads
|
||||
org.clojure/core.match,https://github.com/clojure/core.match
|
||||
org.clojure/data.csv,https://github.com/clojure/data.csv
|
||||
org.clojure/data.generators,https://github.com/clojure/data.generators
|
||||
org.clojure/data.json,https://github.com/clojure/data.json
|
||||
org.clojure/data.zip,https://github.com/clojure/data.zip
|
||||
org.clojure/math.combinatorics,https://github.com/clojure/math.combinatorics
|
||||
org.clojure/math.numeric-tower,https://github.com/clojure/math.numeric-tower
|
||||
org.clojure/test.check,https://github.com/clojure/test.check
|
||||
org.clojure/tools.gitlibs,https://github.com/clojure/tools.gitlibs
|
||||
org.clojure/tools.namespace,https://github.com/clojure/tools.namespace
|
||||
postmortem/postmortem,https://github.com/athos/Postmortem
|
||||
prismatic/schema,https://github.com/plumatic/schema
|
||||
progrock/progrock,https://github.com/weavejester/progrock
|
||||
reifyhealth/specmonstah,https://github.com/reifyhealth/specmonstah
|
||||
rewrite-clj/rewrite-clj,https://github.com/clj-commons/rewrite-clj
|
||||
rm-hull/jasentaa,https://github.com/rm-hull/jasentaa
|
||||
selmer/selmer,https://github.com/yogthos/Selmer
|
||||
slingshot/slingshot,https://github.com/scgilardi/slingshot
|
||||
table/table,https://github.com/cldwalker/table
|
||||
testdoc/testdoc,https://github.com/liquidz/testdoc
|
||||
version-clj/version-clj,https://github.com/xsc/version-clj
|
||||
|
390
doc/libraries.md
390
doc/libraries.md
|
|
@ -1,389 +1 @@
|
|||
# Libraries and projects
|
||||
|
||||
The following libraries and projects are known to work with babashka.
|
||||
|
||||
Table of contents:
|
||||
|
||||
- [Libraries](#libraries)
|
||||
- [Pods](#pods)
|
||||
- [Projects](#projects)
|
||||
|
||||
## Libraries
|
||||
|
||||
### [clj-http-lite](https://github.com/babashka/clj-http-lite)
|
||||
|
||||
A fork of a fork of `clj-http-lite`. Example:
|
||||
|
||||
``` shell
|
||||
$ export BABASHKA_CLASSPATH="$(clojure -Sdeps '{:deps {clj-http-lite {:git/url "https://github.com/babashka/clj-http-lite" :sha "f44ebe45446f0f44f2b73761d102af3da6d0a13e"}}}' -Spath)"
|
||||
|
||||
$ bb "(require '[clj-http.lite.client :as client]) (:status (client/get \"https://www.clojure.org\"))"
|
||||
200
|
||||
```
|
||||
|
||||
### [spartan.spec](https://github.com/borkdude/spartan.spec/)
|
||||
|
||||
An babashka-compatible implementation of `clojure.spec.alpha`.
|
||||
|
||||
### [missing.test.assertions](https://github.com/borkdude/missing.test.assertions)
|
||||
|
||||
This library checks if no assertions have been made in a test:
|
||||
|
||||
``` shell
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {borkdude/missing.test.assertions {:git/url "https://github.com/borkdude/missing.test.assertions" :sha "603cb01bee72fb17addacc53c34c85612684ad70"}}}')
|
||||
|
||||
$ lein bb "(require '[missing.test.assertions] '[clojure.test :as t]) (t/deftest foo) (t/run-tests)"
|
||||
|
||||
Testing user
|
||||
WARNING: no assertions made in test foo
|
||||
|
||||
Ran 1 tests containing 0 assertions.
|
||||
0 failures, 0 errors.
|
||||
{:test 1, :pass 0, :fail 0, :error 0, :type :summary}
|
||||
```
|
||||
|
||||
### [medley](https://github.com/weavejester/medley/)
|
||||
|
||||
Requires `bb` >= v0.0.71. Latest coordinates checked with with bb:
|
||||
|
||||
``` clojure
|
||||
{:git/url "https://github.com/weavejester/medley" :sha "a4e5fb5383f5c0d83cb2d005181a35b76d8a136d"}
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
``` shell
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {medley {:git/url "https://github.com/weavejester/medley" :sha "a4e5fb5383f5c0d83cb2d005181a35b76d8a136d"}}}')
|
||||
|
||||
$ bb -e "(require '[medley.core :as m]) (m/index-by :id [{:id 1} {:id 2}])"
|
||||
{1 {:id 1}, 2 {:id 2}}
|
||||
```
|
||||
|
||||
### [limit-break](https://github.com/technomancy/limit-break)
|
||||
|
||||
A debug REPL library.
|
||||
|
||||
Latest coordinates checked with with bb:
|
||||
|
||||
``` clojure
|
||||
{:git/url "https://github.com/technomancy/limit-break" :sha "050fcfa0ea29fe3340927533a6fa6fffe23bfc2f" :deps/manifest :deps}
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
``` shell
|
||||
$ export BABASHKA_CLASSPATH="$(clojure -Sdeps '{:deps {limit-break {:git/url "https://github.com/technomancy/limit-break" :sha "050fcfa0ea29fe3340927533a6fa6fffe23bfc2f" :deps/manifest :deps}}}' -Spath)"
|
||||
|
||||
$ bb "(require '[limit.break :as lb]) (let [x 1] (lb/break))"
|
||||
Babashka v0.0.49 REPL.
|
||||
Use :repl/quit or :repl/exit to quit the REPL.
|
||||
Clojure rocks, Bash reaches.
|
||||
|
||||
break> x
|
||||
1
|
||||
```
|
||||
|
||||
### [clojure-csv](https://github.com/davidsantiago/clojure-csv)
|
||||
|
||||
A library for reading and writing CSV files. Note that babashka already comes
|
||||
with `clojure.data.csv`, but in case you need this other library, this is how
|
||||
you can use it:
|
||||
|
||||
``` shell
|
||||
export BABASHKA_CLASSPATH="$(clojure -Sdeps '{:deps {clojure-csv {:mvn/version "RELEASE"}}}' -Spath)"
|
||||
|
||||
./bb -e "
|
||||
(require '[clojure-csv.core :as csv])
|
||||
(csv/write-csv (csv/parse-csv \"a,b,c\n1,2,3\"))
|
||||
"
|
||||
```
|
||||
|
||||
### [regal](https://github.com/lambdaisland/regal)
|
||||
|
||||
Requires `bb` >= v0.0.71. Latest coordinates checked with with bb:
|
||||
|
||||
``` clojure
|
||||
{:git/url "https://github.com/lambdaisland/regal" :sha "d4e25e186f7b9705ebb3df6b21c90714d278efb7"}
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
``` shell
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {regal {:git/url "https://github.com/lambdaisland/regal" :sha "d4e25e186f7b9705ebb3df6b21c90714d278efb7"}}}')
|
||||
|
||||
$ bb -e "(require '[lambdaisland.regal :as regal]) (regal/regex [:* \"ab\"])"
|
||||
#"(?:\Qab\E)*"
|
||||
```
|
||||
|
||||
### [cprop](https://github.com/tolitius/cprop/)
|
||||
|
||||
A clojure configuration libary. Latest test version: `"0.1.16"`.
|
||||
|
||||
### [comb](https://github.com/weavejester/comb)
|
||||
|
||||
Simple templating system for Clojure. Latest tested version: `"0.1.1"`.
|
||||
|
||||
``` clojure
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {comb {:mvn/version "0.1.1"}}}')
|
||||
$ rlwrap bb
|
||||
...
|
||||
user=> (require '[comb.template :as template])
|
||||
user=> (template/eval "<% (dotimes [x 3] %>foo<% ) %>")
|
||||
"foofoofoo"
|
||||
user=> (template/eval "Hello <%= name %>" {:name "Alice"})
|
||||
"Hello Alice"
|
||||
user=> (def hello (template/fn [name] "Hello <%= name %>"))
|
||||
user=> (hello "Alice")
|
||||
"Hello Alice"
|
||||
```
|
||||
|
||||
### [nubank/docopt](https://github.com/nubank/docopt.clj#babashka)
|
||||
|
||||
Docopt implementation in Clojure, compatible with babashka.
|
||||
|
||||
### [arrangement](https://github.com/greglook/clj-arrangement)
|
||||
|
||||
A micro-library which provides a total-ordering comparator for Clojure
|
||||
values. Tested with version `1.2.0`.
|
||||
|
||||
### [clojure.math.combinatorics](https://github.com/clojure/math.combinatorics)
|
||||
|
||||
``` clojure
|
||||
$ bb --classpath "$(clojure -Spath -Sdeps '{:deps {org.clojure/math.combinatorics {:mvn/version "0.1.6"}}}')" \
|
||||
-e "(use 'clojure.math.combinatorics) (permutations [:a :b])"
|
||||
((:a :b) (:b :a))
|
||||
```
|
||||
|
||||
### [testdoc](https://github.com/liquidz/testdoc)
|
||||
|
||||
Yet another doctest implementation in Clojure.
|
||||
|
||||
``` clojure
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Sdeps '{:deps {testdoc {:mvn/version "1.2.0"}}}' -Spath)
|
||||
|
||||
$ bb '(ns foo (:use clojure.test testdoc.core))
|
||||
(defn foo "
|
||||
=> (foo)
|
||||
:foox"
|
||||
[] :foo)
|
||||
|
||||
(deftest footest
|
||||
(is (testdoc (var foo))))
|
||||
|
||||
(test-var (var footest))'
|
||||
|
||||
FAIL in (footest) (:1)
|
||||
(= (foo) :foox)
|
||||
expected: :foox
|
||||
actual: :foo
|
||||
```
|
||||
|
||||
### [doric](https://github.com/joegallo/doric)
|
||||
|
||||
Library for printing tables.
|
||||
|
||||
``` clojure
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {doric {:mvn/version "0.9.0"}}}')
|
||||
$ bb "(use 'doric.core) (println (table [:a :b :c] [{:a 1 :b 2 :c 3} {:a 4 :b 5 :c 6}]))"
|
||||
|---+---+---|
|
||||
| A | B | C |
|
||||
|---+---+---|
|
||||
| 1 | 2 | 3 |
|
||||
| 4 | 5 | 6 |
|
||||
|---+---+---|
|
||||
```
|
||||
|
||||
### [clojure.data.zip](https://github.com/clojure/data.zip)
|
||||
|
||||
Utilities for clojure.zip, among other things a more fluent way to work
|
||||
with xml.
|
||||
|
||||
Small sample:
|
||||
``` clojure
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {org.clojure/data.zip {:mvn/version "1.0.0"}}}')
|
||||
|
||||
$ cat data_zip_xml.clj
|
||||
(require '[clojure.data.xml :as xml])
|
||||
(require '[clojure.zip :as zip])
|
||||
(require '[clojure.data.zip.xml :refer [text attr attr= xml-> xml1-> text=]])
|
||||
|
||||
(def data (str "<root>"
|
||||
" <character type=\"person\" name=\"alice\" />"
|
||||
" <character type=\"animal\" name=\"march hare\" />"
|
||||
"</root>"))
|
||||
|
||||
(let [xml (-> data java.io.StringReader. xml/parse zip/xml-zip)]
|
||||
(prn :alice-is-a (xml1-> xml :character [(attr= :name "alice")] (attr :type)))
|
||||
(prn :animal-is-called (xml1-> xml :character [(attr= :type "animal")] (attr :name))))
|
||||
|
||||
$ bb data_zip_xml.clj
|
||||
:alice-is-a "person"
|
||||
:animal-is-called "march hare"
|
||||
```
|
||||
(see for exaple [this article](https://blog.korny.info/2014/03/08/xml-for-fun-and-profit.html#datazip-for-zipper-awesomeness)
|
||||
for more on clojure.data.zip).
|
||||
|
||||
### [clj-psql](https://github.com/DarinDouglass/clj-psql)
|
||||
|
||||
A small Clojure wrapper for interacting with `psql`.
|
||||
|
||||
```clojure
|
||||
user> (psql/query conn "select name, subject from grades where grade = 100")
|
||||
=> ({:name "Bobby Tables", :subject "Math"}
|
||||
{:name "Suzy Butterbean", :subject "Math"})
|
||||
```
|
||||
|
||||
### [camel-snake-kebab](https://github.com/clj-commons/camel-snake-kebab)
|
||||
|
||||
A library for word case conversions.
|
||||
|
||||
### [aero](https://github.com/juxt/aero/)
|
||||
|
||||
A small library for explicit, intentful configuration.
|
||||
|
||||
### [clojure.data.generators](https://github.com/clojure/data.generators)
|
||||
|
||||
Random data generators
|
||||
|
||||
### [honeysql](https://github.com/seancorfield/honeysql)
|
||||
|
||||
Turn Clojure data structures into SQL
|
||||
|
||||
### [bond](https://github.com/circleci/bond)
|
||||
|
||||
Spying and stubbing library, primarily intended for tests.
|
||||
|
||||
### [portal](https://github.com/djblue/portal/)
|
||||
|
||||
A clojure tool to navigate through your data. This example will launch a browser to view your `deps.edn`:
|
||||
|
||||
``` clojure
|
||||
$ cat deps.edn | bb -cp `clojure -Spath -Sdeps '{:deps {djblue/portal {:mvn/version "0.4.1"}}}'` -m portal.main edn
|
||||
```
|
||||
|
||||
### [version-clj](https://github.com/xsc/version-clj)
|
||||
|
||||
Analysis and comparison of artifact version numbers.
|
||||
|
||||
``` clojure
|
||||
> export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {version-clj/version-clj {:mvn/version "0.1.2"}}}')
|
||||
> bb --repl
|
||||
...
|
||||
user=> (require '[version-clj.core :as ver])
|
||||
nil
|
||||
user=> (ver/version->seq "1.0.0-SNAPSHOT")
|
||||
[(1 0 0) ["snapshot"]]
|
||||
user=> (ver/version-compare "1.2.3" "1.0.0")
|
||||
1
|
||||
user=> (ver/version-compare "1.0.0-SNAPSHOT" "1.0.0")
|
||||
-1
|
||||
user=> (ver/version-compare "1.0" "1.0.0")
|
||||
0
|
||||
```
|
||||
|
||||
## Pods
|
||||
|
||||
[Babashka pods](https://github.com/babashka/babashka.pods) are programs that can
|
||||
be used as Clojure libraries by babashka.
|
||||
|
||||
- [babashka-sql-pods](https://github.com/babashka/babashka-sql-pods): pods for
|
||||
interacting with SQL databases (PostgreSQL and HSQLDB)
|
||||
- [bootleg](https://github.com/retrogradeorbit/bootleg): static HTML website
|
||||
generation
|
||||
- [brisk](https://github.com/justone/brisk): Freeze and thaw with Nippy at the
|
||||
command line
|
||||
- [clj-kondo](https://github.com/borkdude/clj-kondo/#babashka-pod): a Clojure
|
||||
linter
|
||||
- [pod-babashka-filewatcher](https://github.com/babashka/pod-babashka-filewatcher): a
|
||||
filewatcher pod based on Rust notify
|
||||
- [pod-babashka-lanterna](https://github.com/babashka/pod-babashka-lanterna): a
|
||||
pod for making TUIs based on
|
||||
[clojure-lanterna](https://github.com/babashka/clojure-lanterna)
|
||||
- [pod-babashka-parcera](https://github.com/babashka/pod-babashka-parcera): pod around the parcera Clojure parser
|
||||
- [pod-janet-peg](https://github.com/sogaiu/pod-janet-peg): a pod for
|
||||
calling [Janet](https://github.com/janet-lang/janet)'s PEG
|
||||
functionality
|
||||
- [pod-jaydeesimon-jsoup](https://github.com/jaydeesimon/pod-jaydeesimon-jsoup):
|
||||
a pod for parsing HTML using CSS queries backed by Jsoup
|
||||
- [pod-lispyclouds-docker](https://github.com/lispyclouds/pod-lispyclouds-docker):
|
||||
A pod for interacting with docker
|
||||
- [pod-tzzh-aws](https://github.com/tzzh/pod-tzzh-aws): pod for interacting with AWS
|
||||
- [pod-tzzh-kafka](https://github.com/tzzh/pod-tzzh-kafka): pod for interacting with Kafka
|
||||
- [pod-tzzh-mail](https://github.com/tzzh/pod-tzzh-mail): pod for sending mail
|
||||
- [pod.xledger.sql-server](https://github.com/xledger/pod_sql_server): pod for interacting with SQL Server
|
||||
- [tabl](https://github.com/justone/tabl): Make tables from data in your terminal
|
||||
|
||||
## Projects
|
||||
|
||||
### [babashka-test-action](https://github.com/marketplace/actions/babashka-test-action)
|
||||
|
||||
Github Action to run clojure.test by Babashka.
|
||||
|
||||
### [deps.clj](https://github.com/borkdude/deps.clj)
|
||||
|
||||
A port of the [clojure](https://github.com/clojure/brew-install/) bash script to
|
||||
Clojure / babashka.
|
||||
|
||||
Also see [deps.clj documentation](../doc/deps.clj.md).
|
||||
|
||||
### [4bb](https://github.com/porkostomus/4bb)
|
||||
|
||||
4clojure as a babashka script!
|
||||
|
||||
### [babashka lambda layer](https://github.com/dainiusjocas/babashka-lambda-layer)
|
||||
|
||||
Babashka Lambda runtime packaged as a Lambda layer.
|
||||
|
||||
### [Release on push Github action](https://github.com/rymndhng/release-on-push-action)
|
||||
|
||||
Github Action to create a git tag + release when pushed to master. Written in
|
||||
babashka.
|
||||
|
||||
### [justone/bb-scripts](https://github.com/justone/bb-scripts)
|
||||
|
||||
A collection of scripts developed by [@justone](https://github.com/justone).
|
||||
|
||||
### [nativity](https://github.com/MnRA/nativity)
|
||||
|
||||
Turn babashka scripts into binaries using GraalVM `native-image`.
|
||||
|
||||
### [cldwalker/bb-clis](https://github.com/cldwalker/bb-clis)
|
||||
|
||||
A collection of scripts developed by [@cldwalker](https://github.com/cldwalker).
|
||||
|
||||
### [krell template](https://github.com/ampersanda/krell-template-runner)
|
||||
|
||||
Babashka script for creating React Native (Krell) project
|
||||
|
||||
### [wee-httpd](https://github.com/bherrmann7/bb-common/blob/master/wee_httpd.bb)
|
||||
|
||||
A wee multi-threaded web server
|
||||
|
||||
### [covid19-babashka](https://github.com/agrison/covid19-babashka)
|
||||
|
||||
A babashka script to obtain covid-19 related information.
|
||||
|
||||
### [bb-spotify](https://github.com/kolharsam/bb-spotify)
|
||||
|
||||
Contol your spotify player using babashka.
|
||||
|
||||
### [lambdaisland/open-source](https://github.com/lambdaisland/open-source)
|
||||
|
||||
[Internal
|
||||
tooling](https://github.com/borkdude/babashka/issues/457#issuecomment-636739415)
|
||||
used by Lambda Island projects. Noteworthy: a [babashka-compatible hiccup
|
||||
script](https://github.com/lambdaisland/open-source/blob/2cfde3dfb460e72f047bf94e6f5ec7f519c6d7a0/src/lioss/hiccup.clj).
|
||||
|
||||
There's also
|
||||
[subshell](https://github.com/lambdaisland/open-source/blob/master/src/lioss/subshell.clj)
|
||||
which is like sh/sh, but it inherits stdin/stdout/stderr, so that the user sees
|
||||
in real time what the subprocess is doing, and can possibly interact with
|
||||
it. More like how shelling out in a bash script works.
|
||||
|
||||
### [dharrigan/spotifyd-notification](https://github.com/dharrigan/spotifyd-notification)
|
||||
|
||||
An example of using babashka to show spotifyd notifications via dunst.
|
||||
|
||||
### [nextjournal/ssh-github-auth](https://github.com/nextjournal/ssh-github-auth)
|
||||
|
||||
A babashka script which uses github auth to fetch SSH public keys. It can be useful to ensure only a certain team of people can access machines with SSH.
|
||||
Moved to [projects.md](projects.md).
|
||||
|
|
|
|||
591
doc/news.md
Normal file
591
doc/news.md
Normal file
|
|
@ -0,0 +1,591 @@
|
|||
# News
|
||||
|
||||
This page keeps track of babashka-related new items. Feel free to make a PR if
|
||||
you have anything to add. Also see
|
||||
[#babashka](https://twitter.com/hashtag/babashka?src=hashtag_click&f=live) on
|
||||
Twitter.
|
||||
|
||||
## 2023-05 ([Twitter](https://twitter.com/search?q=(%23babashka%20OR%20babashka)%20since%3A2023-05-01%20until%3A2023-06-01&src=typed_query&f=live), [Mastodon](https://mastodon.social/tags/babashka))
|
||||
|
||||
### Releases
|
||||
|
||||
1.3.178
|
||||
|
||||
Mostly a boring maintenance release with lib upgrades!
|
||||
|
||||
### Events
|
||||
|
||||
- [Babashka-conf](https://babashka.org/conf/) is happening June 10th in
|
||||
Berlin. Only a few tickets left! See the [schedule](https://babashka.org/conf/schedule.html). Also you can buy a [conf t-shirt](https://www.etsy.com/listing/1475981599/babashka-conf-berlin-2023-t-shirt) now! See Nikita wearing it [here](https://twitter.com/nikitonsky/status/1658066530800742400)!
|
||||
|
||||
Thanks to conference sponsors:
|
||||
|
||||
<img src="https://pbs.twimg.com/media/Fw5h-0_XwA4DTIj?format=jpg&name=medium" width="200px">
|
||||
|
||||
- Babashka is going to the [Strange Loop](https://www.thestrangeloop.com/) conference!
|
||||
|
||||
### Projects
|
||||
|
||||
- [beep-boop](https://github.com/pesterhazy/beep-boop): Audible and visual feedback for test runs
|
||||
- [panas.example](https://github.com/keychera/panas.example): All htmx examples ported to babashka!
|
||||
- [utility-scripts](https://github.com/somecho/utility-scripts): A collection of helper scripts for Clojure, Java, Ledger and Taskwarrior. Written in Clojure
|
||||
- [bb-scripts](https://github.com/techconative/bb-scripts): Babashka scripts for common utilities
|
||||
- [Launching bb tasks from emacs](https://mastodon.social/@mykhaylo@fosstodon.org/110456087708592838)
|
||||
|
||||
### Articles
|
||||
|
||||
- [Clojure in security: Docker](https://www.juxt.pro/blog/clojure-in-docker/): mentions babashka and clj-kondo
|
||||
- [Changing my mind: Converting a script from bash to Babashka](https://blog.agical.se/en/posts/changing-my-mind--converting-a-script-from-bash-to-babashka/)
|
||||
- [How to create a really simple ClojureCLR dependency tool](https://blog.agical.se/en/posts/how-to-create-a-really-simple-clojureclr-dependency-tool/) with babashka
|
||||
- [Making a resume with Node.js babashka (nbb)](https://yogthos.net/posts/2023-05-12-nbb-resume.html)
|
||||
|
||||
## 2023-04 ([Twitter](https://twitter.com/search?q=(%23babashka%20OR%20babashka)%20since%3A2023-04-01%20until%3A2023-05-01&src=typed_query&f=live), [Mastodon](https://mastodon.social/tags/babashka))
|
||||
|
||||
[Babashka-conf](https://babashka.org/conf/) is happening June 10th in
|
||||
Berlin. Save the date and/or submit your babashka/clojure-related talk or workshop
|
||||
in the CfP!
|
||||
|
||||
### Releases
|
||||
|
||||
1.3.177
|
||||
|
||||
Biggest highlight: `bb.edn` is now respected relative of a script, no matter the directory you invoke it from! See [docs](https://book.babashka.org/#_script_adjacent_bb_edn).
|
||||
|
||||
### Projects
|
||||
|
||||
- [babashka-dl](https://github.com/mjhika/babashka-dl): simple install script for babashka on windows
|
||||
- [instaparse-bb](https://github.com/babashka/instaparse-bb): Use instaparse from babashka, a new release
|
||||
|
||||
### Videos
|
||||
|
||||
- [Learning clojure w/ @lispyclouds](https://youtu.be/uBTRLBU-83A): a stream with teej_dv, a neovim core dev
|
||||
|
||||
## 2023-03 ([Twitter](https://twitter.com/search?q=(%23babashka%20OR%20babashka)%20since%3A2023-03-01%20until%3A2023-04-01&src=typed_query&f=top), [Mastodon](https://mastodon.social/tags/babashka))
|
||||
|
||||
### Releases
|
||||
|
||||
1.3.176, 1.3.175, 1.2.174:
|
||||
|
||||
Biggest highlight: Switch to GraalVM 19 and enable virtual threads!
|
||||
|
||||
### Videos
|
||||
|
||||
- [Blambda! The sound of babashka and AWS colliding](https://pitch.com/public/03fa9c7e-2b0e-45fb-8a22-d4a4d4d79d24), by Josh Glover from Pitch!
|
||||
|
||||
### Projects
|
||||
|
||||
- [babashka.json](https://github.com/babashka/json): JSON abstraction library
|
||||
- [martian](https://github.com/oliyh/martian) is now babashka compatible!
|
||||
- [panas.reload](https://github.com/keychera/panas.reload): a hot reload for babashka serving html+css (or htmx)
|
||||
- [cljs-exif-reader](https://git.sr.ht/~rwv/cljs-exif-reader): Extract information from TIFF and JPEG images (works in babashka, despite the name)
|
||||
|
||||
### Jobs
|
||||
|
||||
- Write babashka at [Cognician](https://twitter.com/RobStuttaford/status/1641694501793038336)!
|
||||
|
||||
## 2023-02 ([Twitter](https://twitter.com/search?q=(%23babashka%20OR%20babashka)%20since%3A2023-02-01%20until%3A2023-03-01&src=typed_query&f=live), [Mastodon](https://mastodon.social/tags/babashka))
|
||||
|
||||
## Releases
|
||||
|
||||
1.1.173: mostly bugfixes
|
||||
|
||||
### Articles
|
||||
|
||||
- [A technique for live coding simple web pages](https://github.com/whacked/cow/blob/main/a%20technique%20for%20live%20coding%20simple%20web%20pages.md) with babashka
|
||||
|
||||
### Videos
|
||||
|
||||
- [Stockholm Clojure Meetup Feb 23: Blambda! The sound of Babashka and Lambda colliding](https://www.youtube.com/watch?v=NfgYon96dsE)
|
||||
|
||||
### Projects
|
||||
|
||||
- [debux](https://github.com/philoskim/debux) is now babaskha-compatible
|
||||
- [lines-of-code-bb](https://github.com/matthewdowney/linesofcode-bb): Babashka script to count lines of Clojure code, docs, comments, and more
|
||||
- [deps-try](https://github.com/eval/deps-try): a babashka-script to try out Clojure libraries in rebel-readline
|
||||
- [bb-dialog](https://github.com/pixelated-noise/bb-dialog) adds support for `--treeview`
|
||||
- [A duckduck go CLI with babashka and (bbl)gum](https://mastodon.me.uk/@choffee/109845697304457129)
|
||||
- [babashka http-client](https://github.com/babashka/http-client) now supports multipart uploads
|
||||
- [sublime-pretty-edn](https://github.com/oakmac/sublime-pretty-edn): Format, Validate, Minify EDN files in Sublime Text
|
||||
- [Play console tetris in babashka!](https://twitter.com/borkdude/status/1628473136969576449)
|
||||
- [kaocha test runner](https://github.com/lambdaisland/kaocha) became babashka compatible!
|
||||
|
||||
## 2023-01 ([Twitter](https://twitter.com/search?q=%28%23babashka%20OR%20babashka%29%20until%3A2023-02-01%20since%3A2023-01-01&src=typed_query&f=live), [Mastodon](https://mastodon.social/tags/babashka))
|
||||
|
||||
### Releases
|
||||
|
||||
New releases in the past month: 1.0.170 - 1.1.173
|
||||
Release highlights:
|
||||
|
||||
- Support for `data_readers.clj(c)`
|
||||
- Include [http-client](https://github.com/babashka/http-client) as built-in library
|
||||
- Compatibility with [clojure.tools.namespace.repl/refresh](https://github.com/clojure/tools.namespace)
|
||||
- Compatibility with [clojure.java.classpath](https://github.com/clojure/java.classpath) (and other libraries which rely on `java.class.path` and `RT/baseLoader`)
|
||||
- Compatibility with [eftest](https://github.com/weavejester/eftest) test runner (see demo)
|
||||
- Compatibility with [cljfmt](https://github.com/weavejester/cljfmt)
|
||||
- Support for `*loaded-libs*` and `(loaded-libs)`
|
||||
- Support `add-watch` on vars (which adds compatibility with `potemkin.namespaces`)
|
||||
- BREAKING: make printing of script results explicit with `--prn`
|
||||
|
||||
### Events
|
||||
|
||||
- [Babashka Workshop](https://clojure.stream/workshops/babashka) at ClojureStream with Rahul De
|
||||
- [Blambda! The sound of Babashka and Lambda colliding](https://www.meetup.com/sthlm-clj/events/291204199/?utm_medium=referral&utm_campaign=share-btn_savedevents_share_modal&utm_source=twitter): sthlm.clj (Stockholm, Sweden)
|
||||
|
||||
### Articles
|
||||
|
||||
- [Babooka: write command line Clojure](https://www.braveclojure.com/quests/babooka/) by Daniel Higginbotham
|
||||
- [Blambda analyses sites](https://jmglov.net/blog/2023-01-04-blambda-analyses-sites.html) by Josh Glover
|
||||
- [Babashka: How GraalVM Helped Create a Fast-Starting Scripting Environment for Clojure](https://logico-jp.io/2023/01/07/babashka-how-graalvm-helped-create-a-fast-starting-scripting-environment-for-clojure/) in Japanese
|
||||
- [The wizard of HOP - How we built the web based HOP CLI Settings Editor using Babashka and Scittle](https://www.gethop.dev/post/the-wizard-of-hop-how-we-built-the-web-based-hop-cli-settings-editor-using-babashka-and-scittle) by Bingen Galartza
|
||||
- [Simple TUIs with Babashka and Gum](https://rattlin.blog/bbgum.html) by Rattlin.blog
|
||||
- [Babashka And Dialog Part Ii: Announcing The Bb-Dialog Library](https://www.pixelated-noise.com/blog/2023/01/20/bb-dialog-announcement/index.html) by A.C. Danvers
|
||||
- [Re-Writing a GlobalProtect OpenConnect VPN Connect script in Babashka](https://tech.toryanderson.com/2023/01/14/re-writing-a-globalprotect-openconnect-vpn-connect-script-in-babashka/) by Tory Anderson
|
||||
|
||||
### Projects
|
||||
|
||||
Projects that were new, had updates or were made compatible with babashka:
|
||||
|
||||
- [asdf-babashka](https://github.com/pitch-io/asdf-babashka): babashka plugin for the asdf version manager
|
||||
- [babashka-htmx-todoapp](https://github.com/prestancedesign/babashka-htmx-todoapp): Quick example of a todo list SPA using Babashka and HTMX
|
||||
- [bblgum](https://github.com/lispyclouds/bblgum): An extremely tiny and simple wrapper around charmbracelet/gum
|
||||
- [bb-dialog](https://github.com/pixelated-noise/bb-dialog): A simple wrapper library for working with dialog from Babashka
|
||||
- [carve](https://github.com/borkdude/carve): Remove unused Clojure vars
|
||||
- [chr](https://github.com/ThaddeusJiang/chr): native commands history report for the default terminal users
|
||||
- [clj-kondo-bb](https://github.com/clj-kondo/clj-kondo-bb): Invoke clj-kondo from babashka scripts!
|
||||
- [cljfmt](https://github.com/weavejester/cljfmt): A tool for formatting Clojure code
|
||||
- [drepl](https://github.com/claytn/drepl): Node JS dependency-repl. The node repl you already know with easy library installations
|
||||
- [instaparse-bb](https://github.com/babashka/instaparse-bb): Wrapper library aroud pod-babashka-instaparse
|
||||
- [lein2deps](https://github.com/borkdude/lein2deps): Lein project.clj to deps.edn converter
|
||||
- [neil](https://github.com/babashka/neil): A CLI to add common aliases and features to deps.edn-based projects
|
||||
- [obsidian-babashka](https://github.com/filipesilva/obsidian-babashka): Run Obsidian Clojure(Script) codeblocks in Babashka
|
||||
- [pod-babashka-buddy](https://github.com/babashka/pod-babashka-buddy): A pod around buddy core (Cryptographic Api for Clojure)
|
||||
- [quickblog](https://github.com/borkdude/quickblog): Light-weight static blog engine for Clojure and babashka
|
||||
- [solenoid](https://github.com/adam-james-v/solenoid): A small clojure tool for making little control UIs while using the REPL!
|
||||
- [tools.bbuild](https://github.com/babashka/tools.bbuild): babashka version of tools.build
|
||||
- [weather](https://gist.github.com/yogthos/f86e63b856e1413180b2262024ece977): command line util for grabbing current weather for a city using OpenWeather API
|
||||
|
||||
## [2022-12](https://twitter.com/search?q=%28%23babashka%20OR%20babashka%29%20until%3A2023-01-01%20since%3A2022-12-01&src=typed_query&f=live)
|
||||
|
||||
- Releases: [1.0.168](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [How GraalVM Helped Create a Fast-Starting Scripting Environment for Clojure](https://medium.com/graalvm/babashka-how-graalvm-helped-create-a-fast-starting-scripting-environment-for-clojure-b0fcc38b0746)
|
||||
- [http-client](https://github.com/babashka/http-client): a new HTTP client library for babashka
|
||||
- [How to Do Things With Babashka](https://presumably.de/how-to-do-things-with-babashka.html) by Paulus Esterhazy (2022-12)
|
||||
- [Using Babashka to Get Electricity Prices](https://www.karimarttila.fi/clojure/2022/12/04/using-babashka-to-get-electricity-prices) by Kari Marttila
|
||||
- [Adding prompts to your babashka scripts with dialog](https://www.pixelated-noise.com/blog/2022/12/09/dialog-and-babashka/index.html) by A.C. Danvers
|
||||
- [Scraping an HTML dictionary with Babashka and Bootleg](https://blog.exupero.org/scraping-an-html-dictionary-with-babashka-and-bootleg/) by exupero
|
||||
- [quickblog](https://github.com/borkdude/quickblog) v0.1.0: Light-weight static blog engine for Clojure and babashka
|
||||
- [bb-excel](https://github.com/kbosompem/bb-excel): Read Excel Files in babashka scripts
|
||||
- [Get paginated list of issues from gitlab with clojure/babashka](https://gist.github.com/MrGung/29d0547fe45316c3438032fd164d42c6) by Steffen Glückselig
|
||||
- Install development builds: `bash <(curl https://raw.githubusercontent.com/babashka/babashka/master/install) --dev-build --dir /tmp`
|
||||
- [JVM interop improvements in bb](https://twitter.com/borkdude/status/1606280110692352001)
|
||||
- [A little trick to have conditional code for babashka in a .clj file without resorting to .cljc reader conditionals](https://twitter.com/borkdude/status/1599067149187764224)
|
||||
- [Get Advent of Code input in babashka](https://gist.github.com/jeeger/6e39fea94ce49e33d1fa43f40cc36630) by Jan Seeger
|
||||
- [Grabbing current weather for a city using OpenWeather API](https://gist.github.com/yogthos/f86e63b856e1413180b2262024ece977) by Dmitri Sotnikov
|
||||
|
||||
## [2022-11](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-12-01%20since%3A2022-11-01&src=typed_query&f=live)
|
||||
|
||||
- Releases: [1.0.165 - 1.0.167](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- Registration for a [Babashka workshop](https://clojure.stream/workshops/babashka) with Rahul De at ClojureStream is now open!
|
||||
- [Tutkain, a Sublime plugin for clojure based on socket REPL now with support for babashka](https://github.com/eerohele/Tutkain)
|
||||
- [Manage git hooks in babashka](https://blaster.ai/blog/posts/manage-git-hooks-w-babashka.html) by Mykhaylo Bilyanskyy
|
||||
- [Messing around with babashka](Messing around with Babashka) by Ian Muge
|
||||
- [A babashka one liner to inspect data in portal](https://twitter.com/borkdude/status/1597505695800516609)
|
||||
- [Using nREPL as a system interface](https://yogthos.net/posts/2022-11-26-nREPL-system-interaction.html) by Dmitri Sotnikov
|
||||
- [deep-diff2](https://github.com/lambdaisland/deep-diff2) is now babashka-compatible!
|
||||
- [A script to normalize auto-resolved keywords](https://github.com/babashka/babashka/blob/master/examples/normalize-keywords.clj)
|
||||
- [Sum up page counts of books from Calibre library with babashka](https://gist.github.com/jeeger/d13159fefaee33c771be979639900ebc) by Jan Seeger
|
||||
- [Tiny babashka script that returns a random clojure doc](https://gist.github.com/CarnunMP/c592cd3b6e711d56ddd4ca7832b9b251) by Carnun Marcus-Page
|
||||
|
||||
|
||||
## [2022-10](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-11-01%20since%3A2022-10-01&src=typed_query&f=live)
|
||||
|
||||
- Releases: [1.0.164](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [bb-pod-racer](https://github.com/justone/bb-pod-racer): Speed up development of Babashka pods by Nate Jones
|
||||
- [Babashka tasks VSCode plugin](https://marketplace.visualstudio.com/items?itemName=fbeyer.babashka-tasks) by Ferdinand Beyer
|
||||
- A [PR](https://github.com/nextjournal/clerk/pull/232) to get Clerk working in babashka
|
||||
- [lein2deps](https://github.com/borkdude/lein2deps): lein to deps.edn converter
|
||||
- [awyeah-api](https://github.com/grzm/awyeah-api) by Michael Glaesemann v0.8.41 is now available! aws-api for Babashka. Aw yeah!
|
||||
- [bbssh](https://github.com/epiccastle/bbssh/releases/tag/v0.2.0) by Crispin Wellington, v0.2.0 released
|
||||
- [safely use rsync --archive --delete to backup a directory](https://gist.github.com/stelcodes/ddc8ff53de2192dca7d3fee1081ddb77) by Stel Abrego
|
||||
|
||||
## [2022-09](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-10-01%20since%3A2022-09-01&src=typed_query&f=live)
|
||||
|
||||
- Releases: [0.9.162 - 0.10.163](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- Introducing [bbin](https://radsmith.com/bbin): a tool to install babashka scripts on your system by Radford Smith
|
||||
- [bbssh](https://github.com/epiccastle/bbssh): Babashka pod for SSH support by [Epic Castle](https://github.com/epiccastle)
|
||||
- [Loom virtual threads are coming to babashka](https://twitter.com/borkdude/status/1572222344684531717)
|
||||
- [Tiny script to cycle through pulseaudio outputs (aka sinks)](https://gist.github.com/stelcodes/7d9136a5839b645b6cd5bc829a9fe541) by Stel Abrego
|
||||
- [Tetris in the console via pod-babashka-lantera](https://twitter.com/borkdude/status/1569351199404576770)
|
||||
- [org-mode gets support for babashka](https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=764642f55b7a9821acbabcfa1e2d354afab99be7)
|
||||
- [docs for combining babashka process with promesa](https://github.com/babashka/process#promesa)
|
||||
[exoscale/interceptor](https://github.com/exoscale/interceptor) became babashka-compatible!
|
||||
- [Tutkain, socket REPL Sublime plugin, gets better support for babashka](https://twitter.com/borkdude/status/1568315151404924933)
|
||||
- [babashka tweepy](https://github.com/davclark/babashka-tweepy): kicking the tires on using the tweepy library from a babashka task by Dav Clark
|
||||
- [aoc helper](https://github.com/jjcomer/aoc-helper) by Josh Comer
|
||||
- [Dogfooding blambda part 5](https://jmglov.net/blog/2022-09-02-dogfooding-blambda-logs.html) by Josh Glover
|
||||
|
||||
## [2022-08](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-09-01%20since%3A2022-08-01&src=typed_query&f=live)
|
||||
- It's babashka's third birthday on August 9th 2022!
|
||||
- [etaoin](https://github.com/clj-commons/etaoin), Pure Clojure Webdriver protocol implementation, is now babashka-compatible!
|
||||
- [xforms](https://github.com/cgrand/xforms) is now babashka-compatible!
|
||||
- [squint](https://github.com/squint-cljs/squint) and [cherry](https://github.com/squint-cljs/cherry) are CLJS-compilers that work with babashka!
|
||||
|
||||
## [2022-07](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-08-01%20since%3A2022-07-01&src=typed_query&f=live)
|
||||
|
||||
- Releases: [0.8.157 - 0.9.161](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [Recursive document transformations with Pandoc and Clojure](https://play.teod.eu/document-transform-pandoc-clojure/) by Teodor Heggelund
|
||||
- [Babashka toolbox](https://babashka.org/toolbox/): A categorised directory of libraries and tools for Babashka
|
||||
- [Quickblog](https://github.com/borkdude/quickblog): Light-weight static blog engine for Clojure and babashka
|
||||
- Win a babashka t-shirt by participating in [this](https://twitter.com/borkdude/status/1547847843381030912) contest!
|
||||
- [AWS Lambda, now with first class parentheses](https://www.juxt.pro/blog/nbb-lambda) by Ray McDermott (about nbb)
|
||||
- [bb-github-app](https://github.com/brandonstubbs/bb-github-app): An example Babashka Script authenticating as a Github App and interacting with the Checks API
|
||||
- [Ruuter](https://github.com/askonomm/ruuter#setting-up-with-babashka) is a routing library which works very well with bb
|
||||
- [Blambda!](https://jmglov.net/blog/2022-07-03-blambda.html) by Josh Glover
|
||||
- Files with the `.bb` extension are now correctly highlighted as Clojure code on Github! See [this](https://twitter.com/borkdude/status/1543937735429431298) tweet.
|
||||
- Encode and decode files as kroki url diagrams, a [gist](https://gist.github.com/henryw374/070845dbd8cfb4672a3c0d06cf8b00e4) by Henry Widd
|
||||
- Customized bb builds with clj-nix: [tweet](https://twitter.com/jlesquembre/status/1543686641461694470)
|
||||
- Expose Clojure functions in the CLI with babashka and nix: [tweet](https://twitter.com/jlesquembre/status/1546777332471455745)
|
||||
- [Meander](https://github.com/noprompt/meander) is now compatible with bb: [tweet](https://twitter.com/borkdude/status/1542881167338250242)
|
||||
- [Deleting AWS Glacier vaults with babashka](https://javahippie.net/clojure/2022/07/23/deleting-aws-glacier-vaults-with-babashka.html) by Tim Zöller
|
||||
|
||||
|
||||
## [2022-06](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-07-01%20since%3A2022-06-01&src=typed_query&f=live)
|
||||
|
||||
- Releases: [0.8.156](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [AWS wiki page](https://github.com/babashka/babashka/wiki/AWS)
|
||||
- [blambda](https://github.com/jmglov/blambda): Blambda! is a custom runtime for AWS Lambda that lets you write functions using Babashka
|
||||
- [Babashka CLI](https://blog.michielborkent.nl/babashka-cli.html): turn Clojure functions into CLIs!
|
||||
- [Http-server](https://github.com/babashka/http-server#babashka): Serve static assets
|
||||
- [Deps-bundler](https://github.com/MrGung/deps-bundler): Bundle dependencies on
|
||||
a computer that has access to maven and clojars (PC-A) and bring these over to
|
||||
a computer with limited access (PC-L).
|
||||
- [Prismatic/schema](https://github.com/plumatic/schema/blob/master/CHANGELOG.md#130-2022-06-10) and babashka are now compatible
|
||||
- [Logseq bb tasks](https://github.com/logseq/bb-tasks): Reusable babashka tasks used by logseq team
|
||||
- [Breakneck Babashka on K8s](Breakneck Babashka on K8s) by Heow Goodman
|
||||
|
||||
## [2022-05](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-06-01%20since%3A2022-05-01&src=typed_query&f=live)
|
||||
|
||||
- Releases: [0.8.2](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [Etaoin](https://github.com/clj-commons/etaoin) moved to clj-commons and now works with babashka as well.
|
||||
- [Nix docs for babashka](https://github.com/babashka/babashka/blob/master/doc/nix.md)
|
||||
- [Fly.io docs for babashka](https://github.com/babashka/babashka/tree/master/doc/fly_io)
|
||||
- [Babashka survey results](https://blog.michielborkent.nl/babashka-survey-q1-2022.html)
|
||||
- [Quickdoc](https://github.com/borkdude/quickdoc): (Quick and minimal API doc generation for Clojure
|
||||
- [Awyeah-api](https://github.com/grzm/awyeah-api) - Cognitect's aws-api for babashka
|
||||
|
||||
## [2022-04](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-05-01%20since%3A2022-04-01&src=typed_query&f=live)
|
||||
|
||||
- Releases: [0.8.0 - 0.8.1](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [Babashka and Clojure](https://youtu.be/ZvOs5Ele6VE) by Rahul Dé at North Virginia Linux Users Group
|
||||
- [Setup-Clojure](https://github.com/DeLaGuardo/setup-clojure/releases/tag/5.0) Github action is now able to install babashka!
|
||||
- Control Chrome via devtools using [clj-chrome-devtools](https://github.com/tatut/clj-chrome-devtools/blob/master/bb.clj) which runs with bb!
|
||||
- Use pods directly in `bb.edn`: [tweet](https://twitter.com/borkdude/status/1510995356229767172)
|
||||
|
||||
## [2022-03](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-04-01%20since%3A2022-03-01&src=typed_query&f=live)
|
||||
|
||||
- Releases: [0.7.7 - 0.7.8](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [Create a password manager with Clojure using Babashka, sqlite, honeysql and stash](https://youtu.be/jm0RXmyjRJ8) by Daniel Amber
|
||||
- [Detecting inconsistent aliases in a clojure codebase](https://www.youtube.com/watch?v=bf8KLKkCH2g) by Oxalorg
|
||||
- [Clj-konmari](https://github.com/oxalorg/clj-konmari/) by Oxalorg
|
||||
- [Logseq-query](https://github.com/cldwalker/logseq-query) by Gabriel Horner [(announcement tweet with video)](https://twitter.com/cldwalker/status/1506991213030871041)
|
||||
- The [loom](https://github.com/aysylu/loom) library is now compatible [(tweet)](https://twitter.com/borkdude/status/1502237220811550723)
|
||||
- The [at-at](https://github.com/overtone/at-at) library is now compatible
|
||||
|
||||
## [2022-02](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-03-01%20since%3A2022-02-01&src=typed_query&f=live)
|
||||
|
||||
- Releases: [0.7.5 - 0.7.6](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [Spire is available as a babashka pod](https://twitter.com/epic_castle/status/1496784352256008194)
|
||||
- Babashka Clojure template on [Repl.it](https://replit.com/@eccentric-j/Babashka-Clojure-Template?v=1#replit.nix) by Eccentric J
|
||||
- Create a self-contained executable with [caxa](https://github.com/babashka/babashka/wiki/Self-contained-executable)
|
||||
- Cli-matic is now compatible due to this [PR](https://github.com/l3nz/cli-matic/pull/145)
|
||||
- [I, too, Wrote Myself a Static Site Generator](https://dawranliou.com/blog/i-too-wrote-myself-a-static-site-generator/) by Daw-Ran Liou
|
||||
- [Staplegun](https://github.com/escherize/staplegun): Single file clipboard-manager
|
||||
- [Bbb](https://github.com/nikvdp/bbb): make executable CLI tools from bb scripts
|
||||
- [Apptemplate](https://github.com/redstarssystems/apptemplate): Application project template for Clojure featuring bb tasks
|
||||
|
||||
|
||||
## [2022-01](https://twitter.com/search?f=live&q=%28%23babashka%29%20until%3A2022-02-01%20since%3A2022-01-01&src=typed_query)
|
||||
|
||||
- Releases: [0.7.4](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [Babashka dev builds](https://github.com/babashka/babashka-dev-builds)
|
||||
- [Writing Clojure-living-cookbooks](https://www.loop-code-recur.io/live-clojure-cookbooks/) by Cyprien Pannier
|
||||
- [HTMX Todo App](https://github.com/prestancedesign/babashka-htmx-todoapp)
|
||||
- [Better linting for `bb.edn`](https://twitter.com/borkdude/status/1484100071134220291)
|
||||
- [Unwordle](https://github.com/mknoszlig/unwordle): solver for wordle puzzles
|
||||
- [Using babashka with PHP](https://blog.michielborkent.nl/using-babashka-with-php.html) by Michiel Borkent
|
||||
|
||||
## 2021-12
|
||||
|
||||
- Releases: [0.6.8 - 0.7.3](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [Scripting with Babashka on Alfred](https://blog.wsscode.com/babashka-and-alfred/) by Wilker Lucio
|
||||
- [babashka/spec.alpha](https://github.com/babashka/spec.alpha): a fork of spec.alpha that works with babashka.
|
||||
- Several people are doing [Advent of Code puzzles with babashka](https://twitter.com/search?q=%23babashka%20%20%23AdventOfCode&src=typed_query&f=live)
|
||||
- Compatibility with a [fork of tools.namespace](https://github.com/babashka/tools.namespace). This allows
|
||||
running the Cognitect [test-runner](https://github.com/cognitect-labs/test-runner) (Cognitest) from source.
|
||||
- [bb-components](https://github.com/vedang/bb-scripts#bb-components): A script to find all the components that you should deploy your code to.
|
||||
- [Babashka workshop at JavaLand](https://github.com/ijug-ev/JavaLand/tree/main/Community-Aktivit%C3%A4ten#bash-war-gestern-shell-scripting-mit-babashka-clojure-ug-d%C3%BCsseldorf-christian-meter-rheinjug-jens-bendisposto)
|
||||
- Install babashka [dev builds](https://twitter.com/borkdude/status/1475234968146227203)
|
||||
- [Combine babashka and PHP](https://gist.github.com/borkdude/843548cba14ae9d283191e31bc483959)
|
||||
- [System wide babashka tasks](https://twitter.com/borkdude/status/1476656022282551300)
|
||||
- [Run an http file server as a babashka task](https://twitter.com/borkdude/status/1476870516233445377)
|
||||
|
||||
## 2021-11
|
||||
|
||||
- Releases: [0.6.5 - 0.6.7](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [Contajners](https://github.com/lispyclouds/contajners): An idiomatic,
|
||||
data-driven, REPL friendly clojure client for OCI container engines.
|
||||
- [deps-modules](https://github.com/exoscale/deps-modules#babashka): a clojure "tool" that attempts to solve one of the "multi module" project problems with tools.deps in a minimalistic way.
|
||||
- [Moldable Emacs: a Clojure Playground with Babashka](https://ag91.github.io/blog/2021/11/05/moldable-emacs-a-clojure-playground-with-babashka/)
|
||||
- [aws pod 0.1.0](https://twitter.com/borkdude/status/1459117378441261056)
|
||||
- [tools.bbuild](https://github.com/babashka/tools.bbuild): a fork of tools.build that runs with babashka and [tools-deps-native](https://github.com/babashka/tools-deps-native)
|
||||
- [Making markdown-clj babashka compatible](https://blog.michielborkent.nl/markdown-clj-babashka-compatible.html) by Michiel Borkent
|
||||
- [radiale](https://github.com/xlfe/radiale): radiale: home automation project written using #babashka and Python
|
||||
- [Writing a Clojure shell script with Babashka](https://www.youtube.com/watch?v=D-_Mz7rz1po), a video by Max Weber
|
||||
- [makejack](https://github.com/hugoduncan/makejack): A clojure CLI build tool, and build library which can run with babashka.
|
||||
- [I wrote myself a static site generator](https://freeston.me/posts/2021-11-29-new-site-generator/) (in babashka) by Dominic Freeston.
|
||||
- [bipe](https://gist.github.com/borkdude/82dcdd36a1e61ef36f19221876e7b1b6): vipe for babashka
|
||||
|
||||
|
||||
## 2021-10
|
||||
- Releases: [0.6.2-0.6.4](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- Babashka on the [Thoughtworks Technology Radar](https://www.thoughtworks.com/radar/platforms/babashka)
|
||||
- [ruuter](https://github.com/askonomm/ruuter#setting-up-with-babashka) is a
|
||||
routing library compatible with babashka.
|
||||
- A list of [companies](https://github.com/babashka/babashka/blob/master/doc/companies.md) using babashka
|
||||
- Ilshat Sultanov shares his [babashka tasks](https://twitter.com/just_sultanov/status/1446118161258987534)
|
||||
- [Slack the music](https://github.com/javahippie/slack-the-music), a babashka script to update your slack status with your current Apple Music track by Tim Zöller.
|
||||
- [Finding my inner Wes Anderson](https://javahippie.net/clojure/2021/10/18/finding-my-inner-wes-anderson.html) by Tim Zöller.
|
||||
- [Run a local babashka script in a remote server](https://twitter.com/borkdude/status/1451110414062870528)
|
||||
- [Replacing my Octopress blog with 200 lines of Babashka](https://blog.michielborkent.nl/migrating-octopress-to-babashka.html) by Michiel Borkent
|
||||
- The babashka wiki now has a [GNU Emacs](https://github.com/babashka/babashka/wiki/GNU-Emacs) section
|
||||
- Invoke babashka tasks in a [monorepo](https://github.com/babashka/babashka/discussions/1044#discussioncomment-1544956)
|
||||
- [Speeding up builds with fs/modified-since](https://blog.michielborkent.nl/speeding-up-builds-fs-modified-since.html) by Michiel Borkent
|
||||
|
||||
## 2021-09
|
||||
|
||||
- New babashka 0.6.0 released. Highlight: support for `java.net.http` which
|
||||
enables running [java-http-clj](https://github.com/schmee/java-http-clj) from
|
||||
source. The raw interop is the first part of a multi-stage plan to move all
|
||||
http related scripting towards `java.net.http` in favor of the other two
|
||||
solutions currently available in `bb`: `babashka.curl` and
|
||||
`org.httpkit.client`.
|
||||
- [rss-saver](https://github.com/adam-james-v/rss-saver): Simple Clojure (Babashka) script that saves articles from world.hey.com RSS feeds.
|
||||
- [babashka-docker-action-example](https://github.com/borkdude/babashka-docker-action-example)
|
||||
- [script](https://gist.github.com/rutenkolk/dbd970d03a0d012b671db38434ccbfa7) to upgrade zig lang to the latest dev release
|
||||
- [Cursive](https://twitter.com/CursiveIDE/status/1439022267187433472) adds support for babashka in 1.11.0
|
||||
- How to filter tail output with babashka on [StackOverflow](https://stackoverflow.com/questions/69241046/how-to-filter-output-of-tail-with-babashka/69241911?stw=2#69241911)
|
||||
- [Awesome Babashka: Parse & produce HTML and SQLite](https://blog.jakubholy.net/2021/awesome-babashka-dash/) by Jakub Holy
|
||||
- [Neil](https://github.com/babashka/neil): an installable babashka script to add common aliases and features to deps.edn-based projects.
|
||||
|
||||
## 2021-08
|
||||
|
||||
- New babashka 0.5.1 released. Highlight: new `print-deps` command for printing
|
||||
a `deps.edn` map and classpath which includes all built-in deps. This can be
|
||||
used for editor tooling like Cursive and clojure-lsp, but also for migrating a
|
||||
babashka project to a Graal native-image project.
|
||||
- Babashka receives long term funding from [Clojurists Together](https://www.clojuriststogether.org/news/long-term-funding-selections/). Thanks!
|
||||
- Babashka is 2 years old this month: the [first commit](https://github.com/babashka/babashka/commit/6dee50b0face0b890a7f628a63b21d5d706a48ee) was on 9 August 2019!
|
||||
- [nbb](https://github.com/borkdude/nbb): babashka's Node.js cousin
|
||||
- [Cursive](https://twitter.com/CursiveIDE/status/1422540023207915520) adds
|
||||
support for babashka in the latest EAP
|
||||
- [clojure-lsp](https://twitter.com/ericdallo/status/1422559744712138753) adds support for babashka scripts
|
||||
- [bb guestbook](https://github.com/SVMBrown/bb-guestbook) by Scot Brown.
|
||||
- [bb htmx todo app](https://github.com/prestancedesign/babashka-htmx-todoapp) by Michael Sahili.
|
||||
- [bb aws lambda runtime](https://github.com/tatut/bb-lambda) by Tatu Tarvainen.
|
||||
|
||||
## 2021-07
|
||||
|
||||
- New babashka 0.5.0 released. Highlights: `clojure.tools.logging` + `taoensso.timbre` added, source compatibility with `clojure.data.json`.
|
||||
- [Babashka tasks](https://youtu.be/u5ECoR7KT1Y), talk by Michiel Borkent
|
||||
- [Rewriting a clojure file with rewrite-clj and babashka](https://youtu.be/b7NPKsm8gkc), video by Oxalorg
|
||||
- [Babashka tasks for PostgreSQL](https://github.com/babashka/babashka/discussions/929) by Stel Abrego
|
||||
- [String interpolation](https://twitter.com/yogthos/status/1415324124361154561) with Selmer in bb
|
||||
- [Jirazzz](https://github.com/rwstauner/jirazzz): a babashka JIRA client by Randy Stauner
|
||||
- [Babashka + scittle guestbook](https://github.com/kloimhardt/babashka-scittle-guestbook) by Kloimhardt
|
||||
- [Paillier cryptosystem](https://github.com/babashka/babashka/discussions/948) by litteli
|
||||
- [csv-to-yaml.clj](https://github.com/babashka/babashka/discussions/939) by Cora
|
||||
|
||||
## 2021-06
|
||||
|
||||
- New babashka 0.4.4 - 0.4.5 released.
|
||||
- Share your babashka creations on the [Show and tell](https://github.com/babashka/babashka/discussions/categories/show-and-tell) forum on Github.
|
||||
- [Integrating Babashka into Bazel](https://timjaeger.io/20210627-integrating-babashka-with-bazel.html) by Tim Jäger
|
||||
- [Babashka + scittle guestbook example](https://github.com/kloimhardt/babashka-scittle-guestbook)
|
||||
- [Slingshot works with babashka](https://twitter.com/borkdude/status/1402547783295504387)
|
||||
- [Spire gets a babashka pod](https://twitter.com/epic_castle/status/1402212817533431808)
|
||||
- [Text to speech AWS example](https://twitter.com/FieryCodDev/status/1401843357555511301) with scittle and babashka.
|
||||
- [Game of Life](https://gist.github.com/mmzsource/655b9dcfe56eed8a045022837186ed84)
|
||||
- [ob-babashka](https://gist.github.com/adam-james-v/f4d2b75a70b095d14a351a1eff96b4b0): Emacs org-babel functions for babashka.
|
||||
- [Normalize auto-resolved keywords](https://github.com/babashka/babashka/tree/master/examples#normalize-keywordsclj)
|
||||
- [Create PostgreSQL backups](https://twitter.com/stelstuff/status/1400559261025980418) using babashka.
|
||||
- [Change flutter SDK](https://gist.github.com/ampersanda/aac70cc0644df12199ea32988f3c4d73) using babashka.
|
||||
|
||||
## 2021-05
|
||||
|
||||
- Babashka 0.3.7 - 0.4.3 released. Highlights:
|
||||
- New [task runner feature](https://book.babashka.org/#tasks).
|
||||
- Add [Selmer](https://github.com/yogthos/Selmer) to built-in libraries.
|
||||
- Add compatibility with [jasentaa](https://github.com/rm-hull/jasentaa).
|
||||
- New [website](https://babashka.org).
|
||||
- [Talk](https://youtu.be/Yjeh57eE9rg): Babashka: a native Clojure interpreter for scripting — The 2021 Graal Workshop at CGO
|
||||
- [Blog](https://savo.rocks/posts/playing-new-music-on-old-car-stereo-with-clojure-and-babashka/): Playing New Music On Old Car Stereo With Clojure And Babashka
|
||||
- [Homoiconicity and feature flags](https://martinklepsch.org/posts/homoiconicity-and-feature-flags.html) by Martin Klepsch.
|
||||
- [Manage your macOS setup](https://github.com/cldwalker/osx-setup) using babashka.
|
||||
- [Localizing a Ghost theme](https://martinklepsch.org/posts/localizing-a-ghost-theme.html) by Martin Klepsch.
|
||||
- [Babashka SQL pods 0.0.8](https://twitter.com/borkdude/status/1396136828479188997) including a MySQL pod
|
||||
|
||||
## 2021-04
|
||||
|
||||
- Babashka 0.3.2 - 0.3.6 released. See [CHANGELOG.md](https://github.com/babashka/babashka/blob/master/CHANGELOG.md). Highlights:
|
||||
- Add [rewrite-clj](https://github.com/clj-commons/rewrite-clj).
|
||||
- Support for the [binf](https://github.com/helins/binf.cljc) library.
|
||||
- [Sort requires and imports](https://gist.github.com/laurio/01530ea7700752885df21e92bb926f75) using rewrite-clj
|
||||
- Babashka [tasks proposal](https://github.com/babashka/babashka/issues/778), available in babashka 0.3.5
|
||||
- A new useful function in `babashka.fs`: [modified-since](https://babashka.org/fs/babashka.fs.html#var-modified-since)
|
||||
- Using babashka [for animations](https://twitter.com/RustyVermeer/status/1385269161106972673)
|
||||
- [rewrite-edn](https://github.com/borkdude/rewrite-edn) is now compatible with babashka
|
||||
|
||||
## 2021-03
|
||||
|
||||
- Babashka 0.3.0 - 0.3.1 released. See [CHANGELOG.md](https://github.com/babashka/babashka/blob/master/CHANGELOG.md). Highlights: Raspberry Pi support, bb.edn, more flexible main invocation.
|
||||
- [Babashka shebang](https://github.com/borkdude/deps.clj/blob/master/deps.bat#L1-L7) for Windows .bat files
|
||||
- [Datalevin](https://twitter.com/huahaiy/status/1371689142585753604) now works as a babashka pod
|
||||
- [Babashka sql pods](https://github.com/babashka/babashka-sql-pods/blob/master/CHANGELOG.md) update
|
||||
- [JPoint](https://jpoint.ru/en/2021/talks/3nr1czuok3dvtewtcdjalm/) is going to have a talk on babashka
|
||||
- A `python -m http.server` [replacement in babashka](https://gist.github.com/holyjak/36c6284c047ffb7573e8a34399de27d8)
|
||||
- A [PR](https://github.com/ring-clojure/ring-codec/issues/26) to make `ring-codec` compatible with babashka
|
||||
- The [stuartsierra/component](https://github.com/stuartsierra/component) library [seems to work with babashka](https://github.com/babashka/babashka/issues/742)
|
||||
- [pathom3](https://pathom3.wsscode.com/docs/tutorials/babashka/) works with babashka!
|
||||
- [VPN Connect](https://tech.toryanderson.com/2021/03/06/re-writing-an-openconnect-vpn-connect-script-in-babashka/) script
|
||||
- [Github code search](https://gist.github.com/ertugrulcetin/4f35557962fac3d159d8c931e94873e9) script
|
||||
|
||||
## 2021-02
|
||||
|
||||
- Babashka 0.2.9 - 0.2.12 released
|
||||
- [babashka.fs](https://github.com/babashka/fs): utility library for dealing with files (based on java.nio). Bundled with bb 0.2.9.
|
||||
- New [Youtube channel](https://www.youtube.com/channel/UCRCl_R1ihLJt7IOgICdb9Lw) with babashka related videos
|
||||
- MS SQL support for the [babashka sql pods](https://github.com/babashka/babashka-sql-pods/)
|
||||
- [Clojure like its PHP](https://eccentric-j.com/blog/clojure-like-its-php.html): run babashka scripts as CGI scripts
|
||||
- [Automating Video Edits with Clojure and ffmpeg](https://youtu.be/Tmgy57R9HZM) by Adam James
|
||||
- [Gaka](https://github.com/cdaddr/gaka), a CSS-generating library that works with babashka.
|
||||
- [Deploy babashka script to AWS Lambda](https://www.jocas.lt/blog/post/babashka-aws-lambda/) by Dainius Jocas.
|
||||
- [Elisp](https://gist.github.com/llacom/f391f41cbf4de91739b52bf8bb1a6d54) and cider commands to spawn a babashka repl and connect to it
|
||||
- [klein](https://gist.github.com/borkdude/c34e8e44eb5b4a6ca735bf8a86ff64fa), a
|
||||
lein imitation script built on deps.edn
|
||||
- [failjure](https://github.com/adambard/failjure) works with babashka.
|
||||
- A [script](https://gist.github.com/borkdude/58f099b2694d206e6eec18daedc5077b) to solve our mono-repo problem with deps.edn at work.
|
||||
- [Single-script vega-lite plotter](https://gist.github.com/vdikan/6b6063d6e1b00a3cd79bc7b3ce3853d6/)
|
||||
- [Find vars with the clj-kondo pod](https://gist.github.com/borkdude/841d85d5ad04c517337166b3928697bd). Also see [video](https://youtu.be/TvBmtGS0KJE).
|
||||
- [Another setup babashka Github action](https://github.com/marketplace/actions/setup-babashka)
|
||||
- [AWS Lambda + babashka + minimal container image](https://gist.github.com/lukaszkorecki/a1fe27bf08f9b98e9def9da4bcb3264e)
|
||||
- [football script](https://gist.github.com/mmzsource/a732950aa43d19c5a9b63bbb7f20b7eb)
|
||||
- [ffclj](https://github.com/luissantos/ffclj): Clojure ffmpeg wrapper
|
||||
- [clj-lineart](https://github.com/eccentric-j/clj-lineart): Generative line art from a clojure-cgi script
|
||||
- [bunpack](https://github.com/robertfw/bunpack): remembers how to unpack things, so you don't have to
|
||||
- A script to download deps for [all `deps.edn` aliases](https://github.com/babashka/babashka/blob/master/examples/download-aliases.clj)
|
||||
|
||||
## 2021-01
|
||||
|
||||
- Babashka [0.2.8](https://github.com/babashka/babashka/blob/master/CHANGELOG.md#v028) released. This includes new libraries: hiccup, core.match and clojure.test.check.
|
||||
- On 27th of February, Michiel (a.k.a. @borkdude) will do a talk about babashka at the [2021 GraalVM workshop](https://graalworkshop.github.io/2021/).
|
||||
- First release of the [aws pod](https://github.com/babashka/pod-babashka-aws).
|
||||
- A [script](https://gist.github.com/borkdude/ba372c8cee311e31020b04063d88e1be) to print API breakage warnings.
|
||||
- A [script](https://gist.github.com/lgouger/2262e2d2503306f2595e48a7888f4e73) to lazily page through AWS results using the new [aws pod](https://github.com/babashka/pod-babashka-aws).
|
||||
- [Environ](https://github.com/weavejester/environ) works with babashka.
|
||||
- [Expound](https://github.com/bhb/expound) now works with [spartan.spec](https://github.com/borkdude/spartan.spec/blob/master/examples/expound.clj)
|
||||
- A basic [logger](https://gist.github.com/borkdude/c97da85da67c7bcc5671765aef5a89ad) that works in babashka scripts
|
||||
- A basic [router](https://gist.github.com/borkdude/1627f39d072ea05557a324faf5054cf3) based on core.match
|
||||
- A minimal [Github GraphQL client](https://gist.github.com/lagenorhynque/c1419487965c0fa3cf34862852825483)
|
||||
- New developments around babashka on [Raspberry Pi](https://github.com/babashka/babashka/issues/241#issuecomment-763976749)
|
||||
|
||||
## 2020-12
|
||||
|
||||
- A new babashka talk: [Babashka and sci
|
||||
internals](https://youtu.be/pgNp4Lk3gf0). Also see
|
||||
[slides](https://speakerdeck.com/babashka/babashka-and-sci-internals-at-london-clojurians-december-2020)
|
||||
and [REPL
|
||||
session](https://gist.github.com/borkdude/66a4d844668e12ae1a8277af10d6cc4b).
|
||||
- Babashka 0.2.6 released. See [release
|
||||
notes](https://github.com/babashka/babashka/blob/master/CHANGELOG.md#v026).
|
||||
- Babashka 0.2.5 released. See [release
|
||||
notes](https://github.com/babashka/babashka/blob/master/CHANGELOG.md#v025).
|
||||
- First release of the [sqlite pod](https://github.com/babashka/pod-babashka-sqlite3)
|
||||
- First release of the [buddy pod](https://github.com/babashka/pod-babashka-buddy)
|
||||
- The data from the babashka survey is now available
|
||||
[here](https://nl.surveymonkey.com/results/SM-8W8V36DZ7/). I have provided a
|
||||
summary [here](surveys/2020-11.md).
|
||||
- Blog article: [exporter for passwordstore.org](https://www.ieugen.ro/posts/2020/2020-12-26-export-passwords-with-babashka/) by Eugen Stan
|
||||
- [weavejester/progrock](https://github.com/weavejester/progrock) is a babashka-compatible library
|
||||
for printing progress bars.
|
||||
- A [maze animation](https://gist.github.com/mmzsource/e8c383f69244ebefde058004fee72a8a) babashka script by [mmz](https://gist.github.com/mmzsource)
|
||||
|
||||
## 2020-11
|
||||
|
||||
- Babashka [survey](https://nl.surveymonkey.com/r/H2HK3RC). Feedback will be used
|
||||
for future development.
|
||||
- Babashka 0.2.4 released. See [release
|
||||
notes](https://github.com/babashka/babashka/blob/master/CHANGELOG.md#v024).
|
||||
- [Gaiwan.co](https://github.com/lambdaisland/gaiwan_co#tech-stack) are building their static HTML with babashka and [bootleg](https://github.com/retrogradeorbit/bootleg#babashka-pod-usage).
|
||||
- [sha-words](https://github.com/ordnungswidrig/sha-words): A clojure program to
|
||||
turn a sha hash into list of nouns in a predictable jar.
|
||||
- [Stash](https://github.com/rorokimdim/stash): a CLI for encrypted text storage
|
||||
written in Haskell, accessible as pod from babashka and Python!
|
||||
- NextJournal released a babashka [notebook environment](http://nextjournal.com/try/babashka?cm6=1).
|
||||
- [Interdep](https://github.com/rejoice-cljc/interdep) manages interdependent
|
||||
dependencies using Clojure's tools.deps and babashka.
|
||||
- LA Clojure Meetup [presentation](https://youtu.be/RogyxI-GaGQ) by Nate Jones. Recorded in April 2020.
|
||||
- [Github action](https://github.com/turtlequeue/setup-babashka) for babashka by Nicolas Ha.
|
||||
- Oracle DB [feature flag](https://github.com/babashka/babashka/blob/master/doc/build.md#feature-flags) by Jakub Holy added.
|
||||
- Torrent viewer [gist](https://gist.github.com/zelark/49ffbc0cd701c9299e35421ac2e3d5ab) by Aleksandr Zhuravlёv.
|
||||
- Clone all repositories from a Gitlab group:
|
||||
[gist](https://gist.github.com/MrGung/81bee21eb52cb9307f336705d5ab08ad) by
|
||||
Steffen Glückselig.
|
||||
- [Matchete](https://github.com/xapix-io/matchete), a pattern matching library,
|
||||
works with babashka. See
|
||||
[example](https://github.com/babashka/babashka/issues/631).
|
||||
|
||||
## 2020-10
|
||||
|
||||
- Babashka 0.2.3 released. See [release
|
||||
notes](https://github.com/babashka/babashka/blob/master/CHANGELOG.md#v023-2020-10-21).
|
||||
- [Malcolm Sparks](https://twitter.com/malcolmsparks/status/1320274099952848896) posted a
|
||||
[script](https://gist.github.com/malcolmsparks/61418b6bbcd0962536add1ccb07033b5) that
|
||||
sorts his photo collection.
|
||||
- [Image viewer](https://github.com/babashka/babashka/tree/master/examples#image-viewer) example
|
||||
- SQL Server [pod](https://github.com/xledger/pod_sql_server) by Isak Sky
|
||||
- [SSH Auth Github](https://github.com/nextjournal/ssh-auth-github) by
|
||||
NextJournal.
|
||||
- [pod-tzzh-mail](https://github.com/tzzh/pod-tzzh-mail): a pod to send mail.
|
||||
- NextJournal [replaces bash with a babashka script](https://twitter.com/kommen/status/1311574776834666496)
|
||||
|
||||
## 2020-09
|
||||
|
||||
- Babashka
|
||||
[0.2.1](https://github.com/babashka/babashka/blob/master/CHANGELOG.md#v021-2020-09-25)
|
||||
and 0.2.2 released.
|
||||
- Code Quality report for Clojure projects in Gitlab using babashka and clj-kondo. See [gist](https://gist.github.com/hansbugge/4be701d771057e8ef6bbbb0912656355). By Hans Bugge.
|
||||
- [pod-tzzh-aws](https://github.com/tzzh/pod-tzzh-aws): a pod to interact with AWS.
|
||||
- [spotifyd-notification](https://github.com/dharrigan/spotifyd-notification) by
|
||||
David Harrigan.
|
||||
|
||||
## 2020-08
|
||||
|
||||
- Babashka [0.2.0](https://github.com/babashka/babashka/blob/master/CHANGELOG.md#v020-2020-08-28) released.
|
||||
- Maarten Metz
|
||||
[blogs](https://www.mxmmz.nl/blog/building-a-website-with-babashka.html) about
|
||||
how he rebuilt his blog using babashka.
|
||||
|
||||
## 2020-07
|
||||
|
||||
- Blake Miller published [https://gitlab.com/blak3mill3r/emacs-ludicrous-speed](emacs-ludicrous-speed).
|
||||
- [babashka-clojure](https://github.com/marketplace/actions/babashka-clojure) Github action.
|
||||
- [testdoc](https://github.com/liquidz/testdoc) works with babashka.
|
||||
- [babashka-test-action](https://github.com/liquidz/babashka-test-action)
|
||||
- New release of [tabl](https://github.com/justone/tabl)
|
||||
which also can be used as a pod from babashka.
|
||||
|
||||
## 2020-06
|
||||
|
||||
- Babashka [0.1.3](https://github.com/babashka/babashka/blob/master/CHANGELOG.md#v013-2020-06-27) and 0.1.2 released.
|
||||
- New release of [brisk](https://github.com/justone/brisk), a CLI around nippy which can be used as a pod from babashka.
|
||||
- [passphrase.clj](https://gist.github.com/snorremd/43c49649d2d844ee1e646fee67c141bb) script by Snorre Magnus Davøen
|
||||
87
doc/nix.md
Normal file
87
doc/nix.md
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
# Using Babashka with Nix
|
||||
|
||||
Babashka is [packaged](https://search.nixos.org/packages?type=packages&query=babashka) in nixpkgs and can be easily used from the Nix package manager.
|
||||
|
||||
The following assumes a recent installation of nix and uses the unstable [nix cli](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix.html) and [Flakes](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html).
|
||||
|
||||
To enable the unstable cli and flakes add the following to `/etc/nix/nix.conf`:
|
||||
|
||||
```
|
||||
extra-experimental-features flakes nix-command
|
||||
```
|
||||
|
||||
## Imperative install on Nix
|
||||
|
||||
To imperatively install nix for the current user, run `nix profile install babashka`.
|
||||
|
||||
## Declarative global install on NixOS
|
||||
|
||||
To install babashka for all users on a NixOS system, place it in `environment.systemPackages` in your `configuration.nix`:
|
||||
|
||||
```nix
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
babashka
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
Then run `nixos-rebuild switch`, to activate the new configuration.
|
||||
|
||||
## Declarative per-user install with home-manager
|
||||
|
||||
You can install babashka for a specific user using [home-manager](https://github.com/nix-community/home-manager). Add the following to your `~/.config/nixpkgs/home.nix`:
|
||||
|
||||
```nix
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
babashka
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
Then run `home-manager switch`, to activate the new configuration.
|
||||
|
||||
## Per project install with direnv
|
||||
|
||||
To make babashka available on a per-project basis, you can use [direnv](https://direnv.net/).
|
||||
|
||||
Create a file `.envrc` in the project directory with the following contents:
|
||||
|
||||
```
|
||||
use flake
|
||||
```
|
||||
|
||||
Create a file `flake.nix` in the project directory with the following contents:
|
||||
|
||||
```nix
|
||||
{
|
||||
outputs = {nixpkgs, ...}: let
|
||||
supportedSystems = ["x86_64-linux" "x86_64-darwin"];
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
nixpkgsFor = system: import nixpkgs {inherit system;};
|
||||
in {
|
||||
devShell = forAllSystems (system: let
|
||||
pkgs = nixpkgsFor system;
|
||||
in
|
||||
pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
babashka
|
||||
];
|
||||
});
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
After running `direnv allow`, babashka should be available on the `$PATH`, when you are inside the project directory.
|
||||
|
||||
## Write Babashka Application
|
||||
|
||||
You can write babashka scripts with native dependencies using [WriteBabashkaApplication](https://github.com/sohalt/write-babashka-application).
|
||||
|
||||
The WriteBabashkaApplication repository has an [example](https://github.com/Sohalt/write-babashka-application/tree/main/example) `flake.nix` using `cowsay` as an external dependency.
|
||||
|
||||
|
||||
You can download that example, and then build the application using `nix build` or run it using `nix run`.
|
||||
972
doc/projects.md
Normal file
972
doc/projects.md
Normal file
|
|
@ -0,0 +1,972 @@
|
|||
# Projects
|
||||
|
||||
The following libraries and projects are known to work with babashka.
|
||||
|
||||
- [Projects](#projects)
|
||||
- [Libraries](#libraries)
|
||||
- [tools.namespace](#toolsnamespace)
|
||||
- [test-runner](#test-runner)
|
||||
- [spec.alpha](#specalpha)
|
||||
- [clj-http-lite](#clj-http-lite)
|
||||
- [spartan.spec](#spartanspec)
|
||||
- [missing.test.assertions](#missingtestassertions)
|
||||
- [medley](#medley)
|
||||
- [limit-break](#limit-break)
|
||||
- [clojure-csv](#clojure-csv)
|
||||
- [regal](#regal)
|
||||
- [cprop](#cprop)
|
||||
- [comb](#comb)
|
||||
- [nubank/docopt](#nubankdocopt)
|
||||
- [arrangement](#arrangement)
|
||||
- [clojure.math.combinatorics](#clojuremathcombinatorics)
|
||||
- [testdoc](#testdoc)
|
||||
- [doric](#doric)
|
||||
- [clojure.data.zip](#clojuredatazip)
|
||||
- [clj-psql](#clj-psql)
|
||||
- [camel-snake-kebab](#camel-snake-kebab)
|
||||
- [aero](#aero)
|
||||
- [clojure.data.generators](#clojuredatagenerators)
|
||||
- [honeysql](#honeysql)
|
||||
- [bond](#bond)
|
||||
- [portal](#portal)
|
||||
- [version-clj](#version-clj)
|
||||
- [matchete](#matchete)
|
||||
- [progrock](#progrock)
|
||||
- [clj-commons/fs](#clj-commonsfs)
|
||||
- [cljc.java-time](#cljcjava-time)
|
||||
- [environ](#environ)
|
||||
- [gaka](#gaka)
|
||||
- [failjure](#failjure)
|
||||
- [pretty](#pretty)
|
||||
- [clojure-term-colors](#clojure-term-colors)
|
||||
- [binf](#binf)
|
||||
- [rewrite-edn](#rewrite-edn)
|
||||
- [expound](#expound)
|
||||
- [omniconf](#omniconf)
|
||||
- [slingshot](#slingshot)
|
||||
- [hasch](#hasch)
|
||||
- [crispin](#crispin)
|
||||
- [ffclj](#ffclj)
|
||||
- [multigrep](#multigrep)
|
||||
- [java-http-clj](#java-http-clj)
|
||||
- [component](#component)
|
||||
- [minimallist](#minimallist)
|
||||
- [ruuter](#ruuter)
|
||||
- [clj-commons.digest](#clj-commonsdigest)
|
||||
- [contajners](#contajners)
|
||||
- [dependency](#dependency)
|
||||
- [specmonstah](#specmonstah)
|
||||
- [markdown-clj](#markdown-clj)
|
||||
- [algo.monads](#algomonads)
|
||||
- [datalog-parser](#datalog-parser)
|
||||
- [at-at](#at-at)
|
||||
- [aysylu/loom](#aysyluloom)
|
||||
- [Clarktown](#clarktown)
|
||||
- [Malli](#malli)
|
||||
- [Meander](#meander)
|
||||
- [Schema](#schema)
|
||||
- [Sluj](#sluj)
|
||||
- [malli-cli](#malli-cli)
|
||||
- [Pods](#pods)
|
||||
- [Projects](#projects-1)
|
||||
- [babashka-test-action](#babashka-test-action)
|
||||
- [deps.clj](#depsclj)
|
||||
- [4bb](#4bb)
|
||||
- [babashka lambda layer](#babashka-lambda-layer)
|
||||
- [Release on push Github action](#release-on-push-github-action)
|
||||
- [justone/bb-scripts](#justonebb-scripts)
|
||||
- [nativity](#nativity)
|
||||
- [cldwalker/bb-clis](#cldwalkerbb-clis)
|
||||
- [krell template](#krell-template)
|
||||
- [wee-httpd](#wee-httpd)
|
||||
- [covid19-babashka](#covid19-babashka)
|
||||
- [bb-spotify](#bb-spotify)
|
||||
- [lambdaisland/open-source](#lambdaislandopen-source)
|
||||
- [dharrigan/spotifyd-notification](#dharriganspotifyd-notification)
|
||||
- [nextjournal/ssh-github-auth](#nextjournalssh-github-auth)
|
||||
- [turtlequeue/setup-babashka](#turtlequeuesetup-babashka)
|
||||
- [interdep](#interdep)
|
||||
- [sha-words](#sha-words)
|
||||
- [adam-james-v/scripts](#adam-james-vscripts)
|
||||
- [oidc-client](#oidc-client)
|
||||
- [jirazzz](#jirazzz)
|
||||
- [Babashka + scittle guestbook](#babashka--scittle-guestbook)
|
||||
- [bb htmx todo app](#bb-htmx-todo-app)
|
||||
- [bb aws lambda runtime](#bb-aws-lambda-runtime)
|
||||
- [bb-github-app](#bb-github-app)
|
||||
|
||||
Also keep an eye on the [news](news.md) page for new projects, gists and other
|
||||
developments around babashka.
|
||||
|
||||
## Libraries
|
||||
|
||||
For a full list of libraries, see [libraries.csv](./libraries.csv). To add a
|
||||
library, see [these instructions](./dev.md#tests-for-libraries).
|
||||
|
||||
### [tools.namespace](https://github.com/babashka/tools.namespace)
|
||||
|
||||
A fork of `tools.namespace`. This is used by other libraries and enables them to
|
||||
be supported by babashka.
|
||||
|
||||
### [test-runner](https://github.com/cognitect-labs/test-runner)
|
||||
|
||||
This library works with the
|
||||
[tools.namespace](https://github.com/babashka/tools.namespace) fork. See its
|
||||
readme for an example task for running tests.
|
||||
|
||||
### [spec.alpha](https://github.com/babashka/spec.alpha)
|
||||
|
||||
A fork of `clojure.spec.alpha` that includes support for generation and
|
||||
instrumentation! Its readme also contains instructions on how to use
|
||||
`clojure.core.specs.alpha`.
|
||||
|
||||
<!-- ### [tools.bbuild](https://github.com/babashka/tools.bbuild) -->
|
||||
|
||||
<!-- A fork of `tools.build`. -->
|
||||
|
||||
### [clj-http-lite](https://github.com/clj-commons/clj-http-lite)
|
||||
|
||||
Example:
|
||||
|
||||
``` shell
|
||||
$ export BABASHKA_CLASSPATH="$(clojure -Sdeps '{:deps {org.clj-commons/clj-http-lite {:mvn/version "0.4.392"}}}' -Spath)"
|
||||
|
||||
$ bb "(require '[clj-http.lite.client :as client]) (:status (client/get \"https://www.clojure.org\"))"
|
||||
200
|
||||
```
|
||||
|
||||
### [spartan.spec](https://github.com/borkdude/spartan.spec/)
|
||||
|
||||
An babashka-compatible implementation of `clojure.spec.alpha`. See
|
||||
[spec.alpha](#specalpha) for a more complete implementation.
|
||||
|
||||
### [missing.test.assertions](https://github.com/borkdude/missing.test.assertions)
|
||||
|
||||
This library checks if no assertions have been made in a test:
|
||||
|
||||
``` shell
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {borkdude/missing.test.assertions {:git/url "https://github.com/borkdude/missing.test.assertions" :sha "603cb01bee72fb17addacc53c34c85612684ad70"}}}')
|
||||
|
||||
$ lein bb "(require '[missing.test.assertions] '[clojure.test :as t]) (t/deftest foo) (t/run-tests)"
|
||||
|
||||
Testing user
|
||||
WARNING: no assertions made in test foo
|
||||
|
||||
Ran 1 tests containing 0 assertions.
|
||||
0 failures, 0 errors.
|
||||
{:test 1, :pass 0, :fail 0, :error 0, :type :summary}
|
||||
```
|
||||
|
||||
### [medley](https://github.com/weavejester/medley/)
|
||||
|
||||
Example:
|
||||
|
||||
``` shell
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {medley/medley {:mvn/version "1.3.0"}}}')
|
||||
|
||||
$ bb -e "(require '[medley.core :as m]) (m/index-by :id [{:id 1} {:id 2}])"
|
||||
{1 {:id 1}, 2 {:id 2}}
|
||||
```
|
||||
|
||||
### [limit-break](https://github.com/technomancy/limit-break)
|
||||
|
||||
A debug REPL library.
|
||||
|
||||
Latest coordinates checked with with bb:
|
||||
|
||||
``` clojure
|
||||
{:git/url "https://github.com/technomancy/limit-break" :sha "050fcfa0ea29fe3340927533a6fa6fffe23bfc2f" :deps/manifest :deps}
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
``` shell
|
||||
$ export BABASHKA_CLASSPATH="$(clojure -Sdeps '{:deps {limit-break {:git/url "https://github.com/technomancy/limit-break" :sha "050fcfa0ea29fe3340927533a6fa6fffe23bfc2f" :deps/manifest :deps}}}' -Spath)"
|
||||
|
||||
$ bb "(require '[limit.break :as lb]) (let [x 1] (lb/break))"
|
||||
Babashka v0.0.49 REPL.
|
||||
Use :repl/quit or :repl/exit to quit the REPL.
|
||||
Clojure rocks, Bash reaches.
|
||||
|
||||
break> x
|
||||
1
|
||||
```
|
||||
|
||||
### [clojure-csv](https://github.com/davidsantiago/clojure-csv)
|
||||
|
||||
A library for reading and writing CSV files. Note that babashka already comes
|
||||
with `clojure.data.csv`, but in case you need this other library, this is how
|
||||
you can use it:
|
||||
|
||||
``` shell
|
||||
export BABASHKA_CLASSPATH="$(clojure -Sdeps '{:deps {clojure-csv {:mvn/version "RELEASE"}}}' -Spath)"
|
||||
|
||||
./bb -e "
|
||||
(require '[clojure-csv.core :as csv])
|
||||
(csv/write-csv (csv/parse-csv \"a,b,c\n1,2,3\"))
|
||||
"
|
||||
```
|
||||
|
||||
### [regal](https://github.com/lambdaisland/regal)
|
||||
|
||||
Example:
|
||||
|
||||
``` shell
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {lambdaisland/regal {:mvn/version "0.0.143"}}}')
|
||||
|
||||
$ bb -e "(require '[lambdaisland.regal :as regal]) (regal/regex [:* \"ab\"])"
|
||||
#"(?:\Qab\E)*"
|
||||
```
|
||||
|
||||
### [cprop](https://github.com/tolitius/cprop/)
|
||||
|
||||
A clojure configuration library. Latest test version: `"0.1.16"`.
|
||||
|
||||
### [comb](https://github.com/weavejester/comb)
|
||||
|
||||
Simple templating system for Clojure. Latest tested version: `"0.1.1"`.
|
||||
|
||||
``` clojure
|
||||
(require '[babashka.deps :as deps])
|
||||
|
||||
(deps/add-deps '{:deps {comb/comb {:mvn/version "0.1.1"}}})
|
||||
|
||||
(require '[comb.template :as template])
|
||||
|
||||
(template/eval "<% (dotimes [x 3] %>foo<% ) %>") ;;=> "foofoofoo"
|
||||
```
|
||||
|
||||
### [nubank/docopt](https://github.com/nubank/docopt.clj#babashka)
|
||||
|
||||
Docopt implementation in Clojure, compatible with babashka.
|
||||
|
||||
### [arrangement](https://github.com/greglook/clj-arrangement)
|
||||
|
||||
A micro-library which provides a total-ordering comparator for Clojure
|
||||
values. Tested with version `1.2.0`.
|
||||
|
||||
### [clojure.math.combinatorics](https://github.com/clojure/math.combinatorics)
|
||||
|
||||
``` clojure
|
||||
$ bb --classpath "$(clojure -Spath -Sdeps '{:deps {org.clojure/math.combinatorics {:mvn/version "0.1.6"}}}')" \
|
||||
-e "(use 'clojure.math.combinatorics) (permutations [:a :b])"
|
||||
((:a :b) (:b :a))
|
||||
```
|
||||
|
||||
### [testdoc](https://github.com/liquidz/testdoc)
|
||||
|
||||
Yet another doctest implementation in Clojure.
|
||||
|
||||
``` clojure
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Sdeps '{:deps {testdoc {:mvn/version "1.2.0"}}}' -Spath)
|
||||
|
||||
$ bb '(ns foo (:use clojure.test testdoc.core))
|
||||
(defn foo "
|
||||
=> (foo)
|
||||
:foox"
|
||||
[] :foo)
|
||||
|
||||
(deftest footest
|
||||
(is (testdoc (var foo))))
|
||||
|
||||
(test-var (var footest))'
|
||||
|
||||
FAIL in (footest) (:1)
|
||||
(= (foo) :foox)
|
||||
expected: :foox
|
||||
actual: :foo
|
||||
```
|
||||
|
||||
### [doric](https://github.com/joegallo/doric)
|
||||
|
||||
Library for printing tables.
|
||||
|
||||
``` clojure
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {doric {:mvn/version "0.9.0"}}}')
|
||||
$ bb "(use 'doric.core) (println (table [:a :b :c] [{:a 1 :b 2 :c 3} {:a 4 :b 5 :c 6}]))"
|
||||
|---+---+---|
|
||||
| A | B | C |
|
||||
|---+---+---|
|
||||
| 1 | 2 | 3 |
|
||||
| 4 | 5 | 6 |
|
||||
|---+---+---|
|
||||
```
|
||||
|
||||
### [clojure.data.zip](https://github.com/clojure/data.zip)
|
||||
|
||||
Utilities for clojure.zip, among other things a more fluent way to work
|
||||
with xml.
|
||||
|
||||
Small sample:
|
||||
``` clojure
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {org.clojure/data.zip {:mvn/version "1.0.0"}}}')
|
||||
|
||||
$ cat data_zip_xml.clj
|
||||
(require '[clojure.data.xml :as xml])
|
||||
(require '[clojure.zip :as zip])
|
||||
(require '[clojure.data.zip.xml :refer [text attr attr= xml-> xml1-> text=]])
|
||||
|
||||
(def data (str "<root>"
|
||||
" <character type=\"person\" name=\"alice\" />"
|
||||
" <character type=\"animal\" name=\"march hare\" />"
|
||||
"</root>"))
|
||||
|
||||
(let [xml (-> data java.io.StringReader. xml/parse zip/xml-zip)]
|
||||
(prn :alice-is-a (xml1-> xml :character [(attr= :name "alice")] (attr :type)))
|
||||
(prn :animal-is-called (xml1-> xml :character [(attr= :type "animal")] (attr :name))))
|
||||
|
||||
$ bb data_zip_xml.clj
|
||||
:alice-is-a "person"
|
||||
:animal-is-called "march hare"
|
||||
```
|
||||
(see for exaple [this article](https://blog.korny.info/2014/03/08/xml-for-fun-and-profit.html#datazip-for-zipper-awesomeness)
|
||||
for more on clojure.data.zip).
|
||||
|
||||
### [clj-psql](https://github.com/DarinDouglass/clj-psql)
|
||||
|
||||
A small Clojure wrapper for interacting with `psql`.
|
||||
|
||||
```clojure
|
||||
user> (psql/query conn "select name, subject from grades where grade = 100")
|
||||
=> ({:name "Bobby Tables", :subject "Math"}
|
||||
{:name "Suzy Butterbean", :subject "Math"})
|
||||
```
|
||||
|
||||
### [camel-snake-kebab](https://github.com/clj-commons/camel-snake-kebab)
|
||||
|
||||
A library for word case conversions.
|
||||
|
||||
``` clojure
|
||||
(require '[babashka.deps :as deps])
|
||||
|
||||
(deps/add-deps '{:deps {camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.2"}}})
|
||||
|
||||
(require '[camel-snake-kebab.core :as csk])
|
||||
|
||||
(csk/->camelCase 'flux-capacitor) ;;=> 'fluxCapacitor
|
||||
```
|
||||
|
||||
### [aero](https://github.com/juxt/aero/)
|
||||
|
||||
A small library for explicit, intentful configuration.
|
||||
|
||||
### [clojure.data.generators](https://github.com/clojure/data.generators)
|
||||
|
||||
Random data generators
|
||||
|
||||
### [honeysql](https://github.com/seancorfield/honeysql)
|
||||
|
||||
Turn Clojure data structures into SQL
|
||||
|
||||
### [bond](https://github.com/circleci/bond)
|
||||
|
||||
Spying and stubbing library, primarily intended for tests.
|
||||
|
||||
### [portal](https://github.com/djblue/portal/)
|
||||
|
||||
A clojure tool to navigate through your data. This example will launch a browser to view your `deps.edn`:
|
||||
|
||||
``` clojure
|
||||
$ cat deps.edn | bb -e "(babashka.deps/add-deps '{:deps {djblue/portal {:mvn/version \"0.9.0\"}}})" \
|
||||
-e "(require 'portal.main)" \
|
||||
-e '(portal.main/-main "edn")'
|
||||
```
|
||||
|
||||
Also see [examples](https://github.com/babashka/babashka/tree/master/examples#portal).
|
||||
|
||||
### [version-clj](https://github.com/xsc/version-clj)
|
||||
|
||||
Analysis and comparison of artifact version numbers.
|
||||
|
||||
``` clojure
|
||||
> export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {version-clj/version-clj {:mvn/version "0.1.2"}}}')
|
||||
> bb --repl
|
||||
...
|
||||
user=> (require '[version-clj.core :as ver])
|
||||
nil
|
||||
user=> (ver/version->seq "1.0.0-SNAPSHOT")
|
||||
[(1 0 0) ["snapshot"]]
|
||||
user=> (ver/version-compare "1.2.3" "1.0.0")
|
||||
1
|
||||
user=> (ver/version-compare "1.0.0-SNAPSHOT" "1.0.0")
|
||||
-1
|
||||
user=> (ver/version-compare "1.0" "1.0.0")
|
||||
0
|
||||
```
|
||||
|
||||
### [matchete](https://github.com/xapix-io/matchete.git)
|
||||
|
||||
Pattern matching library:
|
||||
|
||||
``` clojure
|
||||
$ rlwrap bb -cp "$(clojure -Spath -Sdeps '{:deps {io.xapix/matchete {:mvn/version "1.2.0"}}}')"
|
||||
user=> (require '[matchete.core :as mc])
|
||||
nil
|
||||
user=> (mc/matches '{?k 1} {:x 1 :y 1})"
|
||||
({?k :y} {?k :x})
|
||||
```
|
||||
|
||||
### [progrock](https://github.com/weavejester/progrock)
|
||||
|
||||
A functional Clojure progress bar for the command line.
|
||||
|
||||
Tested version: 0.1.2.
|
||||
|
||||
### [clj-commons/fs](https://github.com/clj-commons/fs)
|
||||
|
||||
File system utilities for Clojure.
|
||||
|
||||
``` clojure
|
||||
(require '[babashka.deps :as deps])
|
||||
|
||||
(deps/add-deps '{:deps {clj-commons/fs {:mvn/version "1.5.2"}}})
|
||||
|
||||
(require '[me.raynes.fs :as fs])
|
||||
|
||||
(fs/link? "/tmp") ;; true
|
||||
```
|
||||
|
||||
### [cljc.java-time](https://github.com/henryw374/cljc.java-time)
|
||||
|
||||
``` clojure
|
||||
(require '[babashka.deps :as deps])
|
||||
|
||||
(deps/add-deps '{:deps {cljc.java-time/cljc.java-time {:mvn/version "0.1.12"}}})
|
||||
|
||||
(require '[cljc.java-time.local-date :as ld])
|
||||
|
||||
(def a-date (ld/parse "2019-01-01"))
|
||||
|
||||
(ld/plus-days a-date 99)
|
||||
```
|
||||
|
||||
### [environ](https://github.com/weavejester/environ)
|
||||
|
||||
Library for managing environment variables in Clojure.
|
||||
|
||||
``` clojure
|
||||
(require '[babashka.deps :as deps])
|
||||
|
||||
(babashka.deps/add-deps '{:deps {environ/environ {:mvn/version "1.2.0"}}})
|
||||
|
||||
(require '[environ.core :refer [env]])
|
||||
|
||||
(prn (:path env))
|
||||
```
|
||||
|
||||
### [gaka](https://github.com/cdaddr/gaka)
|
||||
|
||||
``` clojure
|
||||
(ns script
|
||||
(:require [babashka.deps :as deps]))
|
||||
|
||||
(deps/add-deps '{:deps {gaka/gaka {:mvn/version "0.3.0"}}})
|
||||
|
||||
(require '[gaka.core :as gaka])
|
||||
|
||||
(def rules [:div#foo
|
||||
:margin "0px"
|
||||
[:span.bar
|
||||
:color "black"
|
||||
:font-weight "bold"
|
||||
[:a:hover
|
||||
:text-decoration "none"]]])
|
||||
|
||||
(println (gaka/css rules))
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
``` css
|
||||
div#foo {
|
||||
margin: 0px;}
|
||||
|
||||
div#foo span.bar {
|
||||
color: black;
|
||||
font-weight: bold;}
|
||||
|
||||
div#foo span.bar a:hover {
|
||||
text-decoration: none;}
|
||||
```
|
||||
|
||||
### [failjure](https://github.com/adambard/failjure)
|
||||
|
||||
Working with failed computations in Clojure.
|
||||
|
||||
``` clojure
|
||||
(require '[babashka.deps :as deps])
|
||||
|
||||
(deps/add-deps '{:deps {failjure/failjure {:mvn/version "2.1.1"}}})
|
||||
|
||||
(require '[failjure.core :as f])
|
||||
|
||||
(f/fail "foo")
|
||||
```
|
||||
|
||||
### [pretty](https://github.com/AvisoNovate/pretty)
|
||||
|
||||
The `io.aviso.ansi` namespace provides ANSI font and background color support.
|
||||
|
||||
``` clojure
|
||||
(require '[babashka.deps :as deps])
|
||||
|
||||
(deps/add-deps
|
||||
'{:deps {io.aviso/pretty {:mvn/version "0.1.36"}}})
|
||||
|
||||
(require '[io.aviso.ansi :as ansi])
|
||||
|
||||
(println
|
||||
(str "The following text will be "
|
||||
ansi/bold-red-font "bold and red "
|
||||
ansi/reset-font "but this text will not."))
|
||||
```
|
||||
|
||||
### [clojure-term-colors](https://github.com/trhura/clojure-term-colors)
|
||||
|
||||
Clojure ASCII color formatting for terminal output.
|
||||
|
||||
``` clojure
|
||||
(require '[babashka.deps :as deps])
|
||||
|
||||
(deps/add-deps
|
||||
'{:deps {clojure-term-colors/clojure-term-colors {:mvn/version "0.1.0"}}})
|
||||
|
||||
(require '[clojure.term.colors :as c])
|
||||
|
||||
(println
|
||||
(c/yellow "Yellow")
|
||||
(c/red "Red")
|
||||
"No color")
|
||||
```
|
||||
|
||||
### [binf](https://github.com/helins/binf.cljc)
|
||||
|
||||
Handling binary formats in all shapes and forms.
|
||||
|
||||
### [rewrite-edn](https://github.com/borkdude/rewrite-edn)
|
||||
|
||||
Rewrite EDN with preservation of whitespace, based on rewrite-clj.
|
||||
|
||||
Example:
|
||||
|
||||
``` clojure
|
||||
#!/usr/bin/env bb
|
||||
|
||||
(require '[babashka.deps :as deps])
|
||||
(deps/add-deps '{:deps {borkdude/rewrite-edn {:mvn/version "0.0.2"}}})
|
||||
(require '[borkdude.rewrite-edn :as r])
|
||||
|
||||
(def edn-string (slurp "deps.edn"))
|
||||
(def nodes (r/parse-string edn-string))
|
||||
|
||||
(println (str (r/assoc-in nodes [:deps 'my-other-dep] {:mvn/version "0.1.2"})))
|
||||
```
|
||||
|
||||
### [expound](https://github.com/bhb/expound)
|
||||
|
||||
Formats `spartan.spec` error messages in a way that is optimized for humans to read.
|
||||
|
||||
Example:
|
||||
|
||||
``` clojure
|
||||
#!/usr/bin/env bb
|
||||
|
||||
(ns expound
|
||||
(:require [babashka.deps :as deps]))
|
||||
|
||||
(deps/add-deps
|
||||
'{:deps {borkdude/spartan.spec {:git/url "https://github.com/borkdude/spartan.spec"
|
||||
:sha "bf4ace4a857c29cbcbb934f6a4035cfabe173ff1"}
|
||||
expound/expound {:mvn/version "0.8.9"}}})
|
||||
|
||||
;; Loading spartan.spec will create a namespace clojure.spec.alpha for compatibility:
|
||||
(require 'spartan.spec)
|
||||
(alias 's 'clojure.spec.alpha)
|
||||
|
||||
;; Expound expects some vars to be there, like `fdef`. Spartan prints warnings that these are used, but doesn't implement them yet.
|
||||
(require '[expound.alpha :as expound])
|
||||
|
||||
(s/def ::a (s/cat :i int? :j string?))
|
||||
|
||||
(expound/expound ::a [1 2])
|
||||
```
|
||||
|
||||
### [omniconf](https://github.com/grammarly/omniconf)
|
||||
|
||||
script.clj:
|
||||
``` clojure
|
||||
#!/usr/bin/env bb
|
||||
|
||||
(ns script
|
||||
(:require [babashka.deps :as deps]))
|
||||
|
||||
(deps/add-deps
|
||||
'{:deps {com.grammarly/omniconf {:mvn/version "0.4.3"}}})
|
||||
|
||||
(require '[omniconf.core :as cfg])
|
||||
(cfg/define {:foo {}})
|
||||
(cfg/populate-from-env)
|
||||
(cfg/get :foo)
|
||||
```
|
||||
|
||||
``` text
|
||||
FOO=1 script.clj
|
||||
Populating Omniconf from env: 1 value(s)
|
||||
"1"
|
||||
```
|
||||
|
||||
### [slingshot](https://github.com/scgilardi/slingshot)
|
||||
|
||||
Enhanced try and throw for Clojure leveraging Clojure's capabilities.
|
||||
|
||||
``` clojure
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {slingshot/slingshot {:mvn/version "0.12.2"}}}')
|
||||
$ bb -e "(require '[slingshot.slingshot :as s]) (s/try+ (s/throw+ {:type ::foo}) (catch [:type ::foo] [] 1))"
|
||||
1
|
||||
```
|
||||
|
||||
NOTE: slingshot's tests pass with babashka except one: catching a record types
|
||||
by name. This is due to a difference in how records are implemented in
|
||||
babashka. This may be fixed later if this turns out to be really useful.
|
||||
|
||||
### [hasch](https://github.com/replikativ/hasch)
|
||||
|
||||
Cross-platform (JVM and JS atm.) edn data structure hashing for Clojure.
|
||||
|
||||
``` clojure
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {io.replikativ/hasch {:mvn/version "0.3.7"}}}')
|
||||
$ bb -e "(use 'hasch.core) (edn-hash (range 100))"
|
||||
(168 252 48 247 180 148 51 182 108 76 20 251 155 187 66 8 124 123 103 28 250 151 26 139 10 216 119 168 101 123 130 225 66 168 48 63 53 99 25 117 173 29 198 229 101 196 162 30 23 145 7 166 232 193 57 239 226 238 240 41 254 78 135 122)
|
||||
```
|
||||
|
||||
NOTE: hasch's tests pass with babashka except the test around hashing
|
||||
records. This is due to a difference in how records are implemented in
|
||||
babashka. This may be fixed later if this turns out to be really useful.
|
||||
|
||||
### [crispin](https://github.com/dunaj-project/crispin)
|
||||
|
||||
Populate a configuration map from multiple sources (environment variables,
|
||||
system variables, config files, etc.)
|
||||
|
||||
Example:
|
||||
|
||||
script.clj
|
||||
``` clojure
|
||||
#!/usr/bin/env bb
|
||||
|
||||
(ns script
|
||||
(:require [babashka.deps :as deps]))
|
||||
|
||||
(deps/add-deps
|
||||
'{:deps {crispin/crispin {:mvn/version "0.3.8"}}})
|
||||
|
||||
(require '[crispin.core :as crispin])
|
||||
(def app-cfg (crispin/cfg))
|
||||
(app-cfg :foo)
|
||||
```
|
||||
|
||||
``` text
|
||||
FOO=1 script.clj
|
||||
"1"
|
||||
```
|
||||
|
||||
### [ffclj](https://github.com/luissantos/ffclj)
|
||||
|
||||
A wrapper around executing `ffmpeg` and `ffprobe`. Supports progress reporting via core.async channels.
|
||||
|
||||
### [multigrep](https://github.com/clj-commons/multigrep)
|
||||
|
||||
Regex-based file grepping and/or text substitution.
|
||||
|
||||
Example:
|
||||
- find the words that are exactly four letters long in some strings:
|
||||
```clj
|
||||
(ns multigrep-demo
|
||||
(:require [babashka.deps :as deps]
|
||||
[clojure.pprint :refer [pprint]])
|
||||
(:import (java.io StringReader)))
|
||||
|
||||
(deps/add-deps '{:deps {clj-commons/multigrep {:mvn/version "0.5.0"}}})
|
||||
|
||||
(require '[multigrep.core :as grep])
|
||||
|
||||
; the StringReaders could be anything that clojure.java.io/reader will accept (files, URLs, etc.)
|
||||
(let [sentence1 (StringReader. "the quick brown fox jumps over the lazy dog")
|
||||
sentence2 (StringReader. "Lorem ipsum dolor sit amet")]
|
||||
(pprint (grep/grep #"\b[a-z]{4}\b" [sentence1 sentence2])))
|
||||
```
|
||||
|
||||
outputs:
|
||||
```
|
||||
({:file
|
||||
#object[java.io.StringReader...],
|
||||
:line "the quick brown fox jumps over the lazy dog",
|
||||
:line-number 1,
|
||||
:regex #"\b[a-z]{4}\b",
|
||||
:re-seq ("over" "lazy")}
|
||||
{:file
|
||||
#object[java.io.StringReader...],
|
||||
:line "Lorem ipsum dolor sit amet",
|
||||
:line-number 1,
|
||||
:regex #"\b[a-z]{4}\b",
|
||||
:re-seq ("amet")})
|
||||
```
|
||||
|
||||
### [java-http-clj](https://github.com/schmee/java-http-clj)
|
||||
|
||||
Http client based on `java.net.http`.
|
||||
|
||||
### [component](https://github.com/stuartsierra/component)
|
||||
|
||||
A tiny Clojure framework for managing the lifecycle and dependencies of software components which have runtime state.
|
||||
|
||||
### [minimallist](https://github.com/green-coder/minimallist)
|
||||
|
||||
A minimalist data-driven data model library, inspired by Clojure Spec and Malli.
|
||||
|
||||
Example partially borrowed from [minimallist's cljdoc](https://cljdoc.org/d/minimallist/minimallist/CURRENT/doc/usage-in-babashka)
|
||||
|
||||
```clj
|
||||
(require '[babashka.deps :refer [add-deps]])
|
||||
|
||||
|
||||
(add-deps '{:deps {minimallist/minimallist {:git/url "https://github.com/green-coder/minimallist"
|
||||
:sha "b373bb18b8868526243735c760bdc67a88dd1e9a"}}})
|
||||
|
||||
(require '[minimallist.core :as m])
|
||||
(require '[minimallist.helper :as h])
|
||||
|
||||
(def contact (h/map [:name (h/fn string?)]
|
||||
[:phone (h/fn string?)]))
|
||||
(m/valid? contact {:name "Lucy" :phone "5551212"}) ;=> true
|
||||
(m/valid? contact {:name "Lucy" :phone 5551212}) ;=> false
|
||||
|
||||
(m/describe contact {:name "Lucy" :phone "5551212"}) ;=> {:valid? true, :entries {...}}
|
||||
(m/describe contact {:name "Lucy" :phone 5551212}) ;=> {:valid? false, :entries {... :phone {:valid? false...}}}
|
||||
|
||||
;; Does not work for now.
|
||||
;(require '[clojure.test.check.generators :as tcg])
|
||||
;(require '[minimallist.generator :as mg])
|
||||
;(tcg/sample (mg/gen (h/fn int?)))
|
||||
```
|
||||
|
||||
### [ruuter](https://github.com/askonomm/ruuter)
|
||||
|
||||
A zero-dependency router where each route is a map. Works with the httpkit server built into babashka.
|
||||
|
||||
### [clj-commons.digest](https://github.com/clj-commons/digest)
|
||||
|
||||
A message digest library, providing functions for MD5, SHA-1, SHA-256, etc.
|
||||
|
||||
### [contajners](https://github.com/lispyclouds/contajners)
|
||||
|
||||
An idiomatic, data-driven, REPL friendly clojure client for OCI container engines.
|
||||
|
||||
Example:
|
||||
|
||||
``` clojure
|
||||
#!/usr/bin/env bb
|
||||
|
||||
(require '[babashka.deps :as deps])
|
||||
|
||||
(deps/add-deps '{:deps {org.clojars.lispyclouds/contajners {:mvn/version "0.0.6"}}})
|
||||
|
||||
(require '[contajners.core :as c])
|
||||
|
||||
(def images-docker (c/client {:engine :docker
|
||||
:category :images
|
||||
:version "v1.41"
|
||||
:conn {:uri "unix:///var/run/docker.sock"}}))
|
||||
|
||||
; Pull an image
|
||||
(c/invoke images-docker {:op :ImageCreate
|
||||
:params {:fromImage "busybox:musl"}})
|
||||
|
||||
; list all images
|
||||
(c/invoke images-docker {:op :ImageList})
|
||||
```
|
||||
|
||||
### [dependency](https://github.com/stuartsierra/dependency)
|
||||
|
||||
Represent dependency graphs as a directed acylic graph.
|
||||
|
||||
### [specmonstah](https://github.com/reifyhealth/specmonstah)
|
||||
|
||||
Write concise, maintainable test fixtures with clojure.spec.alpha.
|
||||
|
||||
### [markdown-clj](https://github.com/yogthos/markdown-clj)
|
||||
|
||||
Markdown parser that translates markdown to html.
|
||||
|
||||
### [algo.monads](https://github.com/clojure/algo.monads)
|
||||
|
||||
Macros for defining monads, and definition of the most common monads.
|
||||
|
||||
### [datalog-parser](https://github.com/lambdaforge/datalog-parser)
|
||||
|
||||
Datalog parser that is compliant with datomic, datascript and datahike.
|
||||
|
||||
### [at-at](https://github.com/overtone/at-at)
|
||||
|
||||
Ahead-of-time function scheduler. Compatible with babashka 0.7.7+.
|
||||
|
||||
### [aysylu/loom](https://github.com/aysylu/loom)
|
||||
|
||||
Graph library for Clojure. Compatible with babashka 0.7.8+.
|
||||
|
||||
### [Clarktown](https://github.com/askonomm/clarktown)
|
||||
|
||||
An extensible and modular zero-dependency, pure-Clojure Markdown parser.
|
||||
|
||||
### [Malli](https://github.com/metosin/malli#babashka)
|
||||
|
||||
Data-Driven Schemas for Clojure/Script
|
||||
|
||||
### [Meander](https://github.com/noprompt/meander)
|
||||
|
||||
Tools for transparent data transformation
|
||||
|
||||
### [Schema](https://github.com/plumatic/schema)
|
||||
|
||||
Clojure(Script) library for declarative data description and validation
|
||||
|
||||
### [Sluj](https://github.com/rawleyfowler/sluj)
|
||||
|
||||
Sluj is a very small library for converting strings of UTF-16 text to slugs. A slug is a piece of text that is URL safe.
|
||||
|
||||
### [malli-cli](https://github.com/piotr-yuxuan/malli-cli)
|
||||
|
||||
Configuration and CLI powertool with `metosin/malli`.
|
||||
|
||||
## Pods
|
||||
|
||||
[Babashka pods](https://github.com/babashka/babashka.pods) are programs that can
|
||||
be used as Clojure libraries by babashka. See
|
||||
[pod-registry](https://github.com/babashka/pod-registry) for an overview of available pods.
|
||||
|
||||
Pods not available in the pod registry:
|
||||
|
||||
- [pod-janet-peg](https://github.com/sogaiu/pod-janet-peg): a pod for
|
||||
calling [Janet](https://github.com/janet-lang/janet)'s PEG
|
||||
functionality.
|
||||
- [pod-jaydeesimon-jsoup](https://github.com/jaydeesimon/pod-jaydeesimon-jsoup):
|
||||
a pod for parsing HTML using CSS queries backed by Jsoup.
|
||||
- [pod.xledger.sql-server](https://github.com/xledger/pod_sql_server): pod for interacting with SQL Server.
|
||||
|
||||
## Projects
|
||||
|
||||
### [babashka-test-action](https://github.com/marketplace/actions/babashka-test-action)
|
||||
|
||||
Github Action to run clojure.test by Babashka.
|
||||
|
||||
### [deps.clj](https://github.com/borkdude/deps.clj)
|
||||
|
||||
A port of the [clojure](https://github.com/clojure/brew-install/) bash script to
|
||||
Clojure / babashka.
|
||||
|
||||
Also see [deps.clj documentation](../doc/deps.clj.md).
|
||||
|
||||
### [4bb](https://github.com/porkostomus/4bb)
|
||||
|
||||
4clojure as a babashka script!
|
||||
|
||||
### [babashka lambda layer](https://github.com/dainiusjocas/babashka-lambda-layer)
|
||||
|
||||
Babashka Lambda runtime packaged as a Lambda layer.
|
||||
|
||||
### [Release on push Github action](https://github.com/rymndhng/release-on-push-action)
|
||||
|
||||
Github Action to create a git tag + release when pushed to master. Written in
|
||||
babashka.
|
||||
|
||||
### [justone/bb-scripts](https://github.com/justone/bb-scripts)
|
||||
|
||||
A collection of scripts developed by [@justone](https://github.com/justone).
|
||||
|
||||
### [nativity](https://github.com/MnRA/nativity)
|
||||
|
||||
Turn babashka scripts into binaries using GraalVM `native-image`.
|
||||
|
||||
### [cldwalker/bb-clis](https://github.com/cldwalker/bb-clis)
|
||||
|
||||
A collection of scripts developed by [@cldwalker](https://github.com/cldwalker).
|
||||
|
||||
### [krell template](https://github.com/ampersanda/krell-template-runner)
|
||||
|
||||
Babashka script for creating React Native (Krell) project
|
||||
|
||||
### [wee-httpd](https://github.com/bherrmann7/bb-common/blob/master/wee_httpd.bb)
|
||||
|
||||
A wee multi-threaded web server
|
||||
|
||||
### [covid19-babashka](https://github.com/agrison/covid19-babashka)
|
||||
|
||||
A babashka script to obtain covid-19 related information.
|
||||
|
||||
### [bb-spotify](https://github.com/kolharsam/bb-spotify)
|
||||
|
||||
Control your spotify player using babashka.
|
||||
|
||||
### [lambdaisland/open-source](https://github.com/lambdaisland/open-source)
|
||||
|
||||
[Internal
|
||||
tooling](https://github.com/babashka/babashka/issues/457#issuecomment-636739415)
|
||||
used by Lambda Island projects. Noteworthy: a [babashka-compatible hiccup
|
||||
script](https://github.com/lambdaisland/open-source/blob/2cfde3dfb460e72f047bf94e6f5ec7f519c6d7a0/src/lioss/hiccup.clj).
|
||||
|
||||
There's also
|
||||
[subshell](https://github.com/lambdaisland/open-source/blob/master/src/lioss/subshell.clj)
|
||||
which is like sh/sh, but it inherits stdin/stdout/stderr, so that the user sees
|
||||
in real time what the subprocess is doing, and can possibly interact with
|
||||
it. More like how shelling out in a bash script works.
|
||||
|
||||
### [dharrigan/spotifyd-notification](https://github.com/dharrigan/spotifyd-notification)
|
||||
|
||||
An example of using babashka to show spotifyd notifications via dunst.
|
||||
|
||||
### [nextjournal/ssh-github-auth](https://github.com/nextjournal/ssh-github-auth)
|
||||
|
||||
A babashka script which uses github auth to fetch SSH public keys. It can be useful to ensure only a certain team of people can access machines with SSH.
|
||||
|
||||
### [turtlequeue/setup-babashka](https://github.com/turtlequeue/setup-babashka)
|
||||
|
||||
Github Action to install Babashka in your workflows. Useful to run bb scripts in your CI.
|
||||
|
||||
### [interdep](https://github.com/rejoice-cljc/interdep)
|
||||
|
||||
Manage interdependent dependencies using Clojure's tools.deps and babashka.
|
||||
|
||||
### [sha-words](https://github.com/ordnungswidrig/sha-words)
|
||||
|
||||
A clojure program to turn a sha hash into list of nouns in a predictable jar.
|
||||
|
||||
### [adam-james-v/scripts](https://github.com/adam-james-v/scripts)
|
||||
|
||||
A collection of useful scripts. Mainly written with Clojure/babashka
|
||||
|
||||
### [oidc-client](https://gist.github.com/holyjak/ad4e1e9b863f8ed57ef0cb6ac6b30494)
|
||||
|
||||
Tired of being forced to use the browser every time you need to refresh an OIDC token to authenticate with a backend service? Finally there is a CLI tool for that - the babashka and Docker powered oidc_client.clj.
|
||||
|
||||
Upon first invocation it opens up a browser for the OIDC provider login, thereafter it caches the refresh token and uses it as long as it remains valid.
|
||||
|
||||
### [jirazzz](https://github.com/rwstauner/jirazzz)
|
||||
|
||||
A babashka JIRA client by Randy Stauner
|
||||
|
||||
### [Babashka + scittle guestbook](https://github.com/kloimhardt/babashka-scittle-guestbook)
|
||||
|
||||
Luminus guestbook example for Babashka + Scittle.
|
||||
|
||||
### [bb htmx todo app](https://github.com/prestancedesign/babashka-htmx-todoapp)
|
||||
|
||||
Quick example of a todo list SPA using Babashka and htmx.
|
||||
|
||||
### [bb aws lambda runtime](https://github.com/tatut/bb-lambda)
|
||||
|
||||
AWS Lambda custom runtime for Babashka scripts.
|
||||
|
||||
### [bb-github-app](https://github.com/brandonstubbs/bb-github-app)
|
||||
|
||||
An example Babashka script that can authenticate as a Github Application,
|
||||
this example focuses on the checks api.
|
||||
130
doc/repl.md
130
doc/repl.md
|
|
@ -1,130 +0,0 @@
|
|||
# Running a REPL
|
||||
|
||||
Babashka supports running a REPL, a socket REPL and an nREPL server.
|
||||
|
||||
## REPL
|
||||
|
||||
To start the REPL, type:
|
||||
|
||||
``` shell
|
||||
$ bb --repl
|
||||
```
|
||||
|
||||
To get history with up and down arrows, use `rlwrap`:
|
||||
|
||||
``` shell
|
||||
$ rlwrap bb --repl
|
||||
```
|
||||
|
||||
## Socket REPL
|
||||
|
||||
To start the socket REPL you can do this:
|
||||
|
||||
``` shell
|
||||
$ bb --socket-repl 1666
|
||||
Babashka socket REPL started at localhost:1666
|
||||
```
|
||||
|
||||
Now you can connect with your favorite socket REPL client:
|
||||
|
||||
``` shell
|
||||
$ rlwrap nc 127.0.0.1 1666
|
||||
Babashka v0.0.14 REPL.
|
||||
Use :repl/quit or :repl/exit to quit the REPL.
|
||||
Clojure rocks, Bash reaches.
|
||||
|
||||
bb=> (+ 1 2 3)
|
||||
6
|
||||
bb=> :repl/quit
|
||||
$
|
||||
```
|
||||
|
||||
Editor plugins and tools known to work with a babashka socket REPL:
|
||||
|
||||
- Emacs: [inf-clojure](https://github.com/clojure-emacs/inf-clojure):
|
||||
|
||||
To connect:
|
||||
|
||||
`M-x inf-clojure-connect <RET> localhost <RET> 1666`
|
||||
|
||||
Before evaluating from a Clojure buffer:
|
||||
|
||||
`M-x inf-clojure-minor-mode`
|
||||
|
||||
- Atom: [Chlorine](https://github.com/mauricioszabo/atom-chlorine)
|
||||
- Vim: [vim-iced](https://github.com/liquidz/vim-iced)
|
||||
- IntelliJ IDEA: [Cursive](https://cursive-ide.com/)
|
||||
|
||||
Note: you will have to use a workaround via
|
||||
[tubular](https://github.com/mfikes/tubular). For more info, look
|
||||
[here](https://cursive-ide.com/userguide/repl.html#repl-types).
|
||||
|
||||
|
||||
## nREPL
|
||||
|
||||
To start an nREPL server:
|
||||
|
||||
``` shell
|
||||
$ bb --nrepl-server 1667
|
||||
```
|
||||
|
||||
Then connect with your favorite nREPL client:
|
||||
|
||||
``` clojure
|
||||
$ lein repl :connect 1667
|
||||
Connecting to nREPL at 127.0.0.1:1667
|
||||
user=> (+ 1 2 3)
|
||||
6
|
||||
user=>
|
||||
```
|
||||
|
||||
Editor plugins and tools known to work with the babashka nREPL server:
|
||||
|
||||
- Emacs: [CIDER](https://docs.cider.mx/cider/platforms/babashka.html)
|
||||
- `lein repl :connect`
|
||||
- VSCode: [Calva](http://calva.io/)
|
||||
- Atom: [Chlorine](https://github.com/mauricioszabo/atom-chlorine)
|
||||
- (Neo)Vim: [vim-iced](https://github.com/liquidz/vim-iced), [conjure](https://github.com/Olical/conjure), [fireplace](https://github.com/tpope/vim-fireplace)
|
||||
|
||||
The babashka nREPL server does not write an `.nrepl-port` file at startup, but
|
||||
you can easily write a script that launches the server and writes the file:
|
||||
|
||||
``` clojure
|
||||
#!/usr/bin/env bb
|
||||
|
||||
(import [java.net ServerSocket]
|
||||
[java.io File]
|
||||
[java.lang ProcessBuilder$Redirect])
|
||||
|
||||
(require '[babashka.wait :as wait])
|
||||
|
||||
(let [nrepl-port (with-open [sock (ServerSocket. 0)] (.getLocalPort sock))
|
||||
cp (str/join File/pathSeparatorChar ["src" "test"])
|
||||
pb (doto (ProcessBuilder. (into ["bb" "--nrepl-server" (str nrepl-port)
|
||||
"--classpath" cp]
|
||||
*command-line-args*))
|
||||
(.redirectOutput ProcessBuilder$Redirect/INHERIT))
|
||||
proc (.start pb)]
|
||||
(wait/wait-for-port "localhost" nrepl-port)
|
||||
(spit ".nrepl-port" nrepl-port)
|
||||
(.deleteOnExit (File. ".nrepl-port"))
|
||||
(.waitFor proc))
|
||||
```
|
||||
|
||||
### Debugging the nREPL server
|
||||
|
||||
To debug the nREPL server from the binary you can run:
|
||||
|
||||
``` shell
|
||||
$ BABASHKA_DEV=true bb --nrepl-server 1667
|
||||
```
|
||||
|
||||
This will print all the incoming messages.
|
||||
|
||||
To debug the nREPL server from source:
|
||||
|
||||
``` clojure
|
||||
$ git clone https://github.com/borkdude/babashka --recursive
|
||||
$ cd babashka
|
||||
$ BABASHKA_DEV=true clojure -A:main --nrepl-server 1667
|
||||
```
|
||||
267
doc/surveys/2020-11.md
Normal file
267
doc/surveys/2020-11.md
Normal file
|
|
@ -0,0 +1,267 @@
|
|||
## Survey November 2020
|
||||
|
||||
The raw data from the babashka survey held in November 2020 is now available
|
||||
[here](https://nl.surveymonkey.com/results/SM-8W8V36DZ7/).
|
||||
|
||||
We had about 100 respondents (just below the free tier of SurveyMonkey). Next
|
||||
time I'll probably switch to Google forms and add an optional contact field,
|
||||
since I would have liked to go deeper into some of the answers.
|
||||
|
||||
Here are the ten questions from the survey followed by the summarized outcome
|
||||
and my commentary.
|
||||
|
||||
Thank you all for taking the time. This provides useful input for the future
|
||||
development of babashka.
|
||||
|
||||
### Q1 What are you using babashka for? Work / hobby
|
||||
|
||||
*Outcome:* 75% work, 76% hobby
|
||||
|
||||
*My comment:* Most people use it both at work and for their hobby
|
||||
programming. This is more than I could have hoped for when I started babashka.
|
||||
|
||||
### Q2 What features or namespaces in babashka do you use most?
|
||||
|
||||
*Outcome:*
|
||||
|
||||
```
|
||||
- clojure.java.shell *******************************
|
||||
- cheshire.core (json) ****************************
|
||||
- babashka.curl ************************
|
||||
- clojure.java.io *********************
|
||||
- clojure.string ******************
|
||||
- babashka.process **************
|
||||
- clojure.edn *******
|
||||
- clojure.tools.cli *****
|
||||
- http (in general) ******
|
||||
- clojure.data.xml ****
|
||||
- clojure.data.csv ****
|
||||
- clj-yaml.core ****
|
||||
- dates / java.time ****
|
||||
- nREPL server ****
|
||||
- sql / jdbc ****
|
||||
- org.httpkit.client ***
|
||||
- i/o flags ***
|
||||
- clojure.pprint **
|
||||
- org.httpkit.server *
|
||||
- babashka.wait *
|
||||
- multi-file project *
|
||||
- docopt *
|
||||
- ProcessBuilder *
|
||||
- java.util *
|
||||
- transit *
|
||||
- core.async *
|
||||
- clojure.data *
|
||||
- aero *
|
||||
- clojure.zip *
|
||||
```
|
||||
|
||||
*My comment:* Shelling out is a popular thing to do in babashka:
|
||||
`clojure.java.shell` is the most widely used namespaces. The `babashka.process`
|
||||
namespace is already used quite a lot despite its recent appearance.
|
||||
|
||||
Other popular ways to use babashka:
|
||||
|
||||
- http (`babashka.curl` or other)
|
||||
- JSON (cheshire)
|
||||
- file interaction (`clojure.java.io`)
|
||||
- string manipulation (`clojure.string`)
|
||||
|
||||
Nothing surprising there for a scripting tool. Closely following is `tools.cli`,
|
||||
and several other data formats (edn, csv, xml, yaml). The transit format isn't
|
||||
that widely used from babashka.
|
||||
|
||||
Some people are using babashka for interacting with SQL databases. There are two
|
||||
ways to do this: compile babashka with extra [feature
|
||||
flags](https://github.com/babashka/babashka/blob/master/doc/build.md#feature-flags)
|
||||
enabled or use
|
||||
[babashka-sql-pods](https://github.com/babashka/babashka-sql-pods/).
|
||||
|
||||
According to the above outcome, babaska isn't that widely used for small web
|
||||
applications yet. The `core.async` library had only had one mention although
|
||||
nobody mentioned it as redundant in question 5.
|
||||
|
||||
### Q3 Which babashka pods are you using, if any?
|
||||
|
||||
*Outcome:*
|
||||
|
||||
```
|
||||
- sql (mostly postgres) ***************
|
||||
- file watcher ****
|
||||
- clj-kondo ***
|
||||
- kafka **
|
||||
- tabl **
|
||||
- tzzh-aws **
|
||||
- etaoin **
|
||||
- brisk *
|
||||
- lanterna *
|
||||
- tzzh-mail *
|
||||
- bootleg *
|
||||
- parcera *
|
||||
```
|
||||
|
||||
*My comment:*
|
||||
|
||||
The [sql](https://github.com/babashka/babashka-sql-pods) and
|
||||
[filewatcher](https://github.com/babashka/pod-babashka-filewatcher) pods are the
|
||||
most popular, closely followed by the
|
||||
[clj-kondo](https://github.com/borkdude/clj-kondo/#babashka-pod) pod.
|
||||
|
||||
The pod concept isn't widely understood yet. In 2021 I might give a talk, if the
|
||||
opportunity arises, on babashka pod usage and how to develop them. Pods are an
|
||||
extra thing to install which may be a barrier for adoption for some. This ties
|
||||
into the next question.
|
||||
|
||||
### Q4 What functionality is currently missing in babashka?
|
||||
|
||||
*Outcome:*
|
||||
|
||||
```
|
||||
- easy usage of libs and pods ***********
|
||||
- java.nio bindings / fs lib ****
|
||||
- clojure.spec (+ gen) ****
|
||||
- database / jdbc ***
|
||||
- raspberry pi support ***
|
||||
- hiccup **
|
||||
- compile script to native **
|
||||
- spire as pod *
|
||||
- docs and examples *
|
||||
- packaging *
|
||||
- ssh *
|
||||
- nrepl *
|
||||
- http server *
|
||||
- easier creation of pods *
|
||||
- sqlite *
|
||||
- java-time lib *
|
||||
- better REPL *
|
||||
```
|
||||
|
||||
*My comment:*
|
||||
|
||||
Clearly users want an easier way to include libraries and pods. We are thinking
|
||||
about that in [this](https://github.com/babashka/babashka/issues/473) issue.
|
||||
|
||||
The second most mentioned missing feature was a library around files. This is
|
||||
work in progress [here](https://github.com/babashka/fs).
|
||||
|
||||
### Q5 What features or namespaces in babashka are redundant and could be left out?
|
||||
|
||||
Most people did not suggest anything should be removed, maybe also related to
|
||||
the most given answer to Q9. A few people expressed confusion about multiple
|
||||
ways of making http requests.
|
||||
|
||||
*My comment:* If have attempted to write about HTTP request in babashka
|
||||
[here](https://book.babashka.org/#_choosing_the_right_client) and
|
||||
[here](https://github.com/babashka/babashka/wiki/HTTP-client-and-server-considerations).
|
||||
The summary is that both `babashka.curl` and `org.httpkit.client` have different
|
||||
optimal use cases. In most small scripting scenarios `babashka.curl` will
|
||||
do. For making many small requests `org.httpkit.client` is more optimal since it
|
||||
won't create an OS process. For downloading big files, `babashka.curl` is more
|
||||
optimal, since there is no way to prevent `org.httpkit.client` from holding the
|
||||
response into memory all at once.
|
||||
|
||||
In the future both of these clients may be superseded by a client based on
|
||||
`java.net.http` (probably exposed as `babashka.http-client`), but this client
|
||||
isn't there yet and it may take a while before the Java 11 client space has
|
||||
crystallized. Meanwhile you will have to do it with either of these
|
||||
clients. Luckily both clients accept and return Ring-like maps, so upgrading to
|
||||
the future client should not be hard, unless you are depending on something very
|
||||
specific. I plan on keeping `babashka.curl` in babashka no matter what, since
|
||||
it's a very thin layer over `curl` and doesn't complicate the compilation
|
||||
process of babashka much. There will be a transition period of having both
|
||||
`org.httpkit.client` and the `java.net.http` client after which
|
||||
`org.httpkit.client` will be phased out and `babashka.http-client` will be the
|
||||
recommended HTTP client in babashka.
|
||||
|
||||
### Q6 Babashka prints the last value of an expression or script. Should this change?
|
||||
|
||||
*Outcome:*
|
||||
|
||||
```
|
||||
- Yes: 7.8%
|
||||
- No: 69%
|
||||
- It depends: 23%
|
||||
```
|
||||
|
||||
*My comment:*
|
||||
|
||||
The most given answer is: no, keep it this way. Most of the "it depends" answers
|
||||
said: I don't really care. Some suggested that printing should always be
|
||||
explicit and maybe should be controlled using a flag.
|
||||
|
||||
The reason babashka always prints the list value of a script, unless it is
|
||||
`nil`, is that in the very beginning, babashka was intended as a Clojure-in-bash
|
||||
one-liner utility. We only had the `-e` option and not the `-f` option for
|
||||
executing scripts from disk. When the `-f` option got added, it was handled
|
||||
exactly the same as `-e`, with the difference that the expression was read from
|
||||
a file.
|
||||
|
||||
Since the majority of people expressed that this should not change, we will keep
|
||||
it this way. This will also avoid breakage for scripts that depend on
|
||||
this. Stylistically it might be better to use explicit printing in scripts. If a
|
||||
script returns `nil`, nothing will get printed for you, which aligns nicely with
|
||||
how `println` and `prn` behave.
|
||||
|
||||
### Q7 When would you use babashka instead of JVM Clojure?
|
||||
|
||||
*Outcome:*
|
||||
|
||||
The majority of people use babashka as a replacement for `bash`, `python` or
|
||||
`jq`. The fast startup is the main reason they favor it over the JVM when
|
||||
writing small and short-running scripts that are cross-platform. In this
|
||||
scenario babashka is used for CLI utilities, ETL (data processing) scripts,
|
||||
automation / CI / devops and scripts ran from editors like emacs and vim. Some
|
||||
people use it in places where they want to avoid or can't have a JVM
|
||||
installation or in memory constrained environments. Some people answered:
|
||||
whenever I can.
|
||||
|
||||
*My comment:*
|
||||
|
||||
Babashka's original goal was to be a Clojure replacement for shell scripting and
|
||||
based on the answers, it seems to have pulled that off.
|
||||
|
||||
### Q8 What operating system do you run babashka on?
|
||||
|
||||
*Outcome:*
|
||||
|
||||
```
|
||||
- Linux: 80%
|
||||
- macOS: 58%
|
||||
- Windows: 16%
|
||||
- Other: 2% (raspberry if possible, AWS Lambda)
|
||||
```
|
||||
|
||||
*My comment:*
|
||||
|
||||
It's interesting to compare the outcome of this question with the answers to
|
||||
"what is your primary development OS" in the Clojure 2020 survey
|
||||
[here](https://clojure.org/news/2020/02/20/state-of-clojure-2020#_deep_dives).
|
||||
|
||||
Note that I didn't ask about the development OS but where scripts are run and
|
||||
multiple answers were allowed.
|
||||
|
||||
### Q9 Is the binary size of the bb executable important to you?
|
||||
|
||||
*Outcome:*
|
||||
|
||||
```
|
||||
- Yes: 13%
|
||||
- No: 87%
|
||||
```
|
||||
|
||||
*My comment:*
|
||||
|
||||
The people who care about binary size report that it should not grow beyond the
|
||||
range of 10mb and 512mb. But most people don't care about it.
|
||||
|
||||
I do personally care about it from the perspective of not cluttering babashka
|
||||
unnecessarily during its lifetime. Related, adding more stuff challenges GraalVM
|
||||
compile time and memory usage during compilation. Hitting the limit on free CI
|
||||
might mean I will have to charge for building binaries in the future or come up
|
||||
with some business model to finance the builds.
|
||||
|
||||
### Q10 Any other feedback on babashka?
|
||||
|
||||
*Outcome:*
|
||||
|
||||
Lots of encouraging words. Thank you all!
|
||||
|
|
@ -1,5 +1,47 @@
|
|||
# Examples
|
||||
|
||||
- [Examples](#examples)
|
||||
- [Delete a list of files returned by a Unix command](#delete-a-list-of-files-returned-by-a-unix-command)
|
||||
- [Calculate aggregate size of directory](#calculate-aggregate-size-of-directory)
|
||||
- [Shuffle the lines of a file](#shuffle-the-lines-of-a-file)
|
||||
- [Fetch latest Github release tag](#fetch-latest-github-release-tag)
|
||||
- [Generate deps.edn entry for a gitlib](#generate-depsedn-entry-for-a-gitlib)
|
||||
- [View download statistics from Clojars](#view-download-statistics-from-clojars)
|
||||
- [Portable tree command](#portable-tree-command)
|
||||
- [List outdated maven dependencies](#list-outdated-maven-dependencies)
|
||||
- [Convert project.clj to deps.edn](#convert-projectclj-to-depsedn)
|
||||
- [Print current time in California](#print-current-time-in-california)
|
||||
- [Tiny http server](#tiny-http-server)
|
||||
- [Print random docstring](#print-random-docstring)
|
||||
- [Cryptographic hash](#cryptographic-hash)
|
||||
- [Package script as Docker image](#package-script-as-docker-image)
|
||||
- [Extract single file from zip](#extract-single-file-from-zip)
|
||||
- [Note taking app](#note-taking-app)
|
||||
- [which](#which)
|
||||
- [pom.xml version](#pomxml-version)
|
||||
- [Whatsapp frequencies](#whatsapp-frequencies)
|
||||
- [Find unused vars](#find-unused-vars)
|
||||
- [List contents of jar file](#list-contents-of-jar-file)
|
||||
- [Invoke vim inside a script](#invoke-vim-inside-a-script)
|
||||
- [Portal](#portal)
|
||||
- [Image viewer](#image-viewer)
|
||||
- [HTTP server](#http-server)
|
||||
- [Torrent viewer](#torrent-viewer)
|
||||
- [cprop.clj](#cpropclj)
|
||||
- [fzf](#fzf)
|
||||
- [digitalocean-ping.clj](#digitalocean-pingclj)
|
||||
- [download-aliases.clj](#download-aliasesclj)
|
||||
- [Is TTY?](#is-tty)
|
||||
- [normalize-keywords.clj](#normalize-keywordsclj)
|
||||
- [Check stdin for data](#check-stdin-for-data)
|
||||
- [Using org.clojure/data.xml](#using-orgclojuredataxml)
|
||||
- [Simple logger](#simple-logger)
|
||||
- [Using GZip streams (memo utility)](#using-gzip-streams-to-make-a-note-utility)
|
||||
- [Pretty-printing mySQL results](#pretty-printing-mysql-results)
|
||||
- [Single page application with Babashka + htmx](#single-page-application-with-babashka--htmx)
|
||||
- [Wikipedia translation](#wikipedia-translation)
|
||||
|
||||
|
||||
Here's a gallery of useful examples. Do you have a useful example? PR welcome!
|
||||
|
||||
## Delete a list of files returned by a Unix command
|
||||
|
|
@ -52,7 +94,7 @@ $ < /tmp/test.txt bb -io '(shuffle *input*)'
|
|||
'[cheshire.core :as json])
|
||||
|
||||
(defn babashka-latest-version []
|
||||
(-> (sh "curl" "https://api.github.com/repos/borkdude/babashka/tags")
|
||||
(-> (sh "curl" "https://api.github.com/repos/babashka/babashka/tags")
|
||||
:out
|
||||
(json/parse-string true)
|
||||
first
|
||||
|
|
@ -105,7 +147,7 @@ less
|
|||
|
||||
## Portable tree command
|
||||
|
||||
See [examples/tree.clj](https://github.com/borkdude/babashka/blob/master/examples/tree.clj).
|
||||
See [examples/tree.clj](https://github.com/babashka/babashka/blob/master/examples/tree.clj).
|
||||
|
||||
``` shellsession
|
||||
$ clojure -Sdeps '{:deps {org.clojure/tools.cli {:mvn/version "0.4.2"}}}' examples/tree.clj src
|
||||
|
|
@ -127,7 +169,7 @@ src
|
|||
|
||||
## List outdated maven dependencies
|
||||
|
||||
See [examples/outdated.clj](https://github.com/borkdude/babashka/blob/master/examples/outdated.clj).
|
||||
See [examples/outdated.clj](https://github.com/babashka/babashka/blob/master/examples/outdated.clj).
|
||||
Inspired by an idea from [@seancorfield](https://github.com/seancorfield).
|
||||
|
||||
``` shellsession
|
||||
|
|
@ -157,17 +199,19 @@ A script with the same goal can be found [here](https://gist.github.com/swlkr/3f
|
|||
|
||||
## Print current time in California
|
||||
|
||||
See [examples/pst.clj](https://github.com/borkdude/babashka/blob/master/examples/pst.clj)
|
||||
See [examples/pst.clj](https://github.com/babashka/babashka/blob/master/examples/pst.clj)
|
||||
|
||||
## Tiny http server
|
||||
|
||||
See [examples/http_server.clj](https://github.com/borkdude/babashka/blob/master/examples/http_server.clj)
|
||||
This implements an http server from scratch. Note that babashka comes with `org.httpkit.server` now, so you don't need to build an http server from scratch anymore.
|
||||
|
||||
See [examples/http_server_from_scratch.clj](https://github.com/babashka/babashka/blob/master/examples/http_server_from_scratch.clj)
|
||||
|
||||
Original by [@souenzzo](https://gist.github.com/souenzzo/a959a4c5b8c0c90df76fe33bb7dfe201)
|
||||
|
||||
## Print random docstring
|
||||
|
||||
See [examples/random_doc.clj](https://github.com/borkdude/babashka/blob/master/examples/random_doc.clj)
|
||||
See [examples/random_doc.clj](https://github.com/babashka/babashka/blob/master/examples/random_doc.clj)
|
||||
|
||||
``` shell
|
||||
$ examples/random_doc.clj
|
||||
|
|
@ -205,7 +249,7 @@ $ sha1.clj babashka
|
|||
|
||||
`Dockerfile`:
|
||||
``` dockerfile
|
||||
FROM borkdude/babashka
|
||||
FROM babashka/babashka
|
||||
RUN echo $'\
|
||||
(println "Your command line args:" *command-line-args*)\
|
||||
'\
|
||||
|
|
@ -244,15 +288,15 @@ Your command line args: (1 2 3)
|
|||
## Note taking app
|
||||
|
||||
See
|
||||
[examples/notes.clj](https://github.com/borkdude/babashka/blob/master/examples/notes.clj). This
|
||||
[examples/notes.clj](https://github.com/babashka/babashka/blob/master/examples/notes.clj). This
|
||||
is a variation on the
|
||||
[http-server](https://github.com/borkdude/babashka/#tiny-http-server)
|
||||
[http-server](https://github.com/babashka/babashka/#tiny-http-server)
|
||||
example. If you get prompted with a login, use `admin`/`admin`.
|
||||
|
||||
## which
|
||||
|
||||
The `which` command re-implemented in Clojure. See
|
||||
[examples/which.clj](https://github.com/borkdude/babashka/blob/master/examples/which.clj).
|
||||
[examples/which.clj](https://github.com/babashka/babashka/blob/master/examples/which.clj).
|
||||
Prints the canonical file name.
|
||||
|
||||
``` shell
|
||||
|
|
@ -265,6 +309,8 @@ $ examples/which.clj rg
|
|||
A script to retrieve the version from a `pom.xml` file. See
|
||||
[pom_version_get.clj](pom_version_get.clj). Written by [@wilkerlucio](https://github.com/wilkerlucio).
|
||||
|
||||
See [pom_version_get_xml_zip.clj](pom_version_get_xml_zip.clj) for how to do the same using zippers.
|
||||
|
||||
Also see [pom_version_set.clj](pom_version_set.clj) to set the pom version.
|
||||
|
||||
## Whatsapp frequencies
|
||||
|
|
@ -283,7 +329,7 @@ which finds unused vars. It uses
|
|||
$ bb examples/hsqldb_unused_vars.clj src
|
||||
|
||||
| :VARS/NS | :VARS/NAME | :VARS/FILENAME | :VARS/ROW | :VARS/COL |
|
||||
|----------------------------+--------------------------+------------------------------------+-----------+-----------|
|
||||
|----------------------------|--------------------------|------------------------------------|-----------|-----------|
|
||||
| babashka.impl.bencode.core | read-netstring | src/babashka/impl/bencode/core.clj | 162 | 1 |
|
||||
| babashka.impl.bencode.core | write-netstring | src/babashka/impl/bencode/core.clj | 201 | 1 |
|
||||
| babashka.impl.classes | generate-reflection-file | src/babashka/impl/classes.clj | 230 | 1 |
|
||||
|
|
@ -307,11 +353,11 @@ META-INF/leiningen/borkdude/sci/project.clj
|
|||
...
|
||||
```
|
||||
|
||||
### Invoke vim inside a script
|
||||
## Invoke vim inside a script
|
||||
|
||||
See [examples/vim.clj](examples/vim.clj).
|
||||
See [examples/vim.clj](vim.clj).
|
||||
|
||||
### Portal
|
||||
## Portal
|
||||
|
||||
This script uses [djblue/portal](https://github.com/djblue/portal/) for inspecting EDN, JSON, XML or YAML files.
|
||||
|
||||
|
|
@ -323,14 +369,202 @@ $ examples/portal.clj ~/git/clojure/pom.xml
|
|||
|
||||
See [portal.clj](portal.clj).
|
||||
|
||||
### Image viewer
|
||||
## Image viewer
|
||||
|
||||
Opens browser window and lets user navigate through images of all sub-directories.
|
||||
|
||||
Example usage:
|
||||
|
||||
``` shell
|
||||
$ examples/image_viewer.clj
|
||||
$ examples/image-viewer.clj
|
||||
```
|
||||
|
||||
See [image_viewer.clj](image_viewer.clj).
|
||||
See [image-viewer.clj](image-viewer.clj).
|
||||
|
||||
## HTTP Server
|
||||
|
||||
Opens browser window and lets user navigate through filesystem, similar to
|
||||
`python3 -m http.server`.
|
||||
|
||||
Example usage:
|
||||
|
||||
``` shell
|
||||
$ examples/http-server.clj
|
||||
```
|
||||
|
||||
See [http-server.clj](http-server.clj).
|
||||
|
||||
## Torrent viewer
|
||||
|
||||
Shows the content of a torrent file. Note that pieces' content is hidden.
|
||||
|
||||
Example usage:
|
||||
``` shell
|
||||
$ examples/torrent-viewer.clj file.torrent
|
||||
```
|
||||
|
||||
See [torrent-viewer.clj](torrent-viewer.clj).
|
||||
|
||||
## [cprop.clj](cprop.clj)
|
||||
|
||||
This script uses [tolitius/cprop](https://github.com/tolitius/cprop) library.
|
||||
|
||||
See [cprop.clj](cprop.clj)
|
||||
|
||||
Example usage:
|
||||
|
||||
```shell
|
||||
$ ( cd examples && bb cprop.clj )
|
||||
```
|
||||
|
||||
## [fzf](fzf.clj)
|
||||
|
||||
Invoke [fzf](https://github.com/junegunn/fzf), a command line fuzzy finder, from babashka.
|
||||
|
||||
See [fzf.clj](fzf.clj)
|
||||
|
||||
Example usage:
|
||||
|
||||
``` shell
|
||||
$ cat src/babashka/main.clj | bb examples/fzf.clj
|
||||
```
|
||||
|
||||
## [digitalocean-ping.clj](digitalocean-ping.clj)
|
||||
|
||||
The script allows to define which DigitalOcean cloud datacenter (region) has best network performance (ping latency).
|
||||
|
||||
See [digitalocean-ping.clj](digitalocean-ping.clj)
|
||||
|
||||
Example usage:
|
||||
|
||||
``` shell
|
||||
$ bb digitalocean-ping.clj
|
||||
```
|
||||
|
||||
## [download-aliases.clj](download-aliases.clj)
|
||||
|
||||
Download deps for all aliases in a deps.edn project.
|
||||
|
||||
## [Is TTY?](is_tty.clj)
|
||||
|
||||
An equivalent of Python's `os.isatty()` in Babashka, to check if the
|
||||
`stdin`/`stdout`/`stderr` is connected to a TTY or not (useful to check if the
|
||||
script output is being redirect to `/dev/null`, for example).
|
||||
|
||||
Only works in Unix systems.
|
||||
|
||||
``` shell
|
||||
$ bb is-tty.clj
|
||||
STDIN is TTY?: true
|
||||
STDOUT is TTY?: true
|
||||
STDERR is TTY?: true
|
||||
|
||||
$ bb is-tty.clj </dev/null
|
||||
STDIN is TTY?: false
|
||||
STDOUT is TTY?: true
|
||||
STDERR is TTY?: true
|
||||
|
||||
$ bb is-tty.clj 1>&2 >/dev/null
|
||||
STDIN is TTY?: true
|
||||
STDOUT is TTY?: false
|
||||
STDERR is TTY?: true
|
||||
|
||||
$ bb is-tty.clj 2>/dev/null
|
||||
STDIN is TTY?: true
|
||||
STDOUT is TTY?: true
|
||||
STDERR is TTY?: false
|
||||
```
|
||||
|
||||
## [normalize-keywords.clj](normalize-keywords.clj)
|
||||
|
||||
Provide a Clojure file to the script and it will print the Clojure file with
|
||||
auto-resolved keywords normalized to fully qualified ones without double colons:
|
||||
`::set/foo` becomes `:clojure.set/foo`.
|
||||
|
||||
``` clojure
|
||||
$ cat /tmp/test.clj
|
||||
(ns test (:require [clojure.set :as set]))
|
||||
|
||||
[::set/foo ::bar]
|
||||
|
||||
$ bb examples/normalize-keywords.clj /tmp/test.clj
|
||||
(ns test (:require [clojure.set :as set]))
|
||||
|
||||
[:clojure.set/foo :test/bar]
|
||||
```
|
||||
|
||||
## Check stdin for data
|
||||
|
||||
```shell
|
||||
# when piping something in, we get a positive number
|
||||
$ echo 'abc' | bb '(pos? (.available System/in))'
|
||||
true
|
||||
# even if we echo an empty string, we still get the newline
|
||||
$ echo '' | bb '(pos? (.available System/in))'
|
||||
true
|
||||
# with nothing passed in, we finally return false
|
||||
$ bb '(pos? (.available System/in))'
|
||||
false
|
||||
```
|
||||
|
||||
## Using org.clojure/data.xml
|
||||
|
||||
[xml-example.clj](xml-example.clj) explores some of the capabilities provided
|
||||
by the `org.clojure/data.xml` library (required as `xml` by default in Babashka).
|
||||
While running the script will show some output, reading the file shows the library
|
||||
in use.
|
||||
|
||||
```shell
|
||||
$ bb examples/xml-example.clj
|
||||
... some vaguely interesting XML manipulation output
|
||||
```
|
||||
|
||||
## Simple logger
|
||||
|
||||
[logger.clj](logger.clj) is a simple logger that works in bb.
|
||||
|
||||
``` clojure
|
||||
$ bb "(require 'logger) (logger/log \"the logger says hi\")"
|
||||
<expr>:1:19 the logger says hi
|
||||
```
|
||||
|
||||
## Using GZip streams to make a note utility
|
||||
|
||||
[memo.clj](memo.clj) creates zip files in /tmp for stashing notes (possibly the most inefficient KV store ever)
|
||||
|
||||
```shell
|
||||
$ echo "8675309" | memo.clj put jenny
|
||||
ok
|
||||
$ memo.clj get jenny
|
||||
8675309
|
||||
```
|
||||
|
||||
## Pretty-printing mySQL results
|
||||
|
||||
[db_who.clj](db_who.clj) will query mysql for all the connected sessions and pretty-print the user and what program they're using.
|
||||
|
||||
```
|
||||
$ bb db_who.clj
|
||||
| user | program_name |
|
||||
|------------------+----------------|
|
||||
| root@localhost | mysql |
|
||||
| fred@192.168.1.2 | workbench |
|
||||
| jane@192.168.1.3 | Toad for mySQL |
|
||||
```
|
||||
## Single page application with Babashka + htmx
|
||||
|
||||
Example of a todo list SPA using Babashka and htmx
|
||||
See [htmx_todoapp.clj](htmx_todoapp.clj)
|
||||
|
||||
Contributed by [@prestancedesign](https://github.com/prestancedesign).
|
||||
|
||||
## Wikipedia translation
|
||||
|
||||
[wiki-translate.clj](wiki-translate.clj) uses Wikipedia to translate words from English to Dutch (other languages are available).
|
||||
|
||||
``` shell
|
||||
$ bb wiki-translate.clj window
|
||||
"Venster (muur) – Dutch"
|
||||
```
|
||||
|
||||
Shared by Janne Himanka on Clojurians Slack
|
||||
|
|
|
|||
12
examples/cprop-override.properties
Normal file
12
examples/cprop-override.properties
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
datomic.url=datomic:sql://?jdbc:postgresql://localhost:5432/datomic?user=datomic&password=datomic
|
||||
|
||||
source.account.rabbit.host=localhost
|
||||
|
||||
aws.access-key=super secret key
|
||||
aws.secret_key=super secret s3cr3t!!!
|
||||
aws.region=us-east-2
|
||||
|
||||
io.http.pool.conn_timeout=42
|
||||
io.http.pool.max_per_route=42
|
||||
|
||||
other_things=1,2,3,4,5,6,7
|
||||
56
examples/cprop.clj
Executable file
56
examples/cprop.clj
Executable file
|
|
@ -0,0 +1,56 @@
|
|||
#!/usr/bin/env bb
|
||||
(require '[babashka.classpath :refer [add-classpath]])
|
||||
(require '[clojure.java.shell :refer [sh]])
|
||||
(require '[clojure.pprint :refer [pprint]])
|
||||
|
||||
(def deps '{:deps {cprop {:mvn/version "0.1.17"}}})
|
||||
(def cp (:out (sh "clojure" "-Spath" "-Sdeps" (str deps))))
|
||||
(add-classpath cp)
|
||||
|
||||
(require '[cprop.core :refer [load-config]])
|
||||
(require '[cprop.source :refer [from-props-file]])
|
||||
|
||||
;; Load sample configuration from the file system
|
||||
(def conf (load-config :file "cprop.edn"))
|
||||
|
||||
;; Print the configuration we just read in
|
||||
(pprint conf)
|
||||
|
||||
;;=>
|
||||
#_{:datomic {:url "CHANGE ME"}
|
||||
:aws {:access-key "AND ME"
|
||||
:secret-key "ME TOO"
|
||||
:region "FILL ME IN AS WELL"
|
||||
:visiblity-timeout-sec 30
|
||||
:max-conn 50
|
||||
:queue "cprop-dev"}
|
||||
:io {:http {:pool {:socket-timeout 600000
|
||||
:conn-timeout :I-SHOULD-BE-A-NUMBER
|
||||
:conn-req-timeout 600000
|
||||
:max-total 200
|
||||
:max-per-route :ME-ALSO}}}
|
||||
:other-things ["I am a vector and also like to place the substitute game"]}
|
||||
(let [conf (load-config
|
||||
:file "cprop.edn"
|
||||
:merge [(from-props-file "cprop-override.properties")])]
|
||||
(pprint conf))
|
||||
|
||||
;;=>
|
||||
#_{:datomic
|
||||
{:url "datomic:sql://?jdbc:postgresql://localhost:5432/datomic?user=datomic&password=datomic"},
|
||||
:aws
|
||||
{:access-key "super secret key",
|
||||
:secret-key "super secret s3cr3t!!!",
|
||||
:region "us-east-2",
|
||||
:visiblity-timeout-sec 30,
|
||||
:max-conn 50,
|
||||
:queue "cprop-dev"},
|
||||
:io
|
||||
{:http
|
||||
{:pool
|
||||
{:socket-timeout 600000,
|
||||
:conn-timeout 42,
|
||||
:conn-req-timeout 600000,
|
||||
:max-total 200,
|
||||
:max-per-route 42}}},
|
||||
:other-things ["1" "2" "3" "4" "5" "6" "7"]}
|
||||
26
examples/cprop.edn
Normal file
26
examples/cprop.edn
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#_
|
||||
{:datomic
|
||||
{:url "datomic:sql://?jdbc:postgresql://localhost:5432/datomic?user=datomic&password=datomic"}
|
||||
:source
|
||||
{:account
|
||||
{:rabbit
|
||||
{:host "127.0.0.1"
|
||||
:port 5672
|
||||
:vhost "/z-broker"
|
||||
:username "guest"
|
||||
:password "guest"}}}
|
||||
:answer 42}
|
||||
|
||||
{:datomic {:url "CHANGE ME"}
|
||||
:aws {:access-key "AND ME"
|
||||
:secret-key "ME TOO"
|
||||
:region "FILL ME IN AS WELL"
|
||||
:visiblity-timeout-sec 30
|
||||
:max-conn 50
|
||||
:queue "cprop-dev"}
|
||||
:io {:http {:pool {:socket-timeout 600000
|
||||
:conn-timeout :I-SHOULD-BE-A-NUMBER
|
||||
:conn-req-timeout 600000
|
||||
:max-total 200
|
||||
:max-per-route :ME-ALSO}}}
|
||||
:other-things ["I am a vector and also like to place the substitute game"]}
|
||||
11
examples/db_who.clj
Normal file
11
examples/db_who.clj
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(ns db-who
|
||||
(:require [clojure.java.shell :as shell]
|
||||
[clojure.string :as str]
|
||||
[clojure.pprint :as pp]))
|
||||
(defn tsv->maps [tsv]
|
||||
(let [lines (str/split-lines tsv)
|
||||
[headers & rows] (map #(str/split % #"\t") lines)]
|
||||
(map #(zipmap headers %) rows)))
|
||||
|
||||
(-> (shell/sh "mysql" "--column-names" "-e" "select user, program_name from sys.session;")
|
||||
:out tsv->maps pp/print-table)
|
||||
30
examples/digitalocean-ping.clj
Normal file
30
examples/digitalocean-ping.clj
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bb
|
||||
|
||||
(require '[babashka.curl :as curl]
|
||||
'[clojure.java.shell :as shell]
|
||||
'[clojure.string :as str])
|
||||
|
||||
(def url "http://speedtest-ams2.digitalocean.com/")
|
||||
|
||||
(def get-endpoints
|
||||
(let [{:keys [body]} (curl/get url)]
|
||||
(re-seq #"speedtest\-.+.digitalocean.com" body)))
|
||||
|
||||
(defn get-average [result]
|
||||
(-> result
|
||||
str/split-lines
|
||||
last
|
||||
(str/split #"/")
|
||||
(get 4)))
|
||||
|
||||
(def mac? (str/starts-with? (System/getProperty "os.name") "Mac"));; TODO: test on Windows
|
||||
|
||||
(def timeout-arg (if mac? "-t3" "-w3"))
|
||||
|
||||
(defn ping-result [endpoint]
|
||||
(let [{:keys [out]} (shell/sh "ping" "-c5" timeout-arg endpoint)
|
||||
msg (str endpoint " => " (get-average out) "ms")]
|
||||
(println msg)))
|
||||
|
||||
(doseq [endpoint get-endpoints]
|
||||
(ping-result endpoint))
|
||||
16
examples/download-aliases.clj
Executable file
16
examples/download-aliases.clj
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bb
|
||||
|
||||
(require '[clojure.edn :as edn]
|
||||
'[clojure.string :as str])
|
||||
|
||||
(def edn (edn/read-string (slurp "deps.edn")))
|
||||
|
||||
(def aliases (keys (:aliases edn)))
|
||||
|
||||
(require '[babashka.deps :as deps])
|
||||
|
||||
(def cmd ["-P" (str "-A" (str/join aliases))])
|
||||
|
||||
(println "Downloading deps using:" cmd)
|
||||
|
||||
(deps/clojure cmd)
|
||||
9
examples/fzf.clj
Normal file
9
examples/fzf.clj
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
(require '[babashka.process :as p])
|
||||
|
||||
(defn fzf [s]
|
||||
(let [proc (p/process ["fzf" "-m"]
|
||||
{:in s :err :inherit
|
||||
:out :string})]
|
||||
(:out @proc)))
|
||||
|
||||
(fzf (slurp *in*))
|
||||
240
examples/htmx_todoapp.clj
Normal file
240
examples/htmx_todoapp.clj
Normal file
|
|
@ -0,0 +1,240 @@
|
|||
#!/usr/bin/env bb
|
||||
;; Source: https://github.com/prestancedesign/babashka-htmx-todoapp
|
||||
|
||||
(require '[org.httpkit.server :as srv]
|
||||
'[clojure.java.browse :as browse]
|
||||
'[clojure.core.match :refer [match]]
|
||||
'[clojure.pprint :refer [cl-format]]
|
||||
'[clojure.string :as str]
|
||||
'[hiccup.core :as h])
|
||||
|
||||
(import '[java.net URLDecoder])
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Config
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(def port 3000)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Mimic DB (in-memory)
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(def todos (atom (sorted-map 1 {:id 1 :name "Taste htmx with Babashka" :done true}
|
||||
2 {:id 2 :name "Buy a unicorn" :done false})))
|
||||
|
||||
(def todos-id (atom (count @todos)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; "DB" queries
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn add-todo! [name]
|
||||
(let [id (swap! todos-id inc)]
|
||||
(swap! todos assoc id {:id id :name name :done false})))
|
||||
|
||||
(defn toggle-todo! [id]
|
||||
(swap! todos update-in [(Integer. id) :done] not))
|
||||
|
||||
(defn remove-todo! [id]
|
||||
(swap! todos dissoc (Integer. id)))
|
||||
|
||||
(defn filtered-todo [filter-name todos]
|
||||
(case filter-name
|
||||
"active" (remove #(:done (val %)) todos)
|
||||
"completed" (filter #(:done (val %)) todos)
|
||||
"all" todos
|
||||
todos))
|
||||
|
||||
(defn get-items-left []
|
||||
(count (remove #(:done (val %)) @todos)))
|
||||
|
||||
(defn todos-completed []
|
||||
(count (filter #(:done (val %)) @todos)))
|
||||
|
||||
(defn remove-all-completed-todo []
|
||||
(reset! todos (into {} (remove #(:done (val %)) @todos))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Template and components
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn todo-item [{:keys [id name done]}]
|
||||
[:li {:id (str "todo-" id)
|
||||
:class (when done "completed")}
|
||||
[:div.view
|
||||
[:input.toggle {:hx-patch (str "/todos/" id)
|
||||
:type "checkbox"
|
||||
:checked done
|
||||
:hx-target (str "#todo-" id)
|
||||
:hx-swap "outerHTML"}]
|
||||
[:label {:hx-get (str "/todos/edit/" id)
|
||||
:hx-target (str "#todo-" id)
|
||||
:hx-swap "outerHTML"} name]
|
||||
[:button.destroy {:hx-delete (str "/todos/" id)
|
||||
:_ (str "on htmx:afterOnLoad remove #todo-" id)}]]])
|
||||
|
||||
(defn todo-list [todos]
|
||||
(for [todo todos]
|
||||
(todo-item (val todo))))
|
||||
|
||||
(defn todo-edit [id name]
|
||||
[:form {:hx-post (str "/todos/update/" id)}
|
||||
[:input.edit {:type "text"
|
||||
:name "name"
|
||||
:value name}]])
|
||||
|
||||
(defn item-count []
|
||||
(let [items-left (get-items-left)]
|
||||
[:span#todo-count.todo-count {:hx-swap-oob "true"}
|
||||
[:strong items-left] (cl-format nil " item~p " items-left) "left"]))
|
||||
|
||||
(defn todo-filters [filter]
|
||||
[:ul#filters.filters {:hx-swap-oob "true"}
|
||||
[:li [:a {:hx-get "/?filter=all"
|
||||
:hx-push-url "true"
|
||||
:hx-target "#todo-list"
|
||||
:class (when (= filter "all") "selected")} "All"]]
|
||||
[:li [:a {:hx-get "/?filter=active"
|
||||
:hx-push-url "true"
|
||||
:hx-target "#todo-list"
|
||||
:class (when (= filter "active") "selected")} "Active"]]
|
||||
[:li [:a {:hx-get "/?filter=completed"
|
||||
:hx-push-url "true"
|
||||
:hx-target "#todo-list"
|
||||
:class (when (= filter "completed") "selected")} "Completed"]]])
|
||||
|
||||
(defn clear-completed-button []
|
||||
[:button#clear-completed.clear-completed
|
||||
{:hx-delete "/todos"
|
||||
:hx-target "#todo-list"
|
||||
:hx-swap-oob "true"
|
||||
:hx-push-url "/"
|
||||
:class (when-not (pos? (todos-completed)) "hidden")}
|
||||
"Clear completed"])
|
||||
|
||||
(defn template [filter]
|
||||
(str
|
||||
"<!DOCTYPE html>"
|
||||
(h/html
|
||||
[:head
|
||||
[:meta {:charset "UTF-8"}]
|
||||
[:title "Htmx + Babashka"]
|
||||
[:link {:href "https://unpkg.com/todomvc-app-css@2.4.1/index.css" :rel "stylesheet"}]
|
||||
[:script {:src "https://unpkg.com/htmx.org@1.5.0/dist/htmx.min.js" :defer true}]
|
||||
[:script {:src "https://unpkg.com/hyperscript.org@0.8.1/dist/_hyperscript.min.js" :defer true}]]
|
||||
[:body
|
||||
[:section.todoapp
|
||||
[:header.header
|
||||
[:h1 "todos"]
|
||||
[:form
|
||||
{:hx-post "/todos"
|
||||
:hx-target "#todo-list"
|
||||
:hx-swap "beforeend"
|
||||
:_ "on htmx:afterOnLoad set #txtTodo.value to ''"}
|
||||
[:input#txtTodo.new-todo
|
||||
{:name "todo"
|
||||
:placeholder "What needs to be done?"
|
||||
:autofocus ""}]]]
|
||||
[:section.main
|
||||
[:input#toggle-all.toggle-all {:type "checkbox"}]
|
||||
[:label {:for "toggle-all"} "Mark all as complete"]]
|
||||
[:ul#todo-list.todo-list
|
||||
(todo-list (filtered-todo filter @todos))]
|
||||
[:footer.footer
|
||||
(item-count)
|
||||
(todo-filters filter)
|
||||
(clear-completed-button)]]
|
||||
[:footer.info
|
||||
[:p "Click to edit a todo"]
|
||||
[:p "Created by "
|
||||
[:a {:href "https://twitter.com/PrestanceDesign"} "Michaël Sλlihi"]]
|
||||
[:p "Part of "
|
||||
[:a {:href "http://todomvc.com"} "TodoMVC"]]]])))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Helpers
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn parse-body [body]
|
||||
(-> body
|
||||
slurp
|
||||
(str/split #"=")
|
||||
second
|
||||
URLDecoder/decode))
|
||||
|
||||
(defn parse-query-string [query-string]
|
||||
(when query-string
|
||||
(-> query-string
|
||||
(str/split #"=")
|
||||
second)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Handlers
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn app-index [{:keys [query-string headers]}]
|
||||
(let [filter (parse-query-string query-string)
|
||||
ajax-request? (get headers "hx-request")]
|
||||
(if (and filter ajax-request?)
|
||||
(h/html (todo-list (filtered-todo filter @todos))
|
||||
(todo-filters filter))
|
||||
(template filter))))
|
||||
|
||||
(defn add-item [{body :body}]
|
||||
(let [name (parse-body body)
|
||||
todo (add-todo! name)]
|
||||
(h/html (todo-item (val (last todo)))
|
||||
(item-count))))
|
||||
|
||||
(defn edit-item [id]
|
||||
(let [{:keys [id name]} (get @todos (Integer. id))]
|
||||
(h/html (todo-edit id name))))
|
||||
|
||||
(defn update-item [{body :body} id]
|
||||
(let [name (parse-body body)
|
||||
todo (swap! todos assoc-in [(Integer. id) :name] name)]
|
||||
(h/html (todo-item (get todo (Integer. id))))))
|
||||
|
||||
(defn patch-item [id]
|
||||
(let [todo (toggle-todo! id)]
|
||||
(h/html (todo-item (get todo (Integer. id)))
|
||||
(item-count)
|
||||
(clear-completed-button))))
|
||||
|
||||
(defn delete-item [id]
|
||||
(remove-todo! id)
|
||||
(h/html (item-count)))
|
||||
|
||||
(defn clear-completed []
|
||||
(remove-all-completed-todo)
|
||||
(h/html (todo-list @todos)
|
||||
(item-count)
|
||||
(clear-completed-button)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Routes
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn routes [{:keys [request-method uri] :as req}]
|
||||
(let [path (vec (rest (str/split uri #"/")))]
|
||||
(match [request-method path]
|
||||
[:get []] {:body (app-index req)}
|
||||
[:get ["todos" "edit" id]] {:body (edit-item id)}
|
||||
[:post ["todos"]] {:body (add-item req)}
|
||||
[:post ["todos" "update" id]] {:body (update-item req id)}
|
||||
[:patch ["todos" id]] {:body (patch-item id)}
|
||||
[:delete ["todos" id]] {:body (delete-item id)}
|
||||
[:delete ["todos"]] {:body (clear-completed)}
|
||||
:else {:status 404 :body "Error 404: Page not found"})))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Server
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(when (= *file* (System/getProperty "babashka.file"))
|
||||
(let [url (str "http://localhost:" port "/")]
|
||||
(srv/run-server #'routes {:port port})
|
||||
(println "serving" url)
|
||||
(browse/browse-url url)
|
||||
@(promise)))
|
||||
196
examples/http-server.clj
Executable file
196
examples/http-server.clj
Executable file
|
|
@ -0,0 +1,196 @@
|
|||
#!/usr/bin/env bb
|
||||
#_" -*- mode: clojure; -*-"
|
||||
;; Source: https://gist.github.com/holyjak/36c6284c047ffb7573e8a34399de27d8
|
||||
|
||||
;; Based on https://github.com/babashka/babashka/blob/master/examples/image-viewer.clj
|
||||
(ns http-server
|
||||
(:require [babashka.fs :as fs]
|
||||
[clojure.java.browse :as browse]
|
||||
[clojure.string :as str]
|
||||
[clojure.tools.cli :refer [parse-opts]]
|
||||
[hiccup2.core :as html]
|
||||
[org.httpkit.server :as server])
|
||||
(:import [java.net URLDecoder URLEncoder]))
|
||||
|
||||
(def cli-options [["-p" "--port PORT" "Port for HTTP server" :default 8090 :parse-fn #(Integer/parseInt %)]
|
||||
["-d" "--dir DIR" "Directory to serve files from" :default "."]
|
||||
["-h" "--help" "Print usage info"]])
|
||||
|
||||
(def parsed-args (parse-opts *command-line-args* cli-options))
|
||||
(def opts (:options parsed-args))
|
||||
|
||||
(cond
|
||||
(:help opts)
|
||||
(do (println "Start a http server for static files in the given dir. Usage:\n" (:summary parsed-args))
|
||||
(System/exit 0))
|
||||
|
||||
(:errors parsed-args)
|
||||
(do (println "Invalid arguments:\n" (str/join "\n" (:errors parsed-args)))
|
||||
(System/exit 1))
|
||||
|
||||
:else
|
||||
:continue)
|
||||
|
||||
|
||||
(def port (:port opts))
|
||||
(def dir (fs/path (:dir opts)))
|
||||
|
||||
(assert (fs/directory? dir) (str "The given dir `" dir "` is not a directory."))
|
||||
|
||||
;; A simple mime type utility from https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/util/mime_type.clj
|
||||
(def ^{:doc "A map of file extensions to mime-types."}
|
||||
default-mime-types
|
||||
{"7z" "application/x-7z-compressed"
|
||||
"aac" "audio/aac"
|
||||
"ai" "application/postscript"
|
||||
"appcache" "text/cache-manifest"
|
||||
"asc" "text/plain"
|
||||
"atom" "application/atom+xml"
|
||||
"avi" "video/x-msvideo"
|
||||
"bin" "application/octet-stream"
|
||||
"bmp" "image/bmp"
|
||||
"bz2" "application/x-bzip"
|
||||
"class" "application/octet-stream"
|
||||
"cer" "application/pkix-cert"
|
||||
"crl" "application/pkix-crl"
|
||||
"crt" "application/x-x509-ca-cert"
|
||||
"css" "text/css"
|
||||
"csv" "text/csv"
|
||||
"deb" "application/x-deb"
|
||||
"dart" "application/dart"
|
||||
"dll" "application/octet-stream"
|
||||
"dmg" "application/octet-stream"
|
||||
"dms" "application/octet-stream"
|
||||
"doc" "application/msword"
|
||||
"dvi" "application/x-dvi"
|
||||
"edn" "application/edn"
|
||||
"eot" "application/vnd.ms-fontobject"
|
||||
"eps" "application/postscript"
|
||||
"etx" "text/x-setext"
|
||||
"exe" "application/octet-stream"
|
||||
"flv" "video/x-flv"
|
||||
"flac" "audio/flac"
|
||||
"gif" "image/gif"
|
||||
"gz" "application/gzip"
|
||||
"htm" "text/html"
|
||||
"html" "text/html"
|
||||
"ico" "image/x-icon"
|
||||
"iso" "application/x-iso9660-image"
|
||||
"jar" "application/java-archive"
|
||||
"jpe" "image/jpeg"
|
||||
"jpeg" "image/jpeg"
|
||||
"jpg" "image/jpeg"
|
||||
"js" "text/javascript"
|
||||
"json" "application/json"
|
||||
"lha" "application/octet-stream"
|
||||
"lzh" "application/octet-stream"
|
||||
"mov" "video/quicktime"
|
||||
"m3u8" "application/x-mpegurl"
|
||||
"m4v" "video/mp4"
|
||||
"mjs" "text/javascript"
|
||||
"mp3" "audio/mpeg"
|
||||
"mp4" "video/mp4"
|
||||
"mpd" "application/dash+xml"
|
||||
"mpe" "video/mpeg"
|
||||
"mpeg" "video/mpeg"
|
||||
"mpg" "video/mpeg"
|
||||
"oga" "audio/ogg"
|
||||
"ogg" "audio/ogg"
|
||||
"ogv" "video/ogg"
|
||||
"pbm" "image/x-portable-bitmap"
|
||||
"pdf" "application/pdf"
|
||||
"pgm" "image/x-portable-graymap"
|
||||
"png" "image/png"
|
||||
"pnm" "image/x-portable-anymap"
|
||||
"ppm" "image/x-portable-pixmap"
|
||||
"ppt" "application/vnd.ms-powerpoint"
|
||||
"ps" "application/postscript"
|
||||
"qt" "video/quicktime"
|
||||
"rar" "application/x-rar-compressed"
|
||||
"ras" "image/x-cmu-raster"
|
||||
"rb" "text/plain"
|
||||
"rd" "text/plain"
|
||||
"rss" "application/rss+xml"
|
||||
"rtf" "application/rtf"
|
||||
"sgm" "text/sgml"
|
||||
"sgml" "text/sgml"
|
||||
"svg" "image/svg+xml"
|
||||
"swf" "application/x-shockwave-flash"
|
||||
"tar" "application/x-tar"
|
||||
"tif" "image/tiff"
|
||||
"tiff" "image/tiff"
|
||||
"ts" "video/mp2t"
|
||||
"ttf" "font/ttf"
|
||||
"txt" "text/plain"
|
||||
"webm" "video/webm"
|
||||
"wmv" "video/x-ms-wmv"
|
||||
"woff" "font/woff"
|
||||
"woff2" "font/woff2"
|
||||
"xbm" "image/x-xbitmap"
|
||||
"xls" "application/vnd.ms-excel"
|
||||
"xml" "text/xml"
|
||||
"xpm" "image/x-xpixmap"
|
||||
"xwd" "image/x-xwindowdump"
|
||||
"zip" "application/zip"})
|
||||
|
||||
;; https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/util/mime_type.clj
|
||||
(defn- filename-ext
|
||||
"Returns the file extension of a filename or filepath."
|
||||
[filename]
|
||||
(if-let [ext (second (re-find #"\.([^./\\]+)$" filename))]
|
||||
(str/lower-case ext)))
|
||||
|
||||
;; https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/util/mime_type.clj
|
||||
(defn ext-mime-type
|
||||
"Get the mimetype from the filename extension. Takes an optional map of
|
||||
extensions to mimetypes that overrides values in the default-mime-types map."
|
||||
([filename]
|
||||
(ext-mime-type filename {}))
|
||||
([filename mime-types]
|
||||
(let [mime-types (merge default-mime-types mime-types)]
|
||||
(mime-types (filename-ext filename)))))
|
||||
|
||||
(defn index [f]
|
||||
(let [files (map #(str (.relativize dir %))
|
||||
(fs/list-dir f))]
|
||||
{:body (-> [:html
|
||||
[:head
|
||||
[:meta {:charset "UTF-8"}]
|
||||
[:title (str "Index of `" f "`")]]
|
||||
[:body
|
||||
[:h1 "Index of " [:code (str f)]]
|
||||
[:ul
|
||||
(for [child files]
|
||||
[:li [:a {:href (URLEncoder/encode (str child))} child
|
||||
(when (fs/directory? (fs/path dir child)) "/")]])]
|
||||
[:hr]
|
||||
[:footer {:style {"text-aling" "center"}} "Served by http-server.clj"]]]
|
||||
html/html
|
||||
str)}))
|
||||
|
||||
(defn body [path]
|
||||
{:headers {"Content-Type" (ext-mime-type (fs/file-name path))}
|
||||
:body (fs/file path)})
|
||||
|
||||
(server/run-server
|
||||
(fn [{:keys [:uri]}]
|
||||
(let [f (fs/path dir (str/replace-first (URLDecoder/decode uri) #"^/" ""))
|
||||
index-file (fs/path f "index.html")]
|
||||
(cond
|
||||
(and (fs/directory? f) (fs/readable? index-file))
|
||||
(body index-file)
|
||||
|
||||
(fs/directory? f)
|
||||
(index f)
|
||||
|
||||
(fs/readable? f)
|
||||
(body f)
|
||||
|
||||
:else
|
||||
{:status 404 :body (str "Not found `" f "` in " dir)})))
|
||||
{:port port})
|
||||
|
||||
(println "Starting http server at " port "for" (str dir))
|
||||
(browse/browse-url (format "http://localhost:%s/" port))
|
||||
|
||||
@(promise)
|
||||
|
|
@ -1,10 +1,13 @@
|
|||
#!/usr/bin/env bb
|
||||
|
||||
;; This example creates a file serving web server
|
||||
;; This example creates a file serving web server from scratch.
|
||||
;; It accepts a single connection from a browser and serves content to the connected browser
|
||||
;; after the connection times out, this script will serve no more.
|
||||
;; Also see notes.clj for another web app example.
|
||||
|
||||
;; Note that babashka comes with org.httpkit.server now, so you don't need to
|
||||
;; build an http server from scratch anymore. We leave this script here for educational purposes.
|
||||
|
||||
(import (java.net ServerSocket))
|
||||
(require '[clojure.java.io :as io]
|
||||
'[clojure.string :as string])
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
(System/setProperty "babashka.httpkit-server.warning" "false")
|
||||
|
||||
(ns examples.httpkit-server
|
||||
(:require [clojure.pprint :refer [pprint]]
|
||||
[org.httpkit.server :as server]))
|
||||
|
|
|
|||
|
|
@ -4,9 +4,16 @@
|
|||
(:require [clojure.java.browse :as browse]
|
||||
[clojure.java.io :as io]
|
||||
[clojure.string :as str]
|
||||
[clojure.tools.cli :refer [parse-opts]]
|
||||
[org.httpkit.server :as server])
|
||||
(:import [java.net URLDecoder URLEncoder]))
|
||||
|
||||
(def cli-options [["-p" "--port PORT" "Port for HTTP server" :default 8090 :parse-fn #(Integer/parseInt %)]
|
||||
["-d" "--dir DIR" "Directory to scan for images" :default "."]])
|
||||
(def opts (:options (parse-opts *command-line-args* cli-options)))
|
||||
(def port (:port opts))
|
||||
(def dir (:dir opts))
|
||||
|
||||
(def images
|
||||
(filter #(and (.isFile %)
|
||||
(let [name (.getName %)
|
||||
|
|
@ -14,7 +21,7 @@
|
|||
last
|
||||
str/lower-case)]
|
||||
(contains? #{"jpg" "jpeg" "png" "gif" "svg"} ext)))
|
||||
(file-seq (io/file "."))))
|
||||
(file-seq (io/file dir))))
|
||||
|
||||
(def image-count (count images))
|
||||
|
||||
|
|
@ -53,16 +60,22 @@ Navigation: use left/right arrow keys
|
|||
|
||||
(server/run-server
|
||||
(fn [{:keys [:uri]}]
|
||||
(if (str/starts-with? uri "/assets")
|
||||
;; serve the file
|
||||
(let [f (io/file (-> (str/replace uri "assets" "")
|
||||
(URLDecoder/decode)))]
|
||||
{:body f})
|
||||
;; serve html
|
||||
(let [n (-> (str/replace uri "/" "")
|
||||
(Integer/parseInt))]
|
||||
(page n)))))
|
||||
(cond
|
||||
;; serve the file
|
||||
(str/starts-with? uri "/assets")
|
||||
(let [f (io/file (-> (str/replace uri "assets" "")
|
||||
(URLDecoder/decode)))]
|
||||
{:body f})
|
||||
;; serve html
|
||||
(re-matches #"/[0-9]+" uri)
|
||||
(let [n (-> (str/replace uri "/" "")
|
||||
(Integer/parseInt))]
|
||||
(page n))
|
||||
;; favicon.ico, etc
|
||||
:else
|
||||
{:status 404}))
|
||||
{:port port})
|
||||
|
||||
(browse/browse-url "http://localhost:8090/0")
|
||||
(browse/browse-url (format "http://localhost:%s/0" port))
|
||||
|
||||
@(promise)
|
||||
21
examples/is_tty.clj
Executable file
21
examples/is_tty.clj
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bb
|
||||
|
||||
(ns is-tty
|
||||
(:require [babashka.process :as p]))
|
||||
|
||||
(defn- is-tty
|
||||
[fd key]
|
||||
(-> ["test" "-t" (str fd)]
|
||||
(p/process {key :inherit :env {}})
|
||||
deref
|
||||
:exit
|
||||
(= 0)))
|
||||
|
||||
(defn in-is-tty? [] (is-tty 0 :in))
|
||||
(defn out-is-tty? [] (is-tty 1 :out))
|
||||
(defn err-is-tty? [] (is-tty 2 :err))
|
||||
|
||||
(when (= *file* (System/getProperty "babashka.file"))
|
||||
(println "STDIN is TTY?:" (in-is-tty?))
|
||||
(println "STDOUT is TTY?:" (out-is-tty?))
|
||||
(println "STDERR is TTY?:" (err-is-tty?)))
|
||||
11
examples/logger.clj
Normal file
11
examples/logger.clj
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(ns logger)
|
||||
|
||||
(defmacro log [& msgs]
|
||||
(let [m (meta &form)
|
||||
_ns (ns-name *ns*) ;; can also be used for logging
|
||||
file *file*]
|
||||
`(binding [*out* *err*] ;; or bind to (io/writer log-file)
|
||||
(println (str ~file ":"
|
||||
~(:line m) ":"
|
||||
~(:column m))
|
||||
~@msgs))))
|
||||
16
examples/memo.clj
Normal file
16
examples/memo.clj
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bb
|
||||
|
||||
(defn stash [file-name]
|
||||
(with-open [os (java.util.zip.GZIPOutputStream. (io/output-stream (str "/tmp/" file-name ".zip")))]
|
||||
(.write os (.getBytes (slurp *in*)))
|
||||
(.finish os))
|
||||
'ok)
|
||||
|
||||
(defn unstash [file-name]
|
||||
(print (slurp (java.util.zip.GZIPInputStream. (io/input-stream (str "/tmp/" file-name ".zip"))))))
|
||||
|
||||
(let [[action stash-name] *command-line-args*]
|
||||
(case action
|
||||
"put" (stash stash-name)
|
||||
"get" (unstash stash-name)
|
||||
(println "Invalid op:" action)))
|
||||
43
examples/normalize-keywords.clj
Normal file
43
examples/normalize-keywords.clj
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
(ns normalize-keywords
|
||||
(:require [babashka.pods :as pods]
|
||||
[clojure.java.io :as io]
|
||||
[rewrite-clj.node :as node]
|
||||
[rewrite-clj.zip :as z]))
|
||||
|
||||
(pods/load-pod 'clj-kondo/clj-kondo "2022.11.02")
|
||||
|
||||
(require '[pod.borkdude.clj-kondo :as clj-kondo])
|
||||
|
||||
(def code (first *command-line-args*))
|
||||
|
||||
(defn findings [file-path]
|
||||
(->> (clj-kondo/run! {:lint [file-path]
|
||||
:config {:output {:analysis {:keywords true}}}})
|
||||
:analysis
|
||||
:keywords
|
||||
(filter (some-fn :alias :auto-resolved))))
|
||||
|
||||
(defn finding->keyword [{:keys [:ns :name]}]
|
||||
(keyword (str ns) (str name)))
|
||||
|
||||
(defn remove-locs [zloc findings]
|
||||
(loop [zloc zloc
|
||||
findings (seq findings)]
|
||||
(if findings
|
||||
(let [{:keys [:row :col] :as finding} (first findings)
|
||||
node (z/node zloc)
|
||||
m (meta node)]
|
||||
(if (and (= row (:row m))
|
||||
(= col (:col m)))
|
||||
(let [k (finding->keyword finding)
|
||||
zloc (z/replace zloc (node/coerce k))]
|
||||
(recur zloc (next findings)))
|
||||
(recur (z/next zloc) findings)))
|
||||
(str (z/root zloc)))))
|
||||
|
||||
(doseq [f (file-seq (io/file code))
|
||||
:when (re-find #"\.clj[cdsx]?$" (str f))
|
||||
:let [file-path (str f)]]
|
||||
(when-let [findings' (findings file-path)]
|
||||
(prn (format "Rewriting %s" file-path))
|
||||
(spit f (remove-locs (z/of-file file-path) findings'))))
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
#!/usr/bin/env bb
|
||||
|
||||
(import (java.net ServerSocket))
|
||||
(require '[clojure.java.io :as io]
|
||||
'[clojure.string :as str])
|
||||
'[clojure.pprint :refer [pprint]]
|
||||
'[clojure.string :as str]
|
||||
'[org.httpkit.server :as server])
|
||||
|
||||
(def debug? true)
|
||||
(def user "admin")
|
||||
|
|
@ -35,43 +36,23 @@
|
|||
(str/join " " (map html v))
|
||||
:else (str v)))
|
||||
|
||||
(defn write-response [out session-id status headers content]
|
||||
(let [cookie-header (str "Set-Cookie: notes-id=" session-id)
|
||||
headers (str/join "\r\n" (conj headers cookie-header))
|
||||
response (str "HTTP/1.1 " status "\r\n"
|
||||
(str headers "\r\n")
|
||||
"Content-Length: " (if content (count content)
|
||||
0)
|
||||
"\r\n\r\n"
|
||||
(when content
|
||||
(str content)))]
|
||||
(when debug? (println response))
|
||||
(binding [*out* out]
|
||||
(print response)
|
||||
(flush))))
|
||||
|
||||
;; the home page
|
||||
(defn home-response [out session-id]
|
||||
(let [body (str
|
||||
"<!DOCTYPE html>\n"
|
||||
(html
|
||||
[:html
|
||||
[:head
|
||||
[:title "Notes"]]
|
||||
[:body
|
||||
[:h1 "Notes"]
|
||||
[:pre (when (.exists notes-file)
|
||||
(slurp notes-file))]
|
||||
[:form {:action "/" :method "post"}
|
||||
[:input {:type "text" :name "note"}]
|
||||
[:input {:type "submit" :value "Submit"}]]]]))]
|
||||
(write-response out session-id "200 OK" nil body)))
|
||||
|
||||
(defn basic-auth-response [out session-id]
|
||||
(write-response out session-id
|
||||
"401 Unauthorized"
|
||||
["WWW-Authenticate: Basic realm=\"notes\""]
|
||||
nil))
|
||||
(defn home-response [session-id]
|
||||
{:status 200
|
||||
:headers {"Set-Cookie" (str "notes-id=" session-id)}
|
||||
:body (str
|
||||
"<!DOCTYPE html>\n"
|
||||
(html
|
||||
[:html
|
||||
[:head
|
||||
[:title "Notes"]]
|
||||
[:body
|
||||
[:h1 "Notes"]
|
||||
[:pre (when (.exists notes-file)
|
||||
(slurp notes-file))]
|
||||
[:form {:action "/" :method "post"}
|
||||
[:input {:type "text" :name "note"}]
|
||||
[:input {:type "submit" :value "Submit"}]]]]))})
|
||||
|
||||
(def known-sessions
|
||||
(atom #{}))
|
||||
|
|
@ -81,67 +62,54 @@
|
|||
(swap! known-sessions conj uuid)
|
||||
uuid))
|
||||
|
||||
(defn get-session-id [headers]
|
||||
(if-let [cookie-header (first (filter #(str/starts-with? % "Cookie: ") headers))]
|
||||
(let [parts (str/split cookie-header #"; ")]
|
||||
(if-let [notes-id (first (filter #(str/starts-with? % "notes-id") parts))]
|
||||
(str/replace notes-id "notes-id=" "")
|
||||
(new-session!)))
|
||||
(new-session!)))
|
||||
|
||||
(defn basic-auth-header [headers]
|
||||
(some #(str/starts-with? % "Basic-Auth: ") headers))
|
||||
|
||||
(def authenticated-sessions
|
||||
(atom #{}))
|
||||
|
||||
(defn authenticate! [session-id headers]
|
||||
(or (contains? @authenticated-sessions session-id)
|
||||
(when (some #(= % (str "Authorization: Basic " base64)) headers)
|
||||
(when (= (headers "authorization") (str "Basic " base64))
|
||||
(swap! authenticated-sessions conj session-id)
|
||||
true)))
|
||||
|
||||
(defn parse-session-id [cookie]
|
||||
(when cookie
|
||||
(when-let [notes-id (first (filter #(str/starts-with? % "notes-id")
|
||||
(str/split cookie #"; ")))]
|
||||
(str/replace notes-id "notes-id=" ""))))
|
||||
|
||||
(defn basic-auth-response [session-id]
|
||||
{:status 401
|
||||
:headers {"WWW-Authenticate" "Basic realm=\"notes\""
|
||||
"Set-Cookie" (str "notes-id=" session-id)}})
|
||||
|
||||
;; run the server
|
||||
(with-open [server-socket (let [s (new ServerSocket 8080)]
|
||||
(println "Server started on port 8080.")
|
||||
s)]
|
||||
(loop []
|
||||
(let [client-socket (.accept server-socket)]
|
||||
(future
|
||||
(with-open [conn client-socket]
|
||||
(try
|
||||
(let [out (io/writer (.getOutputStream conn))
|
||||
is (.getInputStream conn)
|
||||
in (io/reader is)
|
||||
[_req & headers :as response]
|
||||
(loop [headers []]
|
||||
(let [line (.readLine in)]
|
||||
(if (str/blank? line)
|
||||
headers
|
||||
(recur (conj headers line)))))
|
||||
session-id (get-session-id headers)
|
||||
form-data (let [sb (StringBuilder.)]
|
||||
(loop []
|
||||
(when (.ready in)
|
||||
(.append sb (char (.read in)))
|
||||
(recur)))
|
||||
(-> (str sb)
|
||||
(java.net.URLDecoder/decode)))
|
||||
_ (when debug? (println (str/join "\n" response)))
|
||||
_ (when-not (str/blank? form-data)
|
||||
(when debug? (println form-data))
|
||||
(let [note (str/replace form-data "note=" "")]
|
||||
(write-note! note)))
|
||||
_ (when debug? (println))]
|
||||
(cond
|
||||
;; if we didn't see this session before, we want the user to re-authenticate
|
||||
(not (contains? @known-sessions session-id))
|
||||
(let [uuid (new-session!)]
|
||||
(basic-auth-response out uuid))
|
||||
(not (authenticate! session-id headers))
|
||||
(basic-auth-response out session-id)
|
||||
:else (home-response out session-id)))
|
||||
(catch Throwable t
|
||||
(binding [*err* *out*]
|
||||
(println t)))))))
|
||||
(recur)))
|
||||
(defn handler [req]
|
||||
(when debug?
|
||||
(println "Request:")
|
||||
(pprint req))
|
||||
(let [body (some-> req :body slurp java.net.URLDecoder/decode)
|
||||
session-id (parse-session-id (get-in req [:headers "cookie"]))
|
||||
_ (when (and debug? body)
|
||||
(println "Request body:" body))
|
||||
response (cond
|
||||
;; if we didn't see this session before, we want the user to
|
||||
;; re-authenticate
|
||||
(not (contains? @known-sessions session-id))
|
||||
(basic-auth-response (new-session!))
|
||||
|
||||
(not (authenticate! session-id (:headers req)))
|
||||
(basic-auth-response session-id)
|
||||
|
||||
:else (do (when-not (str/blank? body)
|
||||
(let [note (str/replace body "note=" "")]
|
||||
(write-note! note)))
|
||||
(home-response session-id)))]
|
||||
(when debug?
|
||||
(println "Response:")
|
||||
(pprint (dissoc response :body))
|
||||
(println))
|
||||
response))
|
||||
|
||||
(server/run-server handler {:port 8080})
|
||||
(println "Server started on port 8080.")
|
||||
@(promise) ;; wait until SIGINT
|
||||
|
|
|
|||
15
examples/pom_version_get_xml_zip.clj
Normal file
15
examples/pom_version_get_xml_zip.clj
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
(require '[babashka.deps :as deps])
|
||||
|
||||
(deps/add-deps '{:deps {org.clojure/data.zip {:mvn/version "RELEASE"}}})
|
||||
|
||||
(require '[clojure.data.xml :as xml]
|
||||
'[clojure.data.zip.xml :as xmlz]
|
||||
'[clojure.zip :as zip])
|
||||
|
||||
(def xml "<pom><version>1.0.0</version></pom>")
|
||||
|
||||
(-> xml
|
||||
xml/parse-str
|
||||
zip/xml-zip
|
||||
(xmlz/xml1-> :pom :version zip/down zip/node))
|
||||
;; => 1.0.0
|
||||
|
|
@ -1,16 +1,20 @@
|
|||
#!/usr/bin/env bb
|
||||
|
||||
(ns portal
|
||||
(:require [babashka.classpath :as cp]
|
||||
(:require [babashka.deps :as deps]
|
||||
[cheshire.core :as json]
|
||||
[clj-yaml.core :as yaml]
|
||||
[clojure.data.xml :as xml]
|
||||
[clojure.edn :as edn]
|
||||
[clojure.java.shell :refer [sh]]
|
||||
[clojure.string :as str]))
|
||||
|
||||
(def cp (str/trim (:out (sh "clojure" "-Spath" "-Sdeps" "{:deps {djblue/portal {:mvn/version \"0.6.1\"}}}"))))
|
||||
(cp/add-classpath cp)
|
||||
(deps/add-deps '{:deps {djblue/portal {:mvn/version "0.9.0"}}})
|
||||
|
||||
(require '[portal.api :as p])
|
||||
|
||||
(.addShutdownHook (Runtime/getRuntime)
|
||||
(Thread. (fn [] (p/close))))
|
||||
|
||||
|
||||
(def file (first *command-line-args*))
|
||||
(when-not file
|
||||
|
|
@ -42,11 +46,6 @@
|
|||
:namespace-aware false)
|
||||
(xml->hiccup))))
|
||||
|
||||
(require '[portal.api :as p])
|
||||
|
||||
(.addShutdownHook (Runtime/getRuntime)
|
||||
(Thread. (fn [] (p/close))))
|
||||
|
||||
(p/open)
|
||||
(p/tap)
|
||||
|
||||
|
|
|
|||
19
examples/torrent-viewer.clj
Normal file
19
examples/torrent-viewer.clj
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env bb
|
||||
|
||||
(require '[clojure.java.io :as io])
|
||||
(require '[bencode.core :refer [read-bencode]])
|
||||
(require '[clojure.walk :refer [prewalk]])
|
||||
(require '[clojure.pprint :refer [pprint]])
|
||||
(import 'java.io.PushbackInputStream)
|
||||
|
||||
(defn bytes->strings [coll]
|
||||
(prewalk #(if (bytes? %) (String. % "UTF-8") %) coll))
|
||||
|
||||
(defn read-torrent [src]
|
||||
(with-open [in (io/input-stream (io/file src))]
|
||||
(-> in PushbackInputStream. read-bencode bytes->strings)))
|
||||
|
||||
(when-let [src (first *command-line-args*)]
|
||||
(-> (read-torrent src)
|
||||
(assoc-in ["info" "pieces"] "...") ; binary data
|
||||
pprint))
|
||||
11
examples/wiki-translate.clj
Normal file
11
examples/wiki-translate.clj
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bb
|
||||
;; by Janne Himanka shared on Clojurians Slack
|
||||
(require '[babashka.curl :as curl])
|
||||
|
||||
(let [url (str "https://en.wikipedia.org/wiki/" (first *command-line-args*))
|
||||
page (:body (curl/get url))]
|
||||
(cond
|
||||
(re-find #"Disambiguation" page)
|
||||
(doseq [item (map last (re-seq #"<li><a href...wiki/([^\"]+)" page))]
|
||||
(println item))
|
||||
:else (last (re-find #"nl.wikipedia.org/.+?title..([^\"]+)" page))))
|
||||
78
examples/xml-example.clj
Normal file
78
examples/xml-example.clj
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
; let's build up a little data structure to play with
|
||||
|
||||
(def pet-store-sexp
|
||||
[:pet-store
|
||||
[:family
|
||||
[:owners
|
||||
[:name "Terry Smith"]
|
||||
[:name "Sam Smith"]
|
||||
[:phone "555-1212"]]
|
||||
[:animals
|
||||
[:animal {:type "dog"} "Sparky"]]]
|
||||
[:family
|
||||
[:owners
|
||||
[:name "Pat Jones"]
|
||||
[:phone "555-2121"]]
|
||||
[:animals
|
||||
[:animal {:type "hamster"} "Oliver"]
|
||||
[:animal {:type "cat"} "Kat"]]]])
|
||||
|
||||
; we can build XML from this
|
||||
|
||||
(def xml-str (xml/indent-str (xml/sexp-as-element pet-store-sexp)))
|
||||
|
||||
(println "Our XML as a string is:")
|
||||
(println xml-str)
|
||||
|
||||
(comment xml-str is
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
||||
<pet-store>
|
||||
<family>
|
||||
<owners>
|
||||
<name>Terry Smith</name>...")
|
||||
|
||||
; and then we can parse that XML back into a data structure
|
||||
|
||||
(def xml-tree (xml/parse-str xml-str))
|
||||
|
||||
#_"xml-tree is a nested associative structure:
|
||||
{:tag :pet-store,
|
||||
:attrs {},
|
||||
:content
|
||||
({:tag :family,
|
||||
:attrs {},
|
||||
:content ...})}"
|
||||
|
||||
|
||||
; with a couple of quick helper functions...
|
||||
|
||||
(defn get-by-tag
|
||||
"takes a seq of XML elements (or a 'root-ish' element) and a tag, filters by tag name, and gets the content of each"
|
||||
[elems tag-name]
|
||||
; if we get (presumably) a root element, wrap it in a vector so we can still
|
||||
; filter by its tag
|
||||
(if (xml/element? elems)
|
||||
(recur [elems] tag-name)
|
||||
(->> (filter #(= (:tag %) tag-name) elems)
|
||||
(mapcat :content))))
|
||||
|
||||
(defn get-in-by-tag
|
||||
"takes a seq of XML elements and a vector of tags, and drills into each
|
||||
element by the tags, sort of like a mash-up of core/get-in and an XPath
|
||||
lookup"
|
||||
[elems tag-vec]
|
||||
(reduce get-by-tag elems tag-vec))
|
||||
|
||||
; we can do things like...
|
||||
|
||||
(println "all the owner names:" (get-in-by-tag
|
||||
xml-tree
|
||||
[:pet-store :family :owners :name]))
|
||||
|
||||
(println "all the animal names:" (get-in-by-tag
|
||||
xml-tree
|
||||
[:pet-store :family :animals :animal]))
|
||||
|
||||
(println "all the phone numbers:" (get-in-by-tag
|
||||
xml-tree
|
||||
[:pet-store :family :owners :phone]))
|
||||
|
|
@ -1,109 +0,0 @@
|
|||
(ns babashka.impl.async
|
||||
{:no-doc true}
|
||||
(:require [clojure.core.async :as async]
|
||||
[clojure.core.async.impl.protocols :as protocols]
|
||||
[sci.impl.vars :as vars]))
|
||||
|
||||
(def ^java.util.concurrent.Executor executor @#'async/thread-macro-executor)
|
||||
|
||||
(defn thread-call
|
||||
"Executes f in another thread, returning immediately to the calling
|
||||
thread. Returns a channel which will receive the result of calling
|
||||
f when completed, then close."
|
||||
[f]
|
||||
(let [c (async/chan 1)]
|
||||
(let [binds (vars/get-thread-binding-frame)]
|
||||
(.execute executor
|
||||
(fn []
|
||||
(vars/reset-thread-binding-frame binds)
|
||||
(try
|
||||
(let [ret (f)]
|
||||
(when-not (nil? ret)
|
||||
(async/>!! c ret)))
|
||||
(finally
|
||||
(async/close! c))))))
|
||||
c))
|
||||
|
||||
(defn thread
|
||||
[_ _ & body]
|
||||
`(~'clojure.core.async/thread-call (fn [] ~@body)))
|
||||
|
||||
(defn alt!!
|
||||
"Like alt!, except as if by alts!!, will block until completed, and
|
||||
not intended for use in (go ...) blocks."
|
||||
[_ _ & clauses]
|
||||
(async/do-alt 'clojure.core.async/alts!! clauses))
|
||||
|
||||
(defn go-loop
|
||||
[_ _ bindings & body]
|
||||
(list 'clojure.core.async/thread (list* 'loop bindings body)))
|
||||
|
||||
(def async-namespace
|
||||
{'<!! async/<!!
|
||||
'>!! async/>!!
|
||||
'admix async/admix
|
||||
'alts! async/alts!
|
||||
'alts!! async/alts!!
|
||||
'alt!! (with-meta alt!! {:sci/macro true})
|
||||
'buffer async/buffer
|
||||
'chan async/chan
|
||||
'close! async/close!
|
||||
'do-alt async/do-alt
|
||||
'do-alts async/do-alts
|
||||
'dropping-buffer async/dropping-buffer
|
||||
'filter< async/filter<
|
||||
'filter> async/filter>
|
||||
'into async/into
|
||||
'map async/map
|
||||
'map< async/map<
|
||||
'map> async/map>
|
||||
'mapcat< async/mapcat<
|
||||
'mapcat> async/mapcat>
|
||||
'merge async/merge
|
||||
'mix async/mix
|
||||
'mult async/mult
|
||||
'offer! async/offer!
|
||||
'onto-chan async/onto-chan
|
||||
'partition async/partition
|
||||
'partition-by async/partition-by
|
||||
'pipe async/pipe
|
||||
'pipeline async/pipeline
|
||||
'pipeline-async async/pipeline-async
|
||||
'pipeline-blocking async/pipeline-blocking
|
||||
'poll! async/poll!
|
||||
'promise-chan async/promise-chan
|
||||
'pub async/pub
|
||||
'put! async/put!
|
||||
'reduce async/reduce
|
||||
'remove< async/remove<
|
||||
'remove> async/remove>
|
||||
'sliding-buffer async/sliding-buffer
|
||||
'solo-mode async/solo-mode
|
||||
'split async/split
|
||||
'sub async/sub
|
||||
'take async/take
|
||||
'take! async/take!
|
||||
'tap async/tap
|
||||
'thread (with-meta thread {:sci/macro true})
|
||||
'thread-call thread-call
|
||||
'timeout async/timeout
|
||||
'to-chan async/to-chan
|
||||
'toggle async/toggle
|
||||
'transduce async/transduce
|
||||
'unblocking-buffer? async/unblocking-buffer?
|
||||
'unique async/unique
|
||||
'unmix async/unmix
|
||||
'unmix-all async/unmix-all
|
||||
'unsub async/unsub
|
||||
'unsub-all async/unsub-all
|
||||
'untap async/untap
|
||||
'untap-all async/untap-all
|
||||
;; polyfill
|
||||
'go (with-meta thread {:sci/macro true})
|
||||
'<! async/<!!
|
||||
'>! async/>!!
|
||||
'alt! (with-meta alt!! {:sci/macro true})
|
||||
'go-loop (with-meta go-loop {:sci/macro true})})
|
||||
|
||||
(def async-protocols-namespace
|
||||
{'ReadPort protocols/ReadPort})
|
||||
16
feature-core-match/babashka/impl/match.clj
Normal file
16
feature-core-match/babashka/impl/match.clj
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
(ns babashka.impl.match
|
||||
{:no-doc true}
|
||||
(:require [clojure.core.match :as match]
|
||||
clojure.core.match.array ;; side effecting
|
||||
clojure.core.match.debug ;; side effecting
|
||||
clojure.core.match.protocols ;; side effecting
|
||||
clojure.core.match.regex ;; side effecting
|
||||
[sci.core :as sci :refer [copy-var]]))
|
||||
|
||||
(def mns (sci/create-ns 'clojure.core.match nil))
|
||||
|
||||
(def core-match-namespace
|
||||
{'match (copy-var match/match mns)
|
||||
'backtrack (copy-var match/backtrack mns)
|
||||
'val-at* (copy-var match/val-at* mns)
|
||||
'defpred (copy-var match/defpred mns)})
|
||||
|
|
@ -1,7 +1,10 @@
|
|||
(ns babashka.impl.csv
|
||||
{:no-doc true}
|
||||
(:require [clojure.data.csv :as csv]))
|
||||
(:require [clojure.data.csv :as csv]
|
||||
[sci.core :as sci]))
|
||||
|
||||
(def cns (sci/create-ns 'clojure.data.csv nil))
|
||||
|
||||
(def csv-namespace
|
||||
{'read-csv csv/read-csv
|
||||
'write-csv csv/write-csv})
|
||||
{'read-csv (sci/copy-var csv/read-csv cns)
|
||||
'write-csv (sci/copy-var csv/write-csv cns)})
|
||||
|
|
|
|||
|
|
@ -1,12 +1,26 @@
|
|||
(ns babashka.impl.datascript
|
||||
{:no-doc true}
|
||||
(:require [datascript.core :as d]
|
||||
[sci.impl.namespaces :refer [copy-var]]
|
||||
[sci.impl.vars :as vars]))
|
||||
[datascript.db :as db]
|
||||
[sci.core :as sci :refer [copy-var]]))
|
||||
|
||||
(def datascript-ns (vars/->SciNamespace 'datascript.core nil))
|
||||
(def datascript-ns (sci/create-ns 'datascript.core nil))
|
||||
(def datascript-db-ns (sci/create-ns 'datascript.db nil))
|
||||
|
||||
(def datascript-namespace
|
||||
{'create-conn (copy-var d/create-conn datascript-ns)
|
||||
'transact! (copy-var d/transact! datascript-ns)
|
||||
'q (copy-var d/q datascript-ns)})
|
||||
'q (copy-var d/q datascript-ns)
|
||||
'empty-db (copy-var d/empty-db datascript-ns)
|
||||
'db-with (copy-var d/db-with datascript-ns)
|
||||
'filter (copy-var d/filter datascript-ns)
|
||||
'init-db (copy-var d/init-db datascript-ns)
|
||||
'datom (copy-var d/datom datascript-ns)
|
||||
'pull (copy-var d/pull datascript-ns)
|
||||
'pull-many (copy-var d/pull-many datascript-ns)})
|
||||
|
||||
(def datascript-db-namespace
|
||||
{'db-from-reader (copy-var db/db-from-reader datascript-db-ns)
|
||||
'datom-from-reader (copy-var db/datom-from-reader datascript-db-ns)
|
||||
'datom-added (copy-var db/datom-added datascript-db-ns)
|
||||
'datom-tx (copy-var db/datom-tx datascript-db-ns)})
|
||||
|
|
|
|||
76
feature-hiccup/babashka/impl/hiccup.clj
Normal file
76
feature-hiccup/babashka/impl/hiccup.clj
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
(ns babashka.impl.hiccup
|
||||
{:no-doc true}
|
||||
(:require [hiccup.compiler :as compiler]
|
||||
[hiccup.util :as util]
|
||||
[sci.core :as sci :refer [copy-var]]))
|
||||
|
||||
(def hns (sci/create-ns 'hiccup.core nil))
|
||||
(def hns2 (sci/create-ns 'hiccup2.core nil))
|
||||
(def uns (sci/create-ns 'hiccup.util nil))
|
||||
(def cns (sci/create-ns 'hiccup.compiler nil))
|
||||
|
||||
(defmacro html-2
|
||||
"Render Clojure data structures to a compiled representation of HTML. To turn
|
||||
the representation into a string, use clojure.core/str. Strings inside the
|
||||
macro are automatically HTML-escaped. To insert a string without it being
|
||||
escaped, use the [[raw]] function.
|
||||
A literal option map may be specified as the first argument. It accepts two
|
||||
keys that control how the HTML is outputted:
|
||||
`:mode`
|
||||
: One of `:html`, `:xhtml`, `:xml` or `:sgml` (defaults to `:xhtml`).
|
||||
Controls how tags are rendered.
|
||||
`:escape-strings?`
|
||||
: True if strings should be escaped (defaults to true)."
|
||||
{:added "2.0"}
|
||||
[options & content]
|
||||
;; (prn :escape-strings util/*escape-strings?*)
|
||||
(if (map? options)
|
||||
(let [mode (:mode options :xhtml)
|
||||
escape-strings? (:escape-strings? options true)]
|
||||
`(binding
|
||||
[util/*html-mode* ~mode
|
||||
util/*escape-strings?* ~escape-strings?]
|
||||
(util/raw-string (compiler/render-html (list ~@content)))))
|
||||
`(util/raw-string (compiler/render-html (list ~@(cons options content))))))
|
||||
|
||||
(defmacro html-1
|
||||
"Render Clojure data structures to a string of HTML. Strings are **not**
|
||||
automatically escaped, but must be manually escaped with the [[h]] function.
|
||||
A literal option map may be specified as the first argument. It accepts the
|
||||
following keys:
|
||||
`:mode`
|
||||
: One of `:html`, `:xhtml`, `:xml` or `:sgml` (defaults to `:xhtml`).
|
||||
Controls how tags are rendered."
|
||||
;; {:deprecated "2.0"}
|
||||
[options & content]
|
||||
(if (map? options)
|
||||
`(str (hiccup2.core/html ~(assoc options :escape-strings? false) ~@content))
|
||||
`(str (hiccup2.core/html {:escape-strings? false} ~options ~@content))))
|
||||
|
||||
(def ^{:added "2.0"} raw
|
||||
"Short alias for [[hiccup.util/raw-string]]."
|
||||
util/raw-string)
|
||||
|
||||
(def hiccup-namespace
|
||||
{'html (copy-var html-1 hns {:name 'html})})
|
||||
|
||||
(def hiccup2-namespace
|
||||
{'html (copy-var html-2 hns2 {:name 'html})
|
||||
'raw (copy-var util/raw-string hns2 {:name 'raw})})
|
||||
|
||||
(def html-mode (copy-var util/*html-mode* uns))
|
||||
(def escape-strings? (copy-var util/*escape-strings?* uns))
|
||||
|
||||
(def hiccup-util-namespace
|
||||
{'*html-mode* html-mode
|
||||
'*escape-strings?* escape-strings?
|
||||
'raw-string (copy-var util/raw-string uns)
|
||||
'to-uri (copy-var util/to-uri uns)})
|
||||
|
||||
(defn render-html [& contents]
|
||||
(binding [util/*html-mode* @html-mode
|
||||
util/*escape-strings?* @escape-strings?]
|
||||
(apply compiler/render-html contents)))
|
||||
|
||||
(def hiccup-compiler-namespace
|
||||
{'render-html (copy-var render-html cns)})
|
||||
|
|
@ -72,8 +72,10 @@
|
|||
'acl (copy-var acl cns)
|
||||
'unlock (copy-var unlock cns)
|
||||
'default-client (copy-var client/default-client cns)
|
||||
'*default-client* default-client})
|
||||
'*default-client* default-client
|
||||
'query-string (copy-var client/query-string cns)
|
||||
'url-encode (copy-var client/url-encode cns)})
|
||||
|
||||
(def sni-client-namespace
|
||||
{'ssl-configurer (copy-var sni-client/ssl-configurer sns)
|
||||
'default-client (sci/new-var 'sni-client sni-client {:ns sns})})
|
||||
'default-client (sci/new-var 'default-client sni-client {:ns sns})})
|
||||
|
|
|
|||
|
|
@ -8,10 +8,15 @@
|
|||
{:obj sns
|
||||
'server-stop! (copy-var server/server-stop! sns)
|
||||
'server-port (copy-var server/server-port sns)
|
||||
'server-status (copy-var server/server-status sns)
|
||||
'run-server (copy-var server/run-server sns)
|
||||
'sec-websocket-accept (copy-var server/sec-websocket-accept sns)
|
||||
'websocket-handshake-check (copy-var server/websocket-handshake-check sns)
|
||||
'send-checked-websocket-handshake! (copy-var server/send-checked-websocket-handshake! sns)
|
||||
'send-websocket-handshake! (copy-var server/send-websocket-handshake! sns)
|
||||
'as-channel (copy-var server/as-channel sns)
|
||||
'send! (copy-var server/send! sns)})
|
||||
'send! (copy-var server/send! sns)
|
||||
'with-channel (copy-var server/with-channel sns)
|
||||
'on-close (copy-var server/on-close sns)
|
||||
'close (copy-var server/close sns)}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
(ns babashka.impl.jdbc
|
||||
{:no-doc true}
|
||||
(:require [next.jdbc :as njdbc]
|
||||
[next.jdbc.sql :as sql]
|
||||
[sci.impl.namespaces :refer [copy-var]]
|
||||
[sci.impl.vars :as vars]))
|
||||
(:require
|
||||
[next.jdbc :as njdbc]
|
||||
[next.jdbc.result-set :as rs]
|
||||
[next.jdbc.sql :as sql]
|
||||
[sci.core :as sci]))
|
||||
|
||||
(def next-ns (vars/->SciNamespace 'next.jdbc nil))
|
||||
(def next-ns (sci/create-ns 'next.jdbc nil))
|
||||
|
||||
(defn with-transaction
|
||||
"Given a transactable object, gets a connection and binds it to `sym`,
|
||||
|
|
@ -18,20 +19,30 @@
|
|||
* `:rollback-only` -- `true` / `false`."
|
||||
[_ _ [sym transactable opts] & body]
|
||||
(let [con (vary-meta sym assoc :tag 'java.sql.Connection)]
|
||||
`(next.jdbc/transact ~transactable (^{:once true} fn* [~con] ~@body) ~(or opts {}))))
|
||||
`(njdbc/transact ~transactable (^{:once true} fn* [~con] ~@body) ~(or opts {}))))
|
||||
|
||||
(def njdbc-namespace
|
||||
{'get-datasource (copy-var njdbc/get-datasource next-ns)
|
||||
'execute! (copy-var njdbc/execute! next-ns)
|
||||
'execute-one! (copy-var njdbc/execute-one! next-ns)
|
||||
'get-connection (copy-var njdbc/get-connection next-ns)
|
||||
'plan (copy-var njdbc/plan next-ns)
|
||||
'prepare (copy-var njdbc/prepare next-ns)
|
||||
'transact (copy-var njdbc/transact next-ns)
|
||||
'with-transaction (with-meta with-transaction
|
||||
{:sci/macro true})})
|
||||
{'get-datasource (sci/copy-var njdbc/get-datasource next-ns)
|
||||
'execute! (sci/copy-var njdbc/execute! next-ns)
|
||||
'execute-one! (sci/copy-var njdbc/execute-one! next-ns)
|
||||
'get-connection (sci/copy-var njdbc/get-connection next-ns)
|
||||
'plan (sci/copy-var njdbc/plan next-ns)
|
||||
'prepare (sci/copy-var njdbc/prepare next-ns)
|
||||
'transact (sci/copy-var njdbc/transact next-ns)
|
||||
'with-transaction (sci/copy-var with-transaction next-ns)})
|
||||
|
||||
(def sns (vars/->SciNamespace 'next.jdbc.sql nil))
|
||||
(def sns (sci/create-ns 'next.jdbc.sql nil))
|
||||
|
||||
(def next-sql-namespace
|
||||
{'insert-multi! (copy-var sql/insert-multi! sns)})
|
||||
{'insert-multi! (sci/copy-var sql/insert-multi! sns)})
|
||||
|
||||
(def rsns (sci/create-ns 'next.jdbc.result-set nil))
|
||||
|
||||
(def result-set-namespace
|
||||
{'as-maps (sci/copy-var rs/as-maps rsns)
|
||||
'as-unqualified-maps (sci/copy-var rs/as-unqualified-maps rsns)
|
||||
'as-modified-maps (sci/copy-var rs/as-modified-maps rsns)
|
||||
'as-unqualified-modified-maps (sci/copy-var rs/as-unqualified-modified-maps rsns)
|
||||
'as-lower-maps (sci/copy-var rs/as-lower-maps rsns)
|
||||
'as-unqualified-lower-maps (sci/copy-var rs/as-unqualified-lower-maps rsns)
|
||||
'as-maps-adapter (sci/copy-var rs/as-maps-adapter rsns)})
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
(def tns (sci/create-ns 'lanterna.terminal nil))
|
||||
(def sns (sci/create-ns 'lanterna.screen nil))
|
||||
(def cns (sci/create-ns 'lanterna.screen nil))
|
||||
(def cns (sci/create-ns 'lanterna.constants nil))
|
||||
|
||||
(def lanterna-terminal-namespace
|
||||
{'add-resize-listener (copy-var lanterna.terminal/add-resize-listener tns)
|
||||
|
|
|
|||
233
feature-logging/babashka/impl/logging.clj
Normal file
233
feature-logging/babashka/impl/logging.clj
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
(ns babashka.impl.logging
|
||||
(:require [clojure.tools.logging]
|
||||
[clojure.tools.logging.impl :as impl]
|
||||
[clojure.tools.logging.readable]
|
||||
[sci.core :as sci]
|
||||
[taoensso.encore :as encore :refer [have]]
|
||||
[taoensso.timbre :as timbre]))
|
||||
|
||||
;;;; timbre
|
||||
|
||||
(def tns (sci/create-ns 'taoensso.timbre nil))
|
||||
|
||||
(defn- fline [and-form] (:line (meta and-form)))
|
||||
|
||||
(defonce callsite-counter
|
||||
(encore/counter))
|
||||
|
||||
(defmacro log! ; Public wrapper around `-log!`
|
||||
"Core low-level log macro. Useful for tooling/library authors, etc.
|
||||
|
||||
* `level` - must eval to a valid logging level
|
||||
* `msg-type` - must eval to e/o #{:p :f nil}
|
||||
* `args` - arguments seq (ideally vec) for logging call
|
||||
* `opts` - ks e/o #{:config ?err ?base-data spying?
|
||||
:?ns-str :?file :?line :?column}
|
||||
|
||||
Supports compile-time elision when compile-time const vals
|
||||
provided for `level` and/or `?ns-str`.
|
||||
|
||||
Logging wrapper examples:
|
||||
|
||||
(defn log-wrapper-fn [& args] (timbre/log! :info :p args))
|
||||
(defmacro log-wrapper-macro [& args] (timbre/keep-callsite `(timbre/log! :info :p ~args)))"
|
||||
|
||||
([{:as opts
|
||||
:keys [loc level msg-type args vargs
|
||||
config ?err ?base-data spying?]
|
||||
:or
|
||||
{config 'taoensso.timbre/*config*
|
||||
?err :auto}}]
|
||||
|
||||
(have [:or nil? sequential? symbol?] args)
|
||||
(let [callsite-id (callsite-counter)
|
||||
{:keys [line column]} (merge (meta &form) loc)
|
||||
{:keys [ns file line column]} {:ns @sci/ns :file @sci/file :line line :column column}
|
||||
ns (or (get opts :?ns-str) ns)
|
||||
file (or (get opts :?file) file)
|
||||
line (or (get opts :?line) line)
|
||||
column (or (get opts :?column) column)
|
||||
|
||||
elide? (and #_(enc/const-forms? level ns) (timbre/-elide? level ns))]
|
||||
|
||||
(when-not elide?
|
||||
(let [vargs-form
|
||||
(or vargs
|
||||
(if (symbol? args)
|
||||
`(taoensso.timbre/-ensure-vec ~args)
|
||||
`[ ~@args]))]
|
||||
|
||||
;; Note pre-resolved expansion
|
||||
`(taoensso.timbre/-log! ~config ~level ~ns ~file ~line ~column ~msg-type ~?err
|
||||
(delay ~vargs-form) ~?base-data ~callsite-id ~spying?
|
||||
~(get opts :instant)
|
||||
~(get opts :may-log?))))))
|
||||
|
||||
([level msg-type args & [opts]]
|
||||
(let [{:keys [line column]} (merge (meta &form))
|
||||
{:keys [ns file line column]} {:ns @sci/ns :file @sci/file :line line :column column}
|
||||
loc {:ns ns :file file :line line :column column}
|
||||
opts (assoc (conj {:loc loc} opts)
|
||||
:level level, :msg-type msg-type, :args args)]
|
||||
`(taoensso.timbre/log! ~opts))))
|
||||
|
||||
(defn make-ns [ns sci-ns ks]
|
||||
(reduce (fn [ns-map [var-name var]]
|
||||
(let [m (meta var)
|
||||
doc (:doc m)
|
||||
arglists (:arglists m)]
|
||||
(assoc ns-map var-name
|
||||
(sci/new-var (symbol var-name) @var
|
||||
(cond-> {:ns sci-ns
|
||||
:name (:name m)}
|
||||
(:macro m) (assoc :macro true)
|
||||
doc (assoc :doc doc)
|
||||
arglists (assoc :arglists arglists))))))
|
||||
{}
|
||||
(select-keys (ns-publics ns) ks)))
|
||||
|
||||
(defn println-appender
|
||||
"Returns a simple `println` appender for Clojure/Script.
|
||||
Use with ClojureScript requires that `cljs.core/*print-fn*` be set.
|
||||
:stream (clj only) - e/o #{:auto :*out* :*err* :std-err :std-out <io-stream>}."
|
||||
|
||||
;; Unfortunately no easy way to check if *print-fn* is set. Metadata on the
|
||||
;; default throwing fn would be nice...
|
||||
|
||||
[& [{:keys [stream] :or {stream :auto}}]]
|
||||
(let [stream
|
||||
(case stream
|
||||
:std-err timbre/default-err
|
||||
:std-out timbre/default-out
|
||||
stream)]
|
||||
{:enabled? true
|
||||
:async? false
|
||||
:min-level nil
|
||||
:rate-limit nil
|
||||
:output-fn :inherit
|
||||
:fn
|
||||
(fn [data]
|
||||
(let [{:keys [output_]} data
|
||||
stream
|
||||
(case stream
|
||||
:auto (if (:error-level? data) @sci/err @sci/out)
|
||||
:*out* @sci/out
|
||||
:*err* @sci/err
|
||||
stream)]
|
||||
(binding [*out* stream]
|
||||
(encore/println-atomic (force output_)))))}))
|
||||
|
||||
(def default-config (assoc-in timbre/*config* [:appenders :println]
|
||||
(println-appender {:stream :auto})))
|
||||
|
||||
(def config (sci/new-dynamic-var '*config* default-config
|
||||
{:ns tns}))
|
||||
|
||||
(defn swap-config! [f & args]
|
||||
(apply sci/alter-var-root config f args))
|
||||
|
||||
(defn set-level! [level] (swap-config! (fn [m] (assoc m :min-level level))))
|
||||
|
||||
(defn merge-config! [m] (swap-config! (fn [old] (encore/nested-merge old m))))
|
||||
|
||||
(defmacro -log-and-rethrow-errors [?line & body]
|
||||
`(try (do ~@body)
|
||||
(catch Throwable e#
|
||||
(do
|
||||
#_(error e#) ; CLJ-865
|
||||
(timbre/log! :error :p [e#] ~{:?line ?line})
|
||||
(throw e#)))))
|
||||
|
||||
(def timbre-namespace
|
||||
(assoc (make-ns 'taoensso.timbre tns ['trace 'tracef 'debug 'debugf
|
||||
'info 'infof 'warn 'warnf
|
||||
'error 'errorf
|
||||
'-log! 'with-level
|
||||
'spit-appender '-spy 'spy
|
||||
'color-str])
|
||||
'log! (sci/copy-var log! tns)
|
||||
'*config* config
|
||||
'swap-config! (sci/copy-var swap-config! tns)
|
||||
'merge-config! (sci/copy-var merge-config! tns)
|
||||
'set-level! (sci/copy-var set-level! tns)
|
||||
'println-appender (sci/copy-var println-appender tns)
|
||||
'-log-and-rethrow-errors (sci/copy-var -log-and-rethrow-errors tns)
|
||||
'-ensure-vec (sci/copy-var encore/ensure-vec tns)))
|
||||
|
||||
(def enc-ns (sci/create-ns 'taoensso.encore))
|
||||
|
||||
(def encore-namespace
|
||||
{'catching (sci/copy-var encore/catching enc-ns)
|
||||
'try* (sci/copy-var encore/try* enc-ns)})
|
||||
|
||||
(def timbre-appenders-namespace
|
||||
(let [tan (sci/create-ns 'taoensso.timbre.appenders.core nil)]
|
||||
{'println-appender (sci/copy-var println-appender tan)
|
||||
'spit-appender (sci/copy-var #_:clj-kondo/ignore timbre/spit-appender tan)}))
|
||||
|
||||
;;;; clojure.tools.logging
|
||||
|
||||
(defn- force-var "To support dynamic vars, etc."
|
||||
[x] (if (instance? clojure.lang.IDeref x) (deref x) x))
|
||||
|
||||
(deftype Logger [logger-ns-str timbre-config]
|
||||
clojure.tools.logging.impl/Logger
|
||||
|
||||
(enabled? [_ level]
|
||||
;; No support for per-call config
|
||||
(timbre/may-log? level logger-ns-str
|
||||
(force-var timbre-config)))
|
||||
|
||||
(write! [_ level throwable message]
|
||||
(log! level :p
|
||||
[message] ; No support for pre-msg raw args
|
||||
{:config (force-var timbre-config) ; No support for per-call config
|
||||
:?ns-str logger-ns-str
|
||||
:?file nil ; No support
|
||||
:?line nil ; ''
|
||||
:?err throwable})))
|
||||
|
||||
(deftype LoggerFactory [get-logger-fn]
|
||||
clojure.tools.logging.impl/LoggerFactory
|
||||
(name [_] "Timbre")
|
||||
(get-logger [_ logger-ns] (get-logger-fn logger-ns)))
|
||||
|
||||
(alter-var-root
|
||||
#'clojure.tools.logging/*logger-factory*
|
||||
(fn [_]
|
||||
(LoggerFactory.
|
||||
(encore/memoize (fn [logger-ns] (Logger. (str logger-ns) config))))))
|
||||
|
||||
(def lns (sci/create-ns 'clojure.tools.logging nil))
|
||||
|
||||
(defmacro log
|
||||
"Evaluates and logs a message only if the specified level is enabled. See log*
|
||||
for more details."
|
||||
([level message]
|
||||
`(clojure.tools.logging/log ~level nil ~message))
|
||||
([level throwable message]
|
||||
`(clojure.tools.logging/log ~(deref sci/ns) ~level ~throwable ~message))
|
||||
([logger-ns level throwable message]
|
||||
`(clojure.tools.logging/log clojure.tools.logging/*logger-factory* ~logger-ns ~level ~throwable ~message))
|
||||
([logger-factory logger-ns level throwable message]
|
||||
`(let [logger# (impl/get-logger ~logger-factory ~logger-ns)]
|
||||
(if (impl/enabled? logger# ~level)
|
||||
(clojure.tools.logging/log* logger# ~level ~throwable ~message)))))
|
||||
|
||||
(def tools-logging-namespace
|
||||
(assoc (make-ns 'clojure.tools.logging lns ['debug 'debugf 'info 'infof 'warn 'warnf 'error 'errorf
|
||||
'logp 'logf '*logger-factory* 'log*
|
||||
'trace 'tracef])
|
||||
'log (sci/copy-var log lns)))
|
||||
|
||||
(def lins (sci/create-ns 'clojure.tools.logging.impl nil))
|
||||
|
||||
(def tools-logging-impl-namespace
|
||||
(make-ns 'clojure.tools.logging.impl lins ['get-logger 'enabled?]))
|
||||
|
||||
(def tlr-ns (sci/create-ns 'clojure.tools.logging.readable nil))
|
||||
|
||||
(def tools-logging-readable-namespace
|
||||
(make-ns 'clojure.tools.logging.readable tlr-ns ['trace 'tracef 'debug 'debugf 'info 'infof
|
||||
'warn 'warnf 'error 'errorf 'fatal 'fatalf
|
||||
'logf 'logp 'spyf]))
|
||||
11
feature-priority-map/babashka/impl/priority_map.clj
Normal file
11
feature-priority-map/babashka/impl/priority_map.clj
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(ns babashka.impl.priority-map
|
||||
(:require [clojure.data.priority-map :as pm]
|
||||
[sci.core :as sci]))
|
||||
|
||||
(def pmns (sci/create-ns 'clojure.data.priority-map))
|
||||
|
||||
(def priority-map-namespace
|
||||
{'priority-map (sci/copy-var pm/priority-map pmns)
|
||||
'priority-map-keyfn (sci/copy-var pm/priority-map-keyfn pmns)
|
||||
'subseq (sci/copy-var pm/subseq pmns)
|
||||
'rsubseq (sci/copy-var pm/rsubseq pmns)})
|
||||
7
feature-rrb-vector/babashka/impl/rrb_vector.clj
Normal file
7
feature-rrb-vector/babashka/impl/rrb_vector.clj
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
(ns babashka.impl.rrb-vector
|
||||
(:require [clojure.core.rrb-vector :as rrb]
|
||||
[sci.core :as sci]))
|
||||
|
||||
(def rrbns (sci/create-ns 'clojure.core.rrb-vector))
|
||||
|
||||
(def rrb-vector-namespace {'catvec (sci/copy-var rrb/catvec rrbns)})
|
||||
157
feature-selmer/babashka/impl/selmer.clj
Normal file
157
feature-selmer/babashka/impl/selmer.clj
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
(ns babashka.impl.selmer
|
||||
{:no-doc true}
|
||||
(:require [babashka.impl.classpath :refer [resource]]
|
||||
[babashka.impl.common :refer [ctx]]
|
||||
[sci.core :as sci]
|
||||
[selmer.filters :as filters]
|
||||
[selmer.filter-parser :as fp]
|
||||
[selmer.parser]
|
||||
[selmer.tags :as tags]
|
||||
[selmer.util :as util]
|
||||
[selmer.validator :as validator]))
|
||||
|
||||
(def spns (sci/create-ns 'selmer.parser nil))
|
||||
|
||||
(def include #{'env-map})
|
||||
|
||||
(defn make-ns [ns sci-ns]
|
||||
(reduce (fn [ns-map [var-name var]]
|
||||
(let [m (meta var)
|
||||
no-doc (:no-doc m)
|
||||
doc (:doc m)
|
||||
arglists (:arglists m)]
|
||||
(if (and no-doc (not (contains? include var-name)))
|
||||
ns-map
|
||||
(assoc ns-map var-name
|
||||
(sci/new-var (symbol var-name) @var
|
||||
(cond-> {:ns sci-ns
|
||||
:name (:name m)}
|
||||
(:macro m) (assoc :macro true)
|
||||
doc (assoc :doc doc)
|
||||
arglists (assoc :arglists arglists)))))))
|
||||
{}
|
||||
(ns-publics ns)))
|
||||
|
||||
(def selmer-parser-ns (make-ns 'selmer.parser spns))
|
||||
|
||||
(def suns (sci/create-ns 'selmer.util nil))
|
||||
|
||||
(def escape-variables
|
||||
(sci/new-dynamic-var '*escape-variables* util/*escape-variables* {:ns suns}))
|
||||
|
||||
(defn render-file
|
||||
"Parses files if there isn't a memoized post-parse vector ready to go,
|
||||
renders post-parse vector with passed context-map regardless. Double-checks
|
||||
last-modified on files. Uses classpath for filename-or-url path "
|
||||
[& args]
|
||||
(binding [util/*resource-fn* resource
|
||||
util/*escape-variables* @escape-variables]
|
||||
(apply selmer.parser/render-file args)))
|
||||
|
||||
(defn render
|
||||
" render takes the string, the context-map and possibly also opts. "
|
||||
[& args]
|
||||
(binding [util/*escape-variables* @escape-variables]
|
||||
(apply selmer.parser/render args)))
|
||||
|
||||
(defn render-template
|
||||
" vector of ^selmer.node.INodes and a context map."
|
||||
[template context-map]
|
||||
(binding [util/*escape-variables* @escape-variables]
|
||||
(selmer.parser/render-template template context-map)))
|
||||
|
||||
(defn sci-ns-resolve [ns fqs]
|
||||
(sci/eval-form (ctx) (list 'clojure.core/ns-resolve ns (list 'quote fqs))))
|
||||
|
||||
(defn force! [x]
|
||||
(if (instance? clojure.lang.IDeref x) @x x))
|
||||
|
||||
(defn ^:no-doc resolve-var-from-kw [ns env kw]
|
||||
(if (namespace kw)
|
||||
(when-let [v (sci-ns-resolve ns (symbol (str (namespace kw) "/" (name kw))))] {kw (force! v)})
|
||||
(or
|
||||
;; check local env first
|
||||
(when-let [[_ v] (find env kw)] {kw v})
|
||||
(when-let [v (sci-ns-resolve ns (symbol (name kw)))] {kw (force! v)}))))
|
||||
|
||||
(defmacro <<
|
||||
"Resolves the variables from your template string from the local-env, or the
|
||||
namespace and puts them into your template for you.
|
||||
e.g. (let [a 1] (<< \"{{a}} + {{a}} = 2\")) ;;=> \"1 + 1 = 2\" "
|
||||
[s]
|
||||
`(->> (selmer.parser/known-variables ~s)
|
||||
(mapv #(selmer.parser/resolve-var-from-kw ~(deref sci/ns) (selmer.parser/env-map) %))
|
||||
(apply merge)
|
||||
(selmer.parser/render ~s)))
|
||||
|
||||
(defn resolve-arg
|
||||
"Resolves an arg as passed to an add-tag! handler using the provided
|
||||
context-map.
|
||||
|
||||
A custom tag handler will receive a seq of args as its first argument.
|
||||
With this function, you can selectively resolve one or more of those args
|
||||
so that if they contain literals, the literal value is returned, and if they
|
||||
contain templates of any sort, which can itself have variables, filters or
|
||||
tags in it, they will be returned resolved, applied and rendered.
|
||||
|
||||
Example:
|
||||
(resolve-arg {{header-name|upper}} {:header-name \"My Page\"})
|
||||
=> \"MY PAGE\""
|
||||
[arg context-map]
|
||||
(if (fp/literal? arg)
|
||||
(fp/parse-literal arg)
|
||||
(render arg context-map)))
|
||||
|
||||
(def selmer-parser-namespace
|
||||
(-> selmer-parser-ns
|
||||
(assoc 'render-file (sci/copy-var render-file spns)
|
||||
'render (sci/copy-var render spns)
|
||||
'render-template (sci/copy-var render-template spns)
|
||||
'resolve-var-from-kw (sci/copy-var resolve-var-from-kw spns)
|
||||
'resolve-arg (sci/copy-var resolve-arg spns )
|
||||
'<< (sci/copy-var << spns))))
|
||||
|
||||
(def stns (sci/create-ns 'selmer.tags nil))
|
||||
|
||||
(def selmer-tags-ns (sci/create-ns 'selmer.tags stns))
|
||||
|
||||
(def selmer-tags-namespace
|
||||
{;; needed by selmer.parser/add-tag!
|
||||
'expr-tags (sci/copy-var tags/expr-tags stns)
|
||||
;; needed by selmer.parser/add-tag!
|
||||
'tag-handler (sci/copy-var tags/tag-handler stns)})
|
||||
|
||||
(def sfns (sci/create-ns 'selmer.filters nil))
|
||||
|
||||
(def selmer-filters-namespace
|
||||
{'add-filter! (sci/copy-var filters/add-filter! sfns)
|
||||
'remove-filter! (sci/copy-var filters/remove-filter! sfns)
|
||||
'get-filter (sci/copy-var filters/get-filter sfns)
|
||||
'filters (sci/copy-var filters/filters sfns)})
|
||||
|
||||
(defn turn-off-escaping! []
|
||||
(sci/alter-var-root escape-variables (constantly false)))
|
||||
|
||||
(defn turn-on-escaping! []
|
||||
(sci/alter-var-root escape-variables (constantly true)))
|
||||
|
||||
(defmacro with-escaping [& body]
|
||||
`(binding [selmer.util/*escape-variables* true]
|
||||
~@body))
|
||||
|
||||
(defmacro without-escaping [& body]
|
||||
`(binding [selmer.util/*escape-variables* false]
|
||||
~@body))
|
||||
|
||||
(def selmer-util-namespace
|
||||
{'turn-off-escaping! (sci/copy-var turn-off-escaping! suns)
|
||||
'turn-on-escaping! (sci/copy-var turn-on-escaping! suns)
|
||||
'*escape-variables* escape-variables
|
||||
'with-escaping (sci/copy-var with-escaping suns)
|
||||
'without-escaping (sci/copy-var without-escaping suns)
|
||||
'set-missing-value-formatter! (sci/copy-var util/set-missing-value-formatter! suns)})
|
||||
|
||||
(def svns (sci/create-ns 'selmer.validator nil))
|
||||
|
||||
(def selmer-validator-namespace
|
||||
{'validate-off! (sci/copy-var validator/validate-off! svns)})
|
||||
60
feature-spec-alpha/babashka/impl/spec.clj
Normal file
60
feature-spec-alpha/babashka/impl/spec.clj
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
(ns babashka.impl.spec
|
||||
{:no-doc true}
|
||||
(:require [babashka.impl.clojure.spec.alpha :as s]
|
||||
[babashka.impl.clojure.spec.gen.alpha :as gen]
|
||||
[babashka.impl.clojure.spec.test.alpha :as test]
|
||||
[clojure.core :as c]
|
||||
[sci.core :as sci :refer [copy-var]]))
|
||||
|
||||
(def sns (sci/create-ns 'clojure.spec.alpha nil))
|
||||
(def tns (sci/create-ns 'clojure.spec.test.alpha nil))
|
||||
(def gns (sci/create-ns 'clojure.spec.gen.alpha nil))
|
||||
|
||||
(defn- ns-qualify
|
||||
"Qualify symbol s by resolving it or using the current *ns*."
|
||||
[s]
|
||||
(if-let [ns-sym (some-> s namespace symbol)]
|
||||
(c/or (some-> (get (ns-aliases *ns*) ns-sym) str (symbol (name s)))
|
||||
s)
|
||||
(symbol (str (.name *ns*)) (str s))))
|
||||
|
||||
(c/defn def
|
||||
"Given a namespace-qualified keyword or resolvable symbol k, and a
|
||||
spec, spec-name, predicate or regex-op makes an entry in the
|
||||
registry mapping k to the spec. Use nil to remove an entry in
|
||||
the registry for k."
|
||||
[_ _ k spec-form]
|
||||
(let [k (if (symbol? k) (ns-qualify k) k)]
|
||||
`(clojure.spec.alpha/def-impl '~k '~(s/res spec-form) ~spec-form)))
|
||||
|
||||
;; TODO: fix error in clj-kondo: def is a special form which should always be resolved as the special form
|
||||
#_:clj-kondo/ignore
|
||||
(def spec-namespace
|
||||
{'def (sci/copy-var s/def sns)
|
||||
'def-impl (copy-var s/def-impl sns)
|
||||
'valid? (copy-var s/valid? sns)
|
||||
'gen (copy-var s/gen sns)
|
||||
'cat (copy-var s/cat sns)
|
||||
'cat-impl (copy-var s/cat-impl sns)
|
||||
'fdef (copy-var s/fdef sns)
|
||||
'fspec (copy-var s/fspec sns)
|
||||
'fspec-impl (copy-var s/fspec-impl sns)
|
||||
;; 372
|
||||
'spec (copy-var s/spec sns)
|
||||
'spec-impl (copy-var s/spec-impl sns)
|
||||
#_#_'explain-data (copy-var s/explain-data sns)})
|
||||
|
||||
#_:clj-kondo/ignore
|
||||
(def test-namespace
|
||||
{'instrument (copy-var test/instrument tns)
|
||||
'unstrument (copy-var test/unstrument tns)})
|
||||
|
||||
#_:clj-kondo/ignore
|
||||
(def gen-namespace
|
||||
{'generate (copy-var gen/generate gns)})
|
||||
|
||||
;; def-impl
|
||||
;; -> spec? ;; OK
|
||||
;; regex?
|
||||
;; spec-impl
|
||||
;; with-name
|
||||
199
feature-test-check/babashka/impl/clojure/test/check.clj
Normal file
199
feature-test-check/babashka/impl/clojure/test/check.clj
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
(ns babashka.impl.clojure.test.check
|
||||
{:no-doc true}
|
||||
(:require [clojure.test.check.random :as random]
|
||||
[sci.core :as sci]))
|
||||
|
||||
(def next-rng
|
||||
"Returns a random-number generator. Successive calls should return
|
||||
independent results."
|
||||
(let [a (atom (delay (random/make-java-util-splittable-random (System/currentTimeMillis))))
|
||||
thread-local
|
||||
(proxy [ThreadLocal] []
|
||||
(initialValue []
|
||||
(first (random/split (swap! a #(second (random/split (force %))))))))]
|
||||
(fn []
|
||||
(let [rng (.get thread-local)
|
||||
[rng1 rng2] (random/split rng)]
|
||||
(.set thread-local rng2)
|
||||
rng1))))
|
||||
|
||||
(defn make-random
|
||||
"Given an optional Long seed, returns an object that satisfies the
|
||||
IRandom protocol."
|
||||
([] (next-rng))
|
||||
([seed] (random/make-java-util-splittable-random seed)))
|
||||
|
||||
(alter-var-root #'random/next-rng (constantly next-rng))
|
||||
(alter-var-root #'random/make-random (constantly make-random))
|
||||
|
||||
(def r-ns (sci/create-ns 'clojure.test.check.random nil))
|
||||
|
||||
#_(doseq [k (sort (keys (ns-publics 'clojure.test.check.random)))]
|
||||
(println (str "'" k) (format "(sci/copy-var random/%s r-ns)" k)))
|
||||
|
||||
(def random-namespace
|
||||
{'make-java-util-splittable-random (sci/copy-var random/make-java-util-splittable-random r-ns)
|
||||
'make-random (sci/copy-var random/make-random r-ns)
|
||||
'rand-double (sci/copy-var random/rand-double r-ns)
|
||||
'rand-long (sci/copy-var random/rand-long r-ns)
|
||||
'split (sci/copy-var random/split r-ns)
|
||||
'split-n (sci/copy-var random/split-n r-ns)})
|
||||
|
||||
(require '[clojure.test.check.generators :as gen])
|
||||
|
||||
(def gen-ns (sci/create-ns 'clojure.test.check.generators nil))
|
||||
|
||||
#_(doseq [k (sort (keys (ns-publics 'clojure.test.check.generators)))]
|
||||
(println (str "'" k) (format "(sci/copy-var gen/%s gen-ns)" k)))
|
||||
|
||||
(def generators-namespace
|
||||
{'->Generator (sci/copy-var gen/->Generator gen-ns)
|
||||
'any (sci/copy-var gen/any gen-ns)
|
||||
'any-equatable (sci/copy-var gen/any-equatable gen-ns)
|
||||
'any-printable (sci/copy-var gen/any-printable gen-ns)
|
||||
'any-printable-equatable (sci/copy-var gen/any-printable-equatable gen-ns)
|
||||
'big-ratio (sci/copy-var gen/big-ratio gen-ns)
|
||||
'bind (sci/copy-var gen/bind gen-ns)
|
||||
'boolean (sci/copy-var gen/boolean gen-ns)
|
||||
'byte (sci/copy-var gen/byte gen-ns)
|
||||
'bytes (sci/copy-var gen/bytes gen-ns)
|
||||
'call-gen (sci/copy-var gen/call-gen gen-ns)
|
||||
'char (sci/copy-var gen/char gen-ns)
|
||||
'char-alpha (sci/copy-var gen/char-alpha gen-ns)
|
||||
'char-alpha-numeric (sci/copy-var gen/char-alpha-numeric gen-ns)
|
||||
'char-alphanumeric (sci/copy-var gen/char-alphanumeric gen-ns)
|
||||
'char-ascii (sci/copy-var gen/char-ascii gen-ns)
|
||||
'choose (sci/copy-var gen/choose gen-ns)
|
||||
'container-type (sci/copy-var gen/container-type gen-ns)
|
||||
'double (sci/copy-var gen/double gen-ns)
|
||||
'double* (sci/copy-var gen/double* gen-ns)
|
||||
'elements (sci/copy-var gen/elements gen-ns)
|
||||
'fmap (sci/copy-var gen/fmap gen-ns)
|
||||
'frequency (sci/copy-var gen/frequency gen-ns)
|
||||
'gen-bind (sci/copy-var gen/gen-bind gen-ns)
|
||||
'gen-fmap (sci/copy-var gen/gen-fmap gen-ns)
|
||||
'gen-pure (sci/copy-var gen/gen-pure gen-ns)
|
||||
'generate (sci/copy-var gen/generate gen-ns)
|
||||
'generator? (sci/copy-var gen/generator? gen-ns)
|
||||
'hash-map (sci/copy-var gen/hash-map gen-ns)
|
||||
'int (sci/copy-var gen/int gen-ns)
|
||||
'keyword (sci/copy-var gen/keyword gen-ns)
|
||||
'keyword-ns (sci/copy-var gen/keyword-ns gen-ns)
|
||||
'large-integer (sci/copy-var gen/large-integer gen-ns)
|
||||
'large-integer* (sci/copy-var gen/large-integer* gen-ns)
|
||||
'lazy-random-states (sci/copy-var gen/lazy-random-states gen-ns)
|
||||
'let (sci/copy-var gen/let gen-ns)
|
||||
'list (sci/copy-var gen/list gen-ns)
|
||||
'list-distinct (sci/copy-var gen/list-distinct gen-ns)
|
||||
'list-distinct-by (sci/copy-var gen/list-distinct-by gen-ns)
|
||||
'make-size-range-seq (sci/copy-var gen/make-size-range-seq gen-ns)
|
||||
'map (sci/copy-var gen/map gen-ns)
|
||||
'map->Generator (sci/copy-var gen/map->Generator gen-ns)
|
||||
'nat (sci/copy-var gen/nat gen-ns)
|
||||
'neg-int (sci/copy-var gen/neg-int gen-ns)
|
||||
'no-shrink (sci/copy-var gen/no-shrink gen-ns)
|
||||
'not-empty (sci/copy-var gen/not-empty gen-ns)
|
||||
'one-of (sci/copy-var gen/one-of gen-ns)
|
||||
'pos-int (sci/copy-var gen/pos-int gen-ns)
|
||||
'ratio (sci/copy-var gen/ratio gen-ns)
|
||||
'recursive-gen (sci/copy-var gen/recursive-gen gen-ns)
|
||||
'resize (sci/copy-var gen/resize gen-ns)
|
||||
'return (sci/copy-var gen/return gen-ns)
|
||||
's-neg-int (sci/copy-var gen/s-neg-int gen-ns)
|
||||
's-pos-int (sci/copy-var gen/s-pos-int gen-ns)
|
||||
'sample (sci/copy-var gen/sample gen-ns)
|
||||
'sample-seq (sci/copy-var gen/sample-seq gen-ns)
|
||||
'scale (sci/copy-var gen/scale gen-ns)
|
||||
'set (sci/copy-var gen/set gen-ns)
|
||||
'shrink-2 (sci/copy-var gen/shrink-2 gen-ns)
|
||||
'shuffle (sci/copy-var gen/shuffle gen-ns)
|
||||
'simple-type (sci/copy-var gen/simple-type gen-ns)
|
||||
'simple-type-equatable (sci/copy-var gen/simple-type-equatable gen-ns)
|
||||
'simple-type-printable (sci/copy-var gen/simple-type-printable gen-ns)
|
||||
'simple-type-printable-equatable (sci/copy-var gen/simple-type-printable-equatable gen-ns)
|
||||
'size-bounded-bigint (sci/copy-var gen/size-bounded-bigint gen-ns)
|
||||
'sized (sci/copy-var gen/sized gen-ns)
|
||||
'small-integer (sci/copy-var gen/small-integer gen-ns)
|
||||
'sorted-set (sci/copy-var gen/sorted-set gen-ns)
|
||||
'string (sci/copy-var gen/string gen-ns)
|
||||
'string-alpha-numeric (sci/copy-var gen/string-alpha-numeric gen-ns)
|
||||
'string-alphanumeric (sci/copy-var gen/string-alphanumeric gen-ns)
|
||||
'string-ascii (sci/copy-var gen/string-ascii gen-ns)
|
||||
'such-that (sci/copy-var gen/such-that gen-ns)
|
||||
'symbol (sci/copy-var gen/symbol gen-ns)
|
||||
'symbol-ns (sci/copy-var gen/symbol-ns gen-ns)
|
||||
'tuple (sci/copy-var gen/tuple gen-ns)
|
||||
'uuid (sci/copy-var gen/uuid gen-ns)
|
||||
'vector (sci/copy-var gen/vector gen-ns)
|
||||
'vector-distinct (sci/copy-var gen/vector-distinct gen-ns)
|
||||
'vector-distinct-by (sci/copy-var gen/vector-distinct-by gen-ns)})
|
||||
|
||||
(require '[clojure.test.check.rose-tree :as rose-tree])
|
||||
|
||||
(def rose-ns (sci/create-ns 'clojure.test.check.rose-tree nil))
|
||||
|
||||
#_(doseq [k (sort (keys (ns-publics 'clojure.test.check.rose-tree)))]
|
||||
(println (str "'" k) (format "(sci/copy-var rose-tree/%s rose-ns)" k)))
|
||||
|
||||
(def rose-tree-namespace
|
||||
{'->RoseTree (sci/copy-var rose-tree/->RoseTree rose-ns)
|
||||
'bind (sci/copy-var rose-tree/bind rose-ns)
|
||||
'children (sci/copy-var rose-tree/children rose-ns)
|
||||
'collapse (sci/copy-var rose-tree/collapse rose-ns)
|
||||
'filter (sci/copy-var rose-tree/filter rose-ns)
|
||||
'fmap (sci/copy-var rose-tree/fmap rose-ns)
|
||||
'join (sci/copy-var rose-tree/join rose-ns)
|
||||
'make-rose (sci/copy-var rose-tree/make-rose rose-ns)
|
||||
'permutations (sci/copy-var rose-tree/permutations rose-ns)
|
||||
'pure (sci/copy-var rose-tree/pure rose-ns)
|
||||
'remove (sci/copy-var rose-tree/remove rose-ns)
|
||||
'root (sci/copy-var rose-tree/root rose-ns)
|
||||
'seq (sci/copy-var rose-tree/seq rose-ns)
|
||||
'shrink (sci/copy-var rose-tree/shrink rose-ns)
|
||||
'shrink-vector (sci/copy-var rose-tree/shrink-vector rose-ns)
|
||||
'zip (sci/copy-var rose-tree/zip rose-ns)})
|
||||
|
||||
(require '[clojure.test.check.properties :as properties])
|
||||
|
||||
(def p-ns (sci/create-ns 'clojure.test.check.properties nil))
|
||||
|
||||
#_(doseq [k (sort (keys (ns-publics 'clojure.test.check.properties)))]
|
||||
(println (str "'" k) (format "(sci/copy-var properties/%s p-ns)" k)))
|
||||
|
||||
(def properties-namespace
|
||||
{'->ErrorResult (sci/copy-var properties/->ErrorResult p-ns)
|
||||
'for-all (sci/copy-var properties/for-all p-ns)
|
||||
'for-all* (sci/copy-var properties/for-all* p-ns)
|
||||
'map->ErrorResult (sci/copy-var properties/map->ErrorResult p-ns)})
|
||||
|
||||
(require '[clojure.test.check :as tc])
|
||||
|
||||
(def tc-ns (sci/create-ns 'clojure.test.check nil))
|
||||
|
||||
#_(doseq [k (sort (keys (ns-publics 'clojure.test.check)))]
|
||||
(println (str "'" k) (format "(sci/copy-var tc/%s p-ns)" k)))
|
||||
|
||||
(def test-check-namespace
|
||||
{'quick-check (sci/copy-var tc/quick-check tc-ns)})
|
||||
|
||||
#_(require '[clojure.test.check.clojure-test :as tct])
|
||||
|
||||
#_(def tct-ns (sci/create-ns 'clojure.test.check nil))
|
||||
|
||||
#_(doseq [k (sort (keys (ns-publics 'clojure.test.check.clojure-test)))]
|
||||
(println (str "'" k) (format "(sci/copy-var tct/%s tct-ns)" k)))
|
||||
|
||||
#_(def test-check-clojure-test-namespace
|
||||
{'*default-opts* (sci/copy-var tct/*default-opts* tct-ns)
|
||||
'*default-test-count* (sci/copy-var tct/*default-test-count* tct-ns)
|
||||
'*report-completion* (sci/copy-var tct/*report-completion* tct-ns)
|
||||
'*report-shrinking* (sci/copy-var tct/*report-shrinking* tct-ns)
|
||||
'*report-trials* (sci/copy-var tct/*report-trials* tct-ns)
|
||||
'*trial-report-period* (sci/copy-var tct/*trial-report-period* tct-ns)
|
||||
'assert-check (sci/copy-var tct/assert-check tct-ns)
|
||||
'default-reporter-fn (sci/copy-var tct/default-reporter-fn tct-ns)
|
||||
'defspec (sci/copy-var tct/defspec tct-ns)
|
||||
'process-options (sci/copy-var tct/process-options tct-ns)
|
||||
'trial-report-dots (sci/copy-var tct/trial-report-dots tct-ns)
|
||||
'trial-report-periodic (sci/copy-var tct/trial-report-periodic tct-ns)
|
||||
'with-test-out* (sci/copy-var tct/with-test-out* tct-ns)})
|
||||
|
|
@ -1,16 +1,19 @@
|
|||
(ns babashka.impl.transit
|
||||
(:require [cognitect.transit :as transit]
|
||||
[sci.impl.namespaces :refer [copy-var]]
|
||||
[sci.impl.vars :as vars]))
|
||||
(:require
|
||||
[cognitect.transit :as transit]
|
||||
[sci.core :as sci :refer [copy-var]]))
|
||||
|
||||
|
||||
(def tns (vars/->SciNamespace 'cognitect.transit nil))
|
||||
(def tns (sci/create-ns 'cognitect.transit nil))
|
||||
|
||||
(def transit-namespace
|
||||
{'write (copy-var transit/write tns)
|
||||
'writer (copy-var transit/writer tns)
|
||||
'write-handler (copy-var transit/write-handler tns)
|
||||
'write-handler-map (copy-var transit/write-handler-map tns)
|
||||
'write-meta (copy-var transit/write-meta tns)
|
||||
'read (copy-var transit/read tns)
|
||||
'reader (copy-var transit/reader tns)
|
||||
'read-handler (copy-var transit/read-handler tns)})
|
||||
'read-handler (copy-var transit/read-handler tns)
|
||||
'read-handler-map (copy-var transit/read-handler-map tns)
|
||||
'default-write-handlers (copy-var transit/default-write-handlers tns)
|
||||
'tagged-value (copy-var transit/tagged-value tns)})
|
||||
|
|
|
|||
|
|
@ -1,13 +1,52 @@
|
|||
(ns babashka.impl.xml
|
||||
{:no-doc true}
|
||||
(:require [clojure.data.xml :as xml]
|
||||
[sci.impl.namespaces :refer [copy-var]]
|
||||
[sci.impl.vars :as vars]))
|
||||
(:require [babashka.impl.common :refer [ctx]]
|
||||
[clojure.data.xml :as xml]
|
||||
[clojure.data.xml.event :as event]
|
||||
[clojure.data.xml.tree :as tree]
|
||||
[sci.core :as sci :refer [copy-var]]
|
||||
[sci.impl.vars]))
|
||||
|
||||
(def xns (vars/->SciNamespace 'clojure.data.xml nil))
|
||||
(def xns (sci/create-ns 'clojure.data.xml nil))
|
||||
(def xens (sci/create-ns 'clojure.data.xml.event nil))
|
||||
(def xtns (sci/create-ns 'clojure.data.xml.tree nil))
|
||||
|
||||
(defn- clj-ns-name [ns]
|
||||
(cond (instance? sci.lang.Namespace ns) (str ns)
|
||||
(keyword? ns) (name ns)
|
||||
:else (str ns)))
|
||||
|
||||
(defn alias-uri
|
||||
"Define a Clojure namespace aliases for xmlns uris.
|
||||
This sets up the current namespace for reading qnames denoted with
|
||||
Clojure's ::alias/keywords reader feature.
|
||||
|
||||
## Example
|
||||
(alias-uri :D \"DAV:\")
|
||||
; similar in effect to
|
||||
;; (require '[xmlns.DAV%3A :as D])
|
||||
; but required namespace is auto-created
|
||||
; henceforth, shorthand keywords can be used
|
||||
{:tag ::D/propfind}
|
||||
; ::D/propfind will be expanded to :xmlns.DAV%3A/propfind
|
||||
; in the current namespace by the reader
|
||||
## Clojurescript support
|
||||
Currently, namespaces can't be auto-created in Clojurescript.
|
||||
Dummy files for aliased uris have to exist. Have a look at `uri-file` and `print-uri-file-command!` to create those."
|
||||
{:arglists '([& {:as alias-nss}])}
|
||||
[& ans]
|
||||
(loop [[a n & rst :as ans] ans]
|
||||
(when (seq ans)
|
||||
#_(assert (<= (count ans)) (pr-str ans))
|
||||
(let [xn (xml/uri-symbol n)
|
||||
al (symbol (clj-ns-name a))]
|
||||
(sci/eval-form (ctx) `(create-ns (quote ~xn)))
|
||||
(sci/eval-form (ctx) `(alias (quote ~al) (quote ~xn)))
|
||||
(recur rst)))))
|
||||
|
||||
(def xml-namespace
|
||||
{'aggregate-xmlns (copy-var xml/aggregate-xmlns xns)
|
||||
'alias-uri (copy-var alias-uri xns)
|
||||
'as-qname (copy-var xml/as-qname xns)
|
||||
'cdata (copy-var xml/cdata xns)
|
||||
'element (copy-var xml/element xns)
|
||||
|
|
@ -33,3 +72,11 @@
|
|||
'uri-file (copy-var xml/uri-file xns)
|
||||
'uri-symbol (copy-var xml/uri-symbol xns)
|
||||
'xml-comment (copy-var xml/xml-comment xns)})
|
||||
|
||||
(def xml-event-namespace
|
||||
{'event-element (copy-var event/event-element xens)
|
||||
'event-exit? (copy-var event/event-exit? xens)
|
||||
'event-node (copy-var event/event-node xens)})
|
||||
|
||||
(def xml-tree-namespace
|
||||
{'seq-tree (copy-var tree/seq-tree xtns)})
|
||||
|
|
|
|||
|
|
@ -1,9 +1,14 @@
|
|||
(ns babashka.impl.ordered
|
||||
{:no-doc true}
|
||||
(:require [flatland.ordered.map :as omap]
|
||||
[flatland.ordered.set :as oset]
|
||||
[sci.core :as sci]))
|
||||
|
||||
(def omap-ns (sci/create-ns 'flatland.ordered.map nil))
|
||||
(def oset-ns (sci/create-ns 'flatland.ordered.set nil))
|
||||
|
||||
(def ordered-map-ns
|
||||
{'ordered-map (sci/copy-var omap/ordered-map omap-ns)})
|
||||
|
||||
(def ordered-set-ns
|
||||
{'ordered-set (sci/copy-var oset/ordered-set oset-ns)})
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
(ns babashka.impl.yaml
|
||||
{:no-doc true}
|
||||
(:require [clj-yaml.core :as yaml]
|
||||
[sci.impl.namespaces :refer [copy-var]]
|
||||
[sci.impl.vars :as vars]))
|
||||
[sci.core :as sci :refer [copy-var]]))
|
||||
|
||||
(def yns (vars/->SciNamespace 'clj-yaml.core nil))
|
||||
(def yns (sci/create-ns 'clj-yaml.core nil))
|
||||
|
||||
(def yaml-namespace
|
||||
{'mark (copy-var yaml/mark yns)
|
||||
'unmark (copy-var yaml/unmark yns)
|
||||
'generate-string (copy-var yaml/generate-string yns)
|
||||
'parse-string (copy-var yaml/parse-string yns)})
|
||||
'parse-string (copy-var yaml/parse-string yns)
|
||||
'generate-stream (copy-var yaml/generate-stream yns)
|
||||
'parse-stream (copy-var yaml/parse-stream yns)
|
||||
})
|
||||
|
|
|
|||
1
fs
Submodule
1
fs
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit fdd5780bc4df4931332b56082c6c3a5c3c85066d
|
||||
2
impl-java/.dir-locals.el
Normal file
2
impl-java/.dir-locals.el
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
((nil
|
||||
(cider-clojure-cli-global-options . "-A:test:build")))
|
||||
2
impl-java/bb.edn
Normal file
2
impl-java/bb.edn
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
{:tasks {install (clojure "-T:build install")
|
||||
deploy (clojure "-T:build deploy")}}
|
||||
62
impl-java/build.clj
Normal file
62
impl-java/build.clj
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
(ns build
|
||||
(:require [build.reify2 :as reify2]
|
||||
[clojure.tools.build.api :as b]))
|
||||
|
||||
(def lib 'org.babashka/babashka.impl.java)
|
||||
(def version "0.1.10")
|
||||
(def class-dir "target/classes")
|
||||
(def basis (b/create-basis {:project "deps.edn"}))
|
||||
(def jar-file (format "target/%s-%s.jar" (name lib) version))
|
||||
|
||||
(defn clean [_]
|
||||
(b/delete {:path "target"}))
|
||||
|
||||
(defn gen-classes [_]
|
||||
(reify2/gen-classes nil))
|
||||
|
||||
(defn compile-java [_]
|
||||
(b/javac {:src-dirs ["src-java"]
|
||||
:class-dir class-dir
|
||||
:basis basis
|
||||
:javac-opts ["--release" "8"]}))
|
||||
|
||||
(defn jar [_]
|
||||
(compile-java nil)
|
||||
(gen-classes nil)
|
||||
(b/write-pom {:class-dir class-dir
|
||||
:lib lib
|
||||
:version version
|
||||
:basis basis
|
||||
:src-dirs ["src"]
|
||||
:pom-data
|
||||
[[:licenses
|
||||
[:license
|
||||
[:name "MIT License"]
|
||||
[:url "https://opensource.org/license/mit/"]]]]})
|
||||
(b/copy-dir {:src-dirs ["src"]
|
||||
:target-dir class-dir})
|
||||
(b/jar {:class-dir class-dir
|
||||
:jar-file jar-file}))
|
||||
|
||||
(defn install [_]
|
||||
(jar nil)
|
||||
(b/install {:basis basis
|
||||
:lib lib
|
||||
:version version
|
||||
:jar-file jar-file
|
||||
:class-dir class-dir}))
|
||||
|
||||
(defn deploy [opts]
|
||||
(jar opts)
|
||||
((requiring-resolve 'deps-deploy.deps-deploy/deploy)
|
||||
(merge {:installer :remote
|
||||
:artifact jar-file
|
||||
:pom-file (b/pom-path {:lib lib :class-dir class-dir})}
|
||||
opts))
|
||||
opts)
|
||||
|
||||
;;;; Scratch
|
||||
|
||||
(comment
|
||||
(gen-classes nil)
|
||||
)
|
||||
188
impl-java/build/reify2.clj
Normal file
188
impl-java/build/reify2.clj
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
(ns build.reify2
|
||||
{:no-doc true}
|
||||
(:require [babashka.impl.reify2.interfaces :refer [interfaces]]
|
||||
[insn.core :as insn]))
|
||||
|
||||
(set! *warn-on-reflection* false)
|
||||
|
||||
(defn set-symbol! [s]
|
||||
[[:aconst-null]
|
||||
[:ldc s]
|
||||
[:invokestatic clojure.lang.Symbol "intern" [String String clojure.lang.Symbol]]
|
||||
[:putstatic :this (str "_sym_" s) clojure.lang.Symbol]])
|
||||
|
||||
(defn return [desc]
|
||||
(case (last desc)
|
||||
:void [:return]
|
||||
(:boolean :int) [:ireturn]
|
||||
[:areturn]))
|
||||
|
||||
(defn loads [desc cast?]
|
||||
(let [desc (butlast desc)]
|
||||
(vec
|
||||
(mapcat (fn [i e]
|
||||
(case e
|
||||
:boolean [[:iload i]
|
||||
(when cast? [:invokestatic Boolean "valueOf" [:boolean Boolean]])]
|
||||
:int [[:iload i]
|
||||
(when cast? [:invokestatic Integer "valueOf" [:int Integer]])]
|
||||
[[:aload i]]))
|
||||
(range 1 (inc (count desc)))
|
||||
desc))))
|
||||
|
||||
(defn emit-method [class meth desc default]
|
||||
(let [args (dec (count desc))]
|
||||
[[[:aload 0]
|
||||
[:getfield :this "_methods" java.util.Map]
|
||||
[:getstatic :this (str "_sym_" meth) clojure.lang.Symbol]
|
||||
[:invokeinterface java.util.Map "get" [Object Object]]
|
||||
[:checkcast clojure.lang.IFn]
|
||||
[:astore (inc args)]
|
||||
[:aload (inc args)]
|
||||
[:ifnull :fallback]
|
||||
[:aload (inc args)]
|
||||
;; load this, always the first argument of IFn
|
||||
[:aload 0]]
|
||||
;; load remaining args
|
||||
(loads desc true)
|
||||
[[:invokeinterface clojure.lang.IFn "invoke" (vec (repeat (inc (count desc)) Object))]
|
||||
(let [ret-type* (last desc)
|
||||
ret-type (if (class? ret-type*)
|
||||
(.getName ^Class ret-type*)
|
||||
ret-type*)]
|
||||
(case ret-type
|
||||
:void [:pop]
|
||||
:boolean [[:checkcast Boolean]
|
||||
[:invokevirtual Boolean "booleanValue"]]
|
||||
:int [[:checkcast Integer]
|
||||
[:invokevirtual Integer "intValue"]]
|
||||
"java.lang.Object" nil
|
||||
(when (class? ret-type*)
|
||||
[[:checkcast ret-type*]])))
|
||||
(return desc)
|
||||
[:mark :fallback]]
|
||||
(if default
|
||||
[[[:aload 0]]
|
||||
(loads desc false)
|
||||
[[:invokespecial class meth desc true]
|
||||
(return desc)]]
|
||||
[[:new java.lang.UnsupportedOperationException]
|
||||
[:dup]
|
||||
[:ldc (format "No implementation of method found: %s %s" meth desc)]
|
||||
[:invokespecial java.lang.UnsupportedOperationException :init [String :void]]
|
||||
[:athrow]])]))
|
||||
|
||||
(defn interface-data [^Class interface methods]
|
||||
(let [class-sym (symbol (.getName interface))
|
||||
method-names (distinct (map :name methods))]
|
||||
{:name (symbol (str "babashka.impl." (.getName interface)))
|
||||
:version 1.8
|
||||
:interfaces [class-sym
|
||||
'sci.impl.types.IReified
|
||||
'clojure.lang.IMeta
|
||||
'clojure.lang.IObj]
|
||||
:flags [:super :public]
|
||||
:fields (into [{:flags #{:private},
|
||||
:name "_methods" :type java.util.Map}
|
||||
{:flags #{:private},
|
||||
:name "_interfaces" :type Object}
|
||||
{:flags #{:private},
|
||||
:name "_protocols" :type Object}
|
||||
{:flags #{:private},
|
||||
:name "_meta" :type clojure.lang.IPersistentMap}]
|
||||
(for [name method-names]
|
||||
{:flags #{:private :static},
|
||||
:name (str "_sym_" name) :type clojure.lang.Symbol}))
|
||||
:methods (into [{:name :clinit
|
||||
:emit (reduce into
|
||||
[]
|
||||
(conj
|
||||
(mapv set-symbol! method-names)
|
||||
[[:return]]))}
|
||||
{:name :init
|
||||
:desc [:void]
|
||||
:emit [[:aload 0]
|
||||
[:invokespecial :super :init [:void]]
|
||||
[:return]]}
|
||||
{:name :init
|
||||
:desc [java.util.Map Object Object :void]
|
||||
:emit [[:aload 0]
|
||||
[:invokespecial :super :init [:void]]
|
||||
[:aload 0]
|
||||
[:aload 1]
|
||||
[:putfield :this "_methods" java.util.Map]
|
||||
[:aload 0]
|
||||
[:aload 2]
|
||||
[:putfield :this "_interfaces" Object]
|
||||
[:aload 0]
|
||||
[:aload 3]
|
||||
[:putfield :this "_protocols" Object]
|
||||
[:return]]}
|
||||
{:name :meta
|
||||
:desc [clojure.lang.IPersistentMap]
|
||||
:emit [[:aload 0]
|
||||
[:getfield :this "_meta" clojure.lang.IPersistentMap]
|
||||
[:areturn]]}
|
||||
{:name :withMeta
|
||||
:desc [clojure.lang.IPersistentMap clojure.lang.IObj]
|
||||
:emit [[:aload 0]
|
||||
[:aload 1]
|
||||
[:putfield :this "_meta" clojure.lang.IPersistentMap]
|
||||
[:aload 0]
|
||||
[:areturn]]}
|
||||
{:name :getInterfaces
|
||||
:desc [Object]
|
||||
:emit [[:aload 0]
|
||||
[:getfield :this "_interfaces" Object]
|
||||
[:areturn]]}
|
||||
{:name :getMethods
|
||||
:desc [Object]
|
||||
:emit [[:aload 0]
|
||||
[:getfield :this "_methods" java.util.Map]
|
||||
[:areturn]]}
|
||||
{:name :getProtocols
|
||||
:desc [Object]
|
||||
:emit [[:aload 0]
|
||||
[:getfield :this "_protocols" Object]
|
||||
[:areturn]]}]
|
||||
(for [{:keys [name desc default]} methods]
|
||||
{:flags #{:public}, :name name
|
||||
:desc desc
|
||||
:emit (emit-method interface name desc default)}
|
||||
))}))
|
||||
|
||||
(set! *warn-on-reflection* true)
|
||||
|
||||
(defn type->kw [type]
|
||||
(condp = type
|
||||
Void/TYPE :void
|
||||
Boolean/TYPE :boolean
|
||||
Integer/TYPE :int
|
||||
type))
|
||||
|
||||
(defn class->methods [^Class clazz]
|
||||
(let [meths (.getMethods clazz)
|
||||
meths (mapv bean meths)
|
||||
;; TODO: fix problems with clojure.lang.IFn, special cased for now
|
||||
;; The problem is that the 20-arity (highest one) could not be reified
|
||||
;; meths (filter #(<= (:parameterCount %) 19) meths)
|
||||
meths (mapv (fn [{:keys [name
|
||||
parameterTypes
|
||||
returnType
|
||||
default]}]
|
||||
(let [ret-type (type->kw returnType)]
|
||||
{:name name
|
||||
:desc (conj (mapv type->kw parameterTypes) ret-type)
|
||||
:default default}))
|
||||
meths)]
|
||||
(distinct meths)))
|
||||
|
||||
(let [i clojure.lang.IFn]
|
||||
(insn/define (insn/visit (interface-data i (class->methods i)))))
|
||||
|
||||
(def reified (babashka.impl.clojure.lang.IFn. {'invoke (fn [& _args] :yep)} {} {}))
|
||||
|
||||
(defn gen-classes [_]
|
||||
(doseq [i interfaces]
|
||||
(insn/write (doto (insn/visit (interface-data i (class->methods i)))
|
||||
insn/define) "target/classes")))
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue