-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathgrammars.bzl
More file actions
73 lines (65 loc) · 2.56 KB
/
Copy pathgrammars.bzl
File metadata and controls
73 lines (65 loc) · 2.56 KB
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
"""
Fetches and compiles tree-sitter grammars.
"""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Most tree-sitter languages have a simple source structure like this.
BUILD = """\
filegroup(
name = "srcs",
srcs = glob(["src/**/*.c", "src/**/*.h"]),
visibility = ["//visibility:public"],
)
"""
# buildifier: disable=function-docstring
def fetch_grammars():
http_archive(
name = "tree-sitter-go",
integrity = "sha256-M7w7RN4de4FfUv6fQuSXhsWDPZGB/Vn9aRDBnIJVkik=",
urls = ["https://github.com/tree-sitter/tree-sitter-go/releases/download/v0.23.4/tree-sitter-go.tar.xz"],
build_file_content = BUILD,
)
http_archive(
name = "tree-sitter-java",
sha256 = "ed766e1045be236e50a7f99295996f6705d7506628b79af80d1fd5efb63c86a7",
urls = ["https://github.com/tree-sitter/tree-sitter-java/releases/download/v0.23.5/tree-sitter-java.tar.xz"],
build_file_content = BUILD,
)
http_archive(
name = "tree-sitter-json",
sha256 = "acf6e8362457e819ed8b613f2ad9a0e1b621a77556c296f3abea58f7880a9213",
strip_prefix = "tree-sitter-json-0.24.8",
urls = ["https://github.com/tree-sitter/tree-sitter-json/archive/v0.24.8.tar.gz"],
build_file_content = BUILD,
)
http_archive(
name = "tree-sitter-kotlin",
sha256 = "7dd60975786bf9cb4be6a5176f5ccb5fed505f9929a012da30762505b1015669",
strip_prefix = "tree-sitter-kotlin-0.3.8",
urls = ["https://github.com/fwcd/tree-sitter-kotlin/archive/0.3.8.tar.gz"],
build_file_content = BUILD,
)
http_archive(
name = "tree-sitter-starlark",
sha256 = "31c58a540d738a17b366f2046da298b66dfa0695bcbfa207f61fa63cfe5c03ed",
strip_prefix = "tree-sitter-starlark-1.3.0",
urls = ["https://github.com/tree-sitter-grammars/tree-sitter-starlark/archive/v1.3.0.tar.gz"],
build_file_content = BUILD,
)
http_archive(
name = "tree-sitter-typescript",
sha256 = "2c4ce711ae8d1218a3b2f899189298159d672870b5b34dff5d937bed2f3e8983",
strip_prefix = "tree-sitter-typescript-0.23.2",
urls = ["https://github.com/tree-sitter/tree-sitter-typescript/archive/v0.23.2.tar.gz"],
build_file_content = """
filegroup(
name = "typescript-srcs",
srcs = glob(["common/**/*.h", "typescript/src/**/*.h", "typescript/src/**/*.c"]),
visibility = ["//visibility:public"],
)
filegroup(
name = "tsx-srcs",
srcs = glob(["common/**/*.h", "tsx/src/**/*.h", "tsx/src/**/*.c"]),
visibility = ["//visibility:public"],
)
""",
)