mirror of
https://github.com/github/semantic.git
synced 2024-11-22 23:29:37 +03:00
this is a better name too
This commit is contained in:
parent
3a4be1998a
commit
21c3b2b599
18
WORKSPACE
18
WORKSPACE
@ -154,47 +154,47 @@ haskell_cabal_binary(name = "happy", srcs = glob(["**"]), visibility = ["//visib
|
||||
|
||||
load(
|
||||
"//:build/common.bzl",
|
||||
"tree_sitter_node_types_archive",
|
||||
"tree_sitter_node_types_git",
|
||||
"tree_sitter_node_types_release",
|
||||
)
|
||||
|
||||
tree_sitter_node_types_archive(
|
||||
tree_sitter_node_types_release(
|
||||
name = "tree-sitter-python",
|
||||
sha256 = "50d3fa560391dc4ab8d9a3466f68f2c6a4c12f9cc6421358d2c307023bd740ab",
|
||||
version = "0.16.0",
|
||||
)
|
||||
|
||||
tree_sitter_node_types_archive(
|
||||
tree_sitter_node_types_release(
|
||||
name = "tree-sitter-php",
|
||||
sha256 = "d7f6b7dbba359f5129f08647ad4cf73a599abdec443c2b0e2cdbbaee56cf3750",
|
||||
version = "0.16.1",
|
||||
)
|
||||
|
||||
tree_sitter_node_types_archive(
|
||||
tree_sitter_node_types_release(
|
||||
name = "tree-sitter-java",
|
||||
sha256 = "41af0051be7f9cfb2b85aece37979d1097fddf538b8984fb7726bf1edea4a7ce",
|
||||
version = "0.16.0",
|
||||
)
|
||||
|
||||
tree_sitter_node_types_archive(
|
||||
tree_sitter_node_types_release(
|
||||
name = "tree-sitter-json",
|
||||
sha256 = "cbf0fefd2825a2db1770013111f49ec609c4fe090a8909e9780458629c22d1f4",
|
||||
version = "0.16.0",
|
||||
)
|
||||
|
||||
tree_sitter_node_types_archive(
|
||||
tree_sitter_node_types_release(
|
||||
name = "tree-sitter-rust",
|
||||
sha256 = "8c34f19a9270ee60367ee235226ff1108341f944e0bd245cb47e1c2721f0c39b",
|
||||
version = "0.16.1",
|
||||
)
|
||||
|
||||
tree_sitter_node_types_archive(
|
||||
tree_sitter_node_types_release(
|
||||
name = "tree-sitter-go",
|
||||
sha256 = "7278f1fd4dc4de8a13b0f60407425d38c5cb3973e1938d3031a68e1e69bd0b75",
|
||||
version = "0.16.1",
|
||||
)
|
||||
|
||||
tree_sitter_node_types_archive(
|
||||
tree_sitter_node_types_release(
|
||||
name = "tree-sitter-typescript",
|
||||
nodetypespath = "**/src/node-types.json",
|
||||
sha256 = "3e1fc16daab965f21dc56a919b32a730e889ea2ba1330af5edc5950f4e6b18b6",
|
||||
@ -213,7 +213,7 @@ git_repository(
|
||||
# These packages use node_types_git because they correspond to Hackage
|
||||
# tree-sitter-* parsers vendored not to a release of their C parser,
|
||||
# but to a given Git SHA. This works, but is a little specious, so we
|
||||
# should move these into node_types_archive calls and fix the problems
|
||||
# should move these into node_types_release calls and fix the problems
|
||||
# that emerge when we target version releases.
|
||||
|
||||
tree_sitter_node_types_git(
|
||||
|
@ -49,7 +49,7 @@ EXECUTABLE_FLAGS = [
|
||||
|
||||
# These macros declare new packages.
|
||||
|
||||
def tree_sitter_node_types_archive(name, version, sha256, urls = [], nodetypespath = "src/node-types.json"):
|
||||
def tree_sitter_node_types_release(name, version, sha256, urls = [], nodetypespath = "src/node-types.json"):
|
||||
"""Create a package for a tree-sitter grammar and export its node-types.json file/test corpus.."""
|
||||
http_archive(
|
||||
name = name,
|
||||
@ -66,7 +66,7 @@ filegroup(name = "corpus", srcs = glob(['**/corpus/*.txt']))
|
||||
)
|
||||
|
||||
def tree_sitter_node_types_git(name, commit, shallow_since):
|
||||
"""Create a package pinned off a Git repo. Prefer the node_types_archive call to this."""
|
||||
"""Create a package pinned off a Git repo. Prefer the node_types_release call to this."""
|
||||
new_git_repository(
|
||||
name = name,
|
||||
build_file_content = """
|
||||
|
@ -62,7 +62,7 @@ The variables that the scripts under `build/` export are SCREAMING_SNAKE_CASE. T
|
||||
|
||||
## Custom rules
|
||||
|
||||
We have two common custom rules, defined in `build/common.bzl`. The first, `tree_sitter_node_types_archive`, uses the `http_archive` rule to download a specified tree-sitter grammar's `node-types.json` file. These calls declare new top-level targets, so they're only present in the top-level `WORKSPACE` file. The second, `semantic_language_library`, takes care of the boilerplate associated with declaring a target for a `semantic-LANG` language package (as these packages' contents are identical, their target declarations are almost identical).
|
||||
We have two common custom rules, defined in `build/common.bzl`. The first, `tree_sitter_node_types_release`, uses the `http_archive` rule to download a specified tree-sitter grammar's `node-types.json` file. These calls declare new top-level targets, so they're only present in the top-level `WORKSPACE` file. The second, `semantic_language_library`, takes care of the boilerplate associated with declaring a target for a `semantic-LANG` language package (as these packages' contents are identical, their target declarations are almost identical).
|
||||
|
||||
For the purposes of setting up the examples upon which the `parse-examples` test depends, we have code in `build/example_repos.bzl` which defines them, checks them out, and computes the set of target names. You shouldn't need to change or modify this, unless you're adding new repos.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user