mirror of
https://github.com/github/semantic.git
synced 2025-01-07 16:07:28 +03:00
Create a macro to define language packages quickly.
This commit is contained in:
parent
2da2f61f1e
commit
cac967e87f
@ -1,5 +1,12 @@
|
|||||||
# This file lets us share warnings and such across the project
|
# This file lets us share warnings and such across the project
|
||||||
|
|
||||||
|
load(
|
||||||
|
"@rules_haskell//haskell:defs.bzl",
|
||||||
|
"haskell_library",
|
||||||
|
"haskell_test",
|
||||||
|
"haskell_toolchain_library",
|
||||||
|
)
|
||||||
|
|
||||||
STANDARD_GHC_WARNINGS = [
|
STANDARD_GHC_WARNINGS = [
|
||||||
"-O0",
|
"-O0",
|
||||||
"-v1",
|
"-v1",
|
||||||
@ -23,3 +30,36 @@ STANDARD_GHC_WARNINGS = [
|
|||||||
STANDARD_EXECUTABLE_FLAGS = [
|
STANDARD_EXECUTABLE_FLAGS = [
|
||||||
"-threaded",
|
"-threaded",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def semantic_language_library(language, name, srcs, **kwargs):
|
||||||
|
haskell_library(
|
||||||
|
name = name,
|
||||||
|
compiler_flags = STANDARD_GHC_WARNINGS,
|
||||||
|
srcs = srcs,
|
||||||
|
extra_srcs = ["//vendor:" + language + "-node-types.json"],
|
||||||
|
deps = [
|
||||||
|
":base",
|
||||||
|
"//semantic-analysis:lib",
|
||||||
|
"//semantic-ast:lib",
|
||||||
|
"//semantic-core:lib",
|
||||||
|
"//semantic-proto:lib",
|
||||||
|
"//semantic-scope-graph:lib",
|
||||||
|
"//semantic-source:lib",
|
||||||
|
"//semantic-tags:lib",
|
||||||
|
"@stackage//:aeson",
|
||||||
|
"@stackage//:algebraic-graphs",
|
||||||
|
"@stackage//:containers",
|
||||||
|
"@stackage//:fused-effects",
|
||||||
|
"@stackage//:fused-syntax",
|
||||||
|
"@stackage//:generic-lens",
|
||||||
|
"@stackage//:generic-monoid",
|
||||||
|
"@stackage//:hashable",
|
||||||
|
"@stackage//:lens",
|
||||||
|
"@stackage//:pathtype",
|
||||||
|
"@stackage//:semilattices",
|
||||||
|
"@stackage//:template-haskell",
|
||||||
|
"@stackage//:text",
|
||||||
|
"@stackage//:tree-sitter",
|
||||||
|
"@stackage//:tree-sitter-" + language,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
@ -23,7 +23,7 @@ load(
|
|||||||
# can be referenced as dependencies.
|
# can be referenced as dependencies.
|
||||||
haskell_toolchain_library(name = "base")
|
haskell_toolchain_library(name = "base")
|
||||||
|
|
||||||
# You can add your own libraries with haskell_library.
|
# Not using semantic_language_library because of naming irregularities
|
||||||
haskell_library(
|
haskell_library(
|
||||||
name = "lib",
|
name = "lib",
|
||||||
srcs = glob(["src/**/*.hs"]),
|
srcs = glob(["src/**/*.hs"]),
|
||||||
|
@ -15,7 +15,7 @@ load(
|
|||||||
)
|
)
|
||||||
load(
|
load(
|
||||||
"//:build/common.bzl",
|
"//:build/common.bzl",
|
||||||
"STANDARD_GHC_WARNINGS",
|
"semantic_language_library",
|
||||||
)
|
)
|
||||||
|
|
||||||
# haskell_toolchain_library can access builtin GHC packages
|
# haskell_toolchain_library can access builtin GHC packages
|
||||||
@ -23,35 +23,8 @@ load(
|
|||||||
# can be referenced as dependencies.
|
# can be referenced as dependencies.
|
||||||
haskell_toolchain_library(name = "base")
|
haskell_toolchain_library(name = "base")
|
||||||
|
|
||||||
# You can add your own libraries with haskell_library.
|
semantic_language_library(
|
||||||
haskell_library(
|
|
||||||
name = "lib",
|
name = "lib",
|
||||||
srcs = glob(["src/**/*.hs"]),
|
srcs = glob(["src/**/*.hs"]),
|
||||||
compiler_flags = STANDARD_GHC_WARNINGS,
|
language = "go",
|
||||||
extra_srcs = ["//vendor:go-node-types.json"],
|
|
||||||
deps = [
|
|
||||||
":base",
|
|
||||||
"//semantic-analysis:lib",
|
|
||||||
"//semantic-ast:lib",
|
|
||||||
"//semantic-core:lib",
|
|
||||||
"//semantic-proto:lib",
|
|
||||||
"//semantic-scope-graph:lib",
|
|
||||||
"//semantic-source:lib",
|
|
||||||
"//semantic-tags:lib",
|
|
||||||
"@stackage//:aeson",
|
|
||||||
"@stackage//:algebraic-graphs",
|
|
||||||
"@stackage//:containers",
|
|
||||||
"@stackage//:fused-effects",
|
|
||||||
"@stackage//:fused-syntax",
|
|
||||||
"@stackage//:generic-lens",
|
|
||||||
"@stackage//:generic-monoid",
|
|
||||||
"@stackage//:hashable",
|
|
||||||
"@stackage//:lens",
|
|
||||||
"@stackage//:pathtype",
|
|
||||||
"@stackage//:semilattices",
|
|
||||||
"@stackage//:template-haskell",
|
|
||||||
"@stackage//:text",
|
|
||||||
"@stackage//:tree-sitter",
|
|
||||||
"@stackage//:tree-sitter-go",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
@ -15,7 +15,7 @@ load(
|
|||||||
)
|
)
|
||||||
load(
|
load(
|
||||||
"//:build/common.bzl",
|
"//:build/common.bzl",
|
||||||
"STANDARD_GHC_WARNINGS",
|
"semantic_language_library",
|
||||||
)
|
)
|
||||||
|
|
||||||
# haskell_toolchain_library can access builtin GHC packages
|
# haskell_toolchain_library can access builtin GHC packages
|
||||||
@ -23,35 +23,8 @@ load(
|
|||||||
# can be referenced as dependencies.
|
# can be referenced as dependencies.
|
||||||
haskell_toolchain_library(name = "base")
|
haskell_toolchain_library(name = "base")
|
||||||
|
|
||||||
# You can add your own libraries with haskell_library.
|
semantic_language_library(
|
||||||
haskell_library(
|
|
||||||
name = "lib",
|
name = "lib",
|
||||||
srcs = glob(["src/**/*.hs"]),
|
srcs = glob(["src/**/*.hs"]),
|
||||||
compiler_flags = STANDARD_GHC_WARNINGS,
|
language = "java",
|
||||||
extra_srcs = ["//vendor:java-node-types.json"],
|
|
||||||
deps = [
|
|
||||||
":base",
|
|
||||||
"//semantic-analysis:lib",
|
|
||||||
"//semantic-ast:lib",
|
|
||||||
"//semantic-core:lib",
|
|
||||||
"//semantic-proto:lib",
|
|
||||||
"//semantic-scope-graph:lib",
|
|
||||||
"//semantic-source:lib",
|
|
||||||
"//semantic-tags:lib",
|
|
||||||
"@stackage//:aeson",
|
|
||||||
"@stackage//:algebraic-graphs",
|
|
||||||
"@stackage//:containers",
|
|
||||||
"@stackage//:fused-effects",
|
|
||||||
"@stackage//:fused-syntax",
|
|
||||||
"@stackage//:generic-lens",
|
|
||||||
"@stackage//:generic-monoid",
|
|
||||||
"@stackage//:hashable",
|
|
||||||
"@stackage//:lens",
|
|
||||||
"@stackage//:pathtype",
|
|
||||||
"@stackage//:semilattices",
|
|
||||||
"@stackage//:template-haskell",
|
|
||||||
"@stackage//:text",
|
|
||||||
"@stackage//:tree-sitter",
|
|
||||||
"@stackage//:tree-sitter-java",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
@ -13,40 +13,18 @@ load(
|
|||||||
"haskell_cabal_binary",
|
"haskell_cabal_binary",
|
||||||
"haskell_cabal_library",
|
"haskell_cabal_library",
|
||||||
)
|
)
|
||||||
|
load(
|
||||||
|
"//:build/common.bzl",
|
||||||
|
"semantic_language_library",
|
||||||
|
)
|
||||||
|
|
||||||
# haskell_toolchain_library can access builtin GHC packages
|
# haskell_toolchain_library can access builtin GHC packages
|
||||||
# and assign them a bazel target name, so that they
|
# and assign them a bazel target name, so that they
|
||||||
# can be referenced as dependencies.
|
# can be referenced as dependencies.
|
||||||
haskell_toolchain_library(name = "base")
|
haskell_toolchain_library(name = "base")
|
||||||
|
|
||||||
# You can add your own libraries with haskell_library.
|
semantic_language_library(
|
||||||
haskell_library(
|
|
||||||
name = "lib",
|
name = "lib",
|
||||||
srcs = glob(["src/**/*.hs"]),
|
srcs = glob(["src/**/*.hs"]),
|
||||||
extra_srcs = ["//vendor:json-node-types.json"],
|
language = "json",
|
||||||
deps = [
|
|
||||||
":base",
|
|
||||||
"//semantic-analysis:lib",
|
|
||||||
"//semantic-ast:lib",
|
|
||||||
"//semantic-core:lib",
|
|
||||||
"//semantic-proto:lib",
|
|
||||||
"//semantic-scope-graph:lib",
|
|
||||||
"//semantic-source:lib",
|
|
||||||
"//semantic-tags:lib",
|
|
||||||
"@stackage//:aeson",
|
|
||||||
"@stackage//:algebraic-graphs",
|
|
||||||
"@stackage//:containers",
|
|
||||||
"@stackage//:fused-effects",
|
|
||||||
"@stackage//:fused-syntax",
|
|
||||||
"@stackage//:generic-lens",
|
|
||||||
"@stackage//:generic-monoid",
|
|
||||||
"@stackage//:hashable",
|
|
||||||
"@stackage//:lens",
|
|
||||||
"@stackage//:pathtype",
|
|
||||||
"@stackage//:semilattices",
|
|
||||||
"@stackage//:template-haskell",
|
|
||||||
"@stackage//:text",
|
|
||||||
"@stackage//:tree-sitter",
|
|
||||||
"@stackage//:tree-sitter-json",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
@ -4,18 +4,11 @@ package(default_visibility = ["//visibility:public"])
|
|||||||
# Load rules_haskell rules.
|
# Load rules_haskell rules.
|
||||||
load(
|
load(
|
||||||
"@rules_haskell//haskell:defs.bzl",
|
"@rules_haskell//haskell:defs.bzl",
|
||||||
"haskell_binary",
|
|
||||||
"haskell_library",
|
|
||||||
"haskell_toolchain_library",
|
"haskell_toolchain_library",
|
||||||
)
|
)
|
||||||
load(
|
|
||||||
"@rules_haskell//haskell:cabal.bzl",
|
|
||||||
"haskell_cabal_binary",
|
|
||||||
"haskell_cabal_library",
|
|
||||||
)
|
|
||||||
load(
|
load(
|
||||||
"//:build/common.bzl",
|
"//:build/common.bzl",
|
||||||
"STANDARD_GHC_WARNINGS",
|
"semantic_language_library",
|
||||||
)
|
)
|
||||||
|
|
||||||
# haskell_toolchain_library can access builtin GHC packages
|
# haskell_toolchain_library can access builtin GHC packages
|
||||||
@ -23,35 +16,8 @@ load(
|
|||||||
# can be referenced as dependencies.
|
# can be referenced as dependencies.
|
||||||
haskell_toolchain_library(name = "base")
|
haskell_toolchain_library(name = "base")
|
||||||
|
|
||||||
# You can add your own libraries with haskell_library.
|
semantic_language_library(
|
||||||
haskell_library(
|
|
||||||
name = "lib",
|
name = "lib",
|
||||||
srcs = glob(["src/**/*.hs"]),
|
srcs = glob(["src/**/*.hs"]),
|
||||||
compiler_flags = STANDARD_GHC_WARNINGS,
|
language = "php",
|
||||||
extra_srcs = ["//vendor:php-node-types.json"],
|
|
||||||
deps = [
|
|
||||||
":base",
|
|
||||||
"//semantic-analysis:lib",
|
|
||||||
"//semantic-ast:lib",
|
|
||||||
"//semantic-core:lib",
|
|
||||||
"//semantic-proto:lib",
|
|
||||||
"//semantic-scope-graph:lib",
|
|
||||||
"//semantic-source:lib",
|
|
||||||
"//semantic-tags:lib",
|
|
||||||
"@stackage//:aeson",
|
|
||||||
"@stackage//:algebraic-graphs",
|
|
||||||
"@stackage//:containers",
|
|
||||||
"@stackage//:fused-effects",
|
|
||||||
"@stackage//:fused-syntax",
|
|
||||||
"@stackage//:generic-lens",
|
|
||||||
"@stackage//:generic-monoid",
|
|
||||||
"@stackage//:hashable",
|
|
||||||
"@stackage//:lens",
|
|
||||||
"@stackage//:pathtype",
|
|
||||||
"@stackage//:semilattices",
|
|
||||||
"@stackage//:template-haskell",
|
|
||||||
"@stackage//:text",
|
|
||||||
"@stackage//:tree-sitter",
|
|
||||||
"@stackage//:tree-sitter-php",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
@ -4,18 +4,11 @@ package(default_visibility = ["//visibility:public"])
|
|||||||
# Load rules_haskell rules.
|
# Load rules_haskell rules.
|
||||||
load(
|
load(
|
||||||
"@rules_haskell//haskell:defs.bzl",
|
"@rules_haskell//haskell:defs.bzl",
|
||||||
"haskell_binary",
|
|
||||||
"haskell_library",
|
|
||||||
"haskell_toolchain_library",
|
"haskell_toolchain_library",
|
||||||
)
|
)
|
||||||
load(
|
|
||||||
"@rules_haskell//haskell:cabal.bzl",
|
|
||||||
"haskell_cabal_binary",
|
|
||||||
"haskell_cabal_library",
|
|
||||||
)
|
|
||||||
load(
|
load(
|
||||||
"//:build/common.bzl",
|
"//:build/common.bzl",
|
||||||
"STANDARD_GHC_WARNINGS",
|
"semantic_language_library",
|
||||||
)
|
)
|
||||||
|
|
||||||
# haskell_toolchain_library can access builtin GHC packages
|
# haskell_toolchain_library can access builtin GHC packages
|
||||||
@ -23,8 +16,7 @@ load(
|
|||||||
# can be referenced as dependencies.
|
# can be referenced as dependencies.
|
||||||
haskell_toolchain_library(name = "base")
|
haskell_toolchain_library(name = "base")
|
||||||
|
|
||||||
# You can add your own libraries with haskell_library.
|
semantic_language_library(
|
||||||
haskell_library(
|
|
||||||
name = "lib",
|
name = "lib",
|
||||||
srcs = glob(
|
srcs = glob(
|
||||||
include = ["src/**/*.hs"],
|
include = ["src/**/*.hs"],
|
||||||
@ -33,31 +25,5 @@ haskell_library(
|
|||||||
"src/Language/Python/ScopeGraph.hs",
|
"src/Language/Python/ScopeGraph.hs",
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
compiler_flags = STANDARD_GHC_WARNINGS,
|
language = "python",
|
||||||
extra_srcs = ["//vendor:python-node-types.json"],
|
|
||||||
deps = [
|
|
||||||
":base",
|
|
||||||
"//semantic-analysis:lib",
|
|
||||||
"//semantic-ast:lib",
|
|
||||||
"//semantic-core:lib",
|
|
||||||
"//semantic-proto:lib",
|
|
||||||
"//semantic-scope-graph:lib",
|
|
||||||
"//semantic-source:lib",
|
|
||||||
"//semantic-tags:lib",
|
|
||||||
"@stackage//:aeson",
|
|
||||||
"@stackage//:algebraic-graphs",
|
|
||||||
"@stackage//:containers",
|
|
||||||
"@stackage//:fused-effects",
|
|
||||||
"@stackage//:fused-syntax",
|
|
||||||
"@stackage//:generic-lens",
|
|
||||||
"@stackage//:generic-monoid",
|
|
||||||
"@stackage//:hashable",
|
|
||||||
"@stackage//:lens",
|
|
||||||
"@stackage//:pathtype",
|
|
||||||
"@stackage//:semilattices",
|
|
||||||
"@stackage//:template-haskell",
|
|
||||||
"@stackage//:text",
|
|
||||||
"@stackage//:tree-sitter",
|
|
||||||
"@stackage//:tree-sitter-python",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
@ -4,18 +4,11 @@ package(default_visibility = ["//visibility:public"])
|
|||||||
# Load rules_haskell rules.
|
# Load rules_haskell rules.
|
||||||
load(
|
load(
|
||||||
"@rules_haskell//haskell:defs.bzl",
|
"@rules_haskell//haskell:defs.bzl",
|
||||||
"haskell_binary",
|
|
||||||
"haskell_library",
|
|
||||||
"haskell_toolchain_library",
|
"haskell_toolchain_library",
|
||||||
)
|
)
|
||||||
load(
|
|
||||||
"@rules_haskell//haskell:cabal.bzl",
|
|
||||||
"haskell_cabal_binary",
|
|
||||||
"haskell_cabal_library",
|
|
||||||
)
|
|
||||||
load(
|
load(
|
||||||
"//:build/common.bzl",
|
"//:build/common.bzl",
|
||||||
"STANDARD_GHC_WARNINGS",
|
"semantic_language_library",
|
||||||
)
|
)
|
||||||
|
|
||||||
# haskell_toolchain_library can access builtin GHC packages
|
# haskell_toolchain_library can access builtin GHC packages
|
||||||
@ -23,35 +16,8 @@ load(
|
|||||||
# can be referenced as dependencies.
|
# can be referenced as dependencies.
|
||||||
haskell_toolchain_library(name = "base")
|
haskell_toolchain_library(name = "base")
|
||||||
|
|
||||||
# You can add your own libraries with haskell_library.
|
semantic_language_library(
|
||||||
haskell_library(
|
|
||||||
name = "lib",
|
name = "lib",
|
||||||
srcs = glob(["src/**/*.hs"]),
|
srcs = glob(["src/**/*.hs"]),
|
||||||
compiler_flags = STANDARD_GHC_WARNINGS,
|
language = "ruby",
|
||||||
extra_srcs = ["//vendor:ruby-node-types.json"],
|
|
||||||
deps = [
|
|
||||||
":base",
|
|
||||||
"//semantic-analysis:lib",
|
|
||||||
"//semantic-ast:lib",
|
|
||||||
"//semantic-core:lib",
|
|
||||||
"//semantic-proto:lib",
|
|
||||||
"//semantic-scope-graph:lib",
|
|
||||||
"//semantic-source:lib",
|
|
||||||
"//semantic-tags:lib",
|
|
||||||
"@stackage//:aeson",
|
|
||||||
"@stackage//:algebraic-graphs",
|
|
||||||
"@stackage//:containers",
|
|
||||||
"@stackage//:fused-effects",
|
|
||||||
"@stackage//:fused-syntax",
|
|
||||||
"@stackage//:generic-lens",
|
|
||||||
"@stackage//:generic-monoid",
|
|
||||||
"@stackage//:hashable",
|
|
||||||
"@stackage//:lens",
|
|
||||||
"@stackage//:pathtype",
|
|
||||||
"@stackage//:semilattices",
|
|
||||||
"@stackage//:template-haskell",
|
|
||||||
"@stackage//:text",
|
|
||||||
"@stackage//:tree-sitter",
|
|
||||||
"@stackage//:tree-sitter-ruby",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
@ -4,18 +4,11 @@ package(default_visibility = ["//visibility:public"])
|
|||||||
# Load rules_haskell rules.
|
# Load rules_haskell rules.
|
||||||
load(
|
load(
|
||||||
"@rules_haskell//haskell:defs.bzl",
|
"@rules_haskell//haskell:defs.bzl",
|
||||||
"haskell_binary",
|
|
||||||
"haskell_library",
|
|
||||||
"haskell_toolchain_library",
|
"haskell_toolchain_library",
|
||||||
)
|
)
|
||||||
load(
|
|
||||||
"@rules_haskell//haskell:cabal.bzl",
|
|
||||||
"haskell_cabal_binary",
|
|
||||||
"haskell_cabal_library",
|
|
||||||
)
|
|
||||||
load(
|
load(
|
||||||
"//:build/common.bzl",
|
"//:build/common.bzl",
|
||||||
"STANDARD_GHC_WARNINGS",
|
"semantic_language_library",
|
||||||
)
|
)
|
||||||
|
|
||||||
# haskell_toolchain_library can access builtin GHC packages
|
# haskell_toolchain_library can access builtin GHC packages
|
||||||
@ -23,35 +16,8 @@ load(
|
|||||||
# can be referenced as dependencies.
|
# can be referenced as dependencies.
|
||||||
haskell_toolchain_library(name = "base")
|
haskell_toolchain_library(name = "base")
|
||||||
|
|
||||||
# You can add your own libraries with haskell_library.
|
semantic_language_library(
|
||||||
haskell_library(
|
|
||||||
name = "lib",
|
name = "lib",
|
||||||
srcs = glob(["src/**/*.hs"]),
|
srcs = glob(["src/**/*.hs"]),
|
||||||
compiler_flags = STANDARD_GHC_WARNINGS,
|
language = "tsx",
|
||||||
extra_srcs = ["//vendor:tsx-node-types.json"],
|
|
||||||
deps = [
|
|
||||||
":base",
|
|
||||||
"//semantic-analysis:lib",
|
|
||||||
"//semantic-ast:lib",
|
|
||||||
"//semantic-core:lib",
|
|
||||||
"//semantic-proto:lib",
|
|
||||||
"//semantic-scope-graph:lib",
|
|
||||||
"//semantic-source:lib",
|
|
||||||
"//semantic-tags:lib",
|
|
||||||
"@stackage//:aeson",
|
|
||||||
"@stackage//:algebraic-graphs",
|
|
||||||
"@stackage//:containers",
|
|
||||||
"@stackage//:fused-effects",
|
|
||||||
"@stackage//:fused-syntax",
|
|
||||||
"@stackage//:generic-lens",
|
|
||||||
"@stackage//:generic-monoid",
|
|
||||||
"@stackage//:hashable",
|
|
||||||
"@stackage//:lens",
|
|
||||||
"@stackage//:pathtype",
|
|
||||||
"@stackage//:semilattices",
|
|
||||||
"@stackage//:template-haskell",
|
|
||||||
"@stackage//:text",
|
|
||||||
"@stackage//:tree-sitter",
|
|
||||||
"@stackage//:tree-sitter-tsx",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user