mirror of
https://github.com/github/semantic.git
synced 2024-11-23 08:27:56 +03:00
174 lines
4.9 KiB
Python
174 lines
4.9 KiB
Python
# Set all target’s visibility in this package to "public".
|
||
package(default_visibility = ["//visibility:public"])
|
||
|
||
# Load rules_haskell rules.
|
||
load(
|
||
"@rules_haskell//haskell:defs.bzl",
|
||
"haskell_binary",
|
||
"haskell_library",
|
||
"haskell_test",
|
||
"haskell_toolchain_library",
|
||
)
|
||
load(
|
||
"@rules_haskell//haskell:cabal.bzl",
|
||
"haskell_cabal_binary",
|
||
"haskell_cabal_library",
|
||
)
|
||
load(
|
||
"//:build/common.bzl",
|
||
"STANDARD_GHC_WARNINGS",
|
||
)
|
||
|
||
# haskell_toolchain_library can access builtin GHC packages
|
||
# and assign them a bazel target name, so that they
|
||
# can be referenced as dependencies.
|
||
haskell_toolchain_library(name = "base")
|
||
|
||
haskell_toolchain_library(name = "ghc-prim")
|
||
|
||
semantic_common_dependencies = [
|
||
"//semantic-analysis:lib",
|
||
"//semantic-ast:lib",
|
||
"//semantic-source:lib",
|
||
"@stackage//:aeson",
|
||
"@stackage//:algebraic-graphs",
|
||
"@stackage//:async",
|
||
"@stackage//:bytestring",
|
||
"@stackage//:containers",
|
||
"@stackage//:directory",
|
||
"@stackage//:fastsum",
|
||
"@stackage//:fused-effects",
|
||
"@stackage//:fused-effects-exceptions",
|
||
"@stackage//:fused-effects-resumable",
|
||
"@stackage//:hashable",
|
||
"@stackage//:mtl",
|
||
"@stackage//:network",
|
||
"@stackage//:pathtype",
|
||
"@stackage//:process",
|
||
"@stackage//:recursion-schemes",
|
||
"@stackage//:safe-exceptions",
|
||
"@stackage//:scientific",
|
||
"@stackage//:semilattices",
|
||
"@stackage//:streaming",
|
||
"@stackage//:text",
|
||
"@stackage//:unix",
|
||
]
|
||
|
||
# You can add your own libraries with haskell_library.
|
||
haskell_library(
|
||
name = "lib",
|
||
srcs = glob(["src/**/*.hs"]),
|
||
compiler_flags = STANDARD_GHC_WARNINGS + ["-XStrictData"],
|
||
src_strip_prefix = "src",
|
||
deps = semantic_common_dependencies + [
|
||
":base",
|
||
":ghc-prim",
|
||
"//semantic-codeql:lib",
|
||
"//semantic-go:lib",
|
||
"//semantic-java:lib",
|
||
"//semantic-json:lib",
|
||
"//semantic-php:lib",
|
||
"//semantic-proto:lib",
|
||
"//semantic-python:lib",
|
||
"//semantic-ruby:lib",
|
||
"//semantic-scope-graph:lib",
|
||
"//semantic-tags:lib",
|
||
"//semantic-tsx:lib",
|
||
"//semantic-typescript:lib",
|
||
"@stackage//:ansi-terminal",
|
||
"@stackage//:array",
|
||
"@stackage//:attoparsec",
|
||
"@stackage//:bifunctors",
|
||
"@stackage//:deepseq",
|
||
"@stackage//:directory-tree",
|
||
"@stackage//:filepath",
|
||
"@stackage//:fused-syntax",
|
||
"@stackage//:generic-lens",
|
||
"@stackage//:generic-monoid",
|
||
"@stackage//:gitrev",
|
||
"@stackage//:haskeline",
|
||
"@stackage//:hostname",
|
||
"@stackage//:hscolour",
|
||
"@stackage//:kdt",
|
||
"@stackage//:lens",
|
||
"@stackage//:mersenne-random-pure64",
|
||
"@stackage//:network-uri",
|
||
"@stackage//:optparse-applicative",
|
||
"@stackage//:parallel",
|
||
"@stackage//:parsers",
|
||
"@stackage//:pretty-show",
|
||
"@stackage//:prettyprinter",
|
||
"@stackage//:profunctors",
|
||
"@stackage//:proto-lens",
|
||
"@stackage//:proto-lens-runtime",
|
||
"@stackage//:reducers",
|
||
"@stackage//:semigroupoids",
|
||
"@stackage//:split",
|
||
"@stackage//:stm-chans",
|
||
"@stackage//:template-haskell",
|
||
"@stackage//:time",
|
||
"@stackage//:tree-sitter",
|
||
"@stackage//:tree-sitter-tsx",
|
||
"@stackage//:unliftio-core",
|
||
"@stackage//:unordered-containers",
|
||
"@stackage//:vector",
|
||
],
|
||
)
|
||
|
||
haskell_binary(
|
||
name = "exe",
|
||
srcs = glob(["app/**/*.hs"]),
|
||
compiler_flags = STANDARD_GHC_WARNINGS + ["-XStrictData"],
|
||
src_strip_prefix = "app",
|
||
deps = [
|
||
":base",
|
||
"//semantic:lib",
|
||
],
|
||
)
|
||
|
||
haskell_test(
|
||
name = "spec",
|
||
srcs = glob(
|
||
include = ["test/**/*.hs"],
|
||
exclude = [
|
||
"test/fixtures/**/*.hs",
|
||
"test/Examples.hs",
|
||
],
|
||
),
|
||
compiler_flags = STANDARD_GHC_WARNINGS + [
|
||
"-XStrictData",
|
||
],
|
||
data = glob(include = [
|
||
"test/fixtures/**/*.json",
|
||
"test/fixtures/go/**/*.go",
|
||
"test/fixtures/python/**/*.py",
|
||
"test/fixtures/ruby/**/*.rb",
|
||
"test/fixtures/javascript/**/*.js",
|
||
"test/fixtures/typescript/**/*.ts",
|
||
]),
|
||
src_strip_prefix = "test",
|
||
deps = semantic_common_dependencies + [
|
||
":base",
|
||
"//semantic:lib",
|
||
"//semantic-proto:lib",
|
||
"//semantic-json:lib",
|
||
"//semantic-tags:lib",
|
||
"@stackage//:Glob",
|
||
"@stackage//:HUnit",
|
||
"@stackage//:bazel-runfiles",
|
||
"@stackage//:bifunctors",
|
||
"@stackage//:hedgehog",
|
||
"@stackage//:hspec",
|
||
"@stackage//:hspec-core",
|
||
"@stackage//:hspec-expectations",
|
||
"@stackage//:leancheck",
|
||
"@stackage//:tasty",
|
||
"@stackage//:tasty-golden",
|
||
"@stackage//:tasty-hedgehog",
|
||
"@stackage//:tasty-hspec",
|
||
"@stackage//:tasty-hunit",
|
||
"@stackage//:temporary",
|
||
"@stackage//:tree-sitter",
|
||
],
|
||
)
|