forked from emacs-tree-sitter/elisp-tree-sitter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevshell.toml
99 lines (91 loc) · 2.53 KB
/
devshell.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
[[commands]]
name = "setup"
category = "installation"
command = '''
git submodule update --init
$PRJ_ROOT/bin/build
$PRJ_ROOT/bin/ensure-lang rust
$PRJ_ROOT/bin/test
'''
[[commands]]
name = "cask-build"
category = "installtion"
command = '''
cask install && cask build
cask --path langs install && cask --path langs build
'''
help = "run build shell of emacs-tree-sitter"
[[commands]]
name = "ets-build"
category = "installtion"
command = "$PRJ_ROOT/bin/build"
help = "run build shell of emacs-tree-sitter"
[[commands]]
name = "ets-test"
category = "tests"
command = "$PRJ_ROOT/bin/test"
help = "run build shell of emacs-tree-sitter"
[[commands]]
name = "ets-compile"
category = "lang"
command = '''
cd $PRJ_ROOT/langs
script/compile $@
'''
help = "etc compile <julia>"
[[commands]]
name = "lang-test"
category = "tests"
command = '''
cd $PRJ_ROOT/langs/repos/$@
bash script/parse-examples
'''
help = "test lang parsing | lang-test <rust>"
[[commands]]
name = "lang-add"
category = "lang"
command = '''
cd $PRJ_ROOT/langs
target=${1:-release}
case $target in
(nix)
git submodule add -b master -- https://github.com/cstrahan/tree-sitter-nix.git repos/$target || true
;;
(nickel)
git submodule add -b main -- https://github.com/milahu/tree-sitter-nickel.git repos/$target || true
;;
(haskell)
git submodule add -b master -- https://github.com/tree-sitter/tree-sitter-haskell repos/$target || true
;;
(elisp)
git submodule add -b main -- https://github.com/Wilfred/tree-sitter-elisp repos/$target || true
;;
(*)
echo "no submodule in repos for your lang"
exit 1
esac
cd repos/$target
git reset --hard
branch=$(cat $(git rev-parse --git-dir)/modules/repos/$target/refs/remotes/origin/HEAD | cut -d'/' -f4)
git fetch origin $branch&& git pull origin $branch
ets-compile $target
#fixup commands
case $target in
(elisp)
cd src
gcc ./parser.c -fPIC -I./ --shared -o $PRJ_ROOT/langs/bin/elisp.so
;;
esac
'''
help = "add extra langs support | lang-add <nix>"
[[commands]]
name = "lang-update"
category = "lang"
command = '''
branch=$(cat $(git rev-parse --git-dir)/modules/langs/modules/repos/$@/refs/remotes/origin/HEAD | cut -d'/' -f4)
cd $PRJ_ROOT/langs/repos/$@
git reset --hard
git fetch origin $branch && git pull origin $branch
ets-compile $@
'''
help = "update lang repo | lang-update <rust>"