feat(third_party/bazel): Check in rules_haskell from Tweag
This commit is contained in:
parent
2eb1dc26e4
commit
f723b8b878
479 changed files with 51484 additions and 0 deletions
35
third_party/bazel/rules_haskell/tests/hsc/BUILD.bazel
vendored
Normal file
35
third_party/bazel/rules_haskell/tests/hsc/BUILD.bazel
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
load(
|
||||
"@io_tweag_rules_haskell//haskell:haskell.bzl",
|
||||
"haskell_library",
|
||||
"haskell_test",
|
||||
)
|
||||
|
||||
package(default_testonly = 1)
|
||||
|
||||
haskell_library(
|
||||
name = "hsc-lib",
|
||||
srcs = [
|
||||
"Bar.hsc",
|
||||
"Bar/Baz.hsc",
|
||||
"Flags.hsc",
|
||||
"Foo.hsc",
|
||||
],
|
||||
compiler_flags = [
|
||||
"-DTHIS_IS_TRUE",
|
||||
"-optP-DTHIS_TOO_IS_TRUE",
|
||||
],
|
||||
deps = ["//tests/hackage:base"],
|
||||
)
|
||||
|
||||
haskell_test(
|
||||
name = "hsc",
|
||||
srcs = [
|
||||
"BinHsc.hsc",
|
||||
"Main.hs",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":hsc-lib",
|
||||
"//tests/hackage:base",
|
||||
],
|
||||
)
|
||||
6
third_party/bazel/rules_haskell/tests/hsc/Bar.hsc
vendored
Normal file
6
third_party/bazel/rules_haskell/tests/hsc/Bar.hsc
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
module Bar (hscFiredBar) where
|
||||
|
||||
#ifndef _INTERNAL_HSC_DO_NOT_DEFINE_ME
|
||||
hscFiredBar :: String
|
||||
hscFiredBar = "hscFiredBar"
|
||||
#endif
|
||||
6
third_party/bazel/rules_haskell/tests/hsc/Bar/Baz.hsc
vendored
Normal file
6
third_party/bazel/rules_haskell/tests/hsc/Bar/Baz.hsc
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
module Bar.Baz (hscFiredBaz) where
|
||||
|
||||
#ifndef _INTERNAL_HSC_DO_NOT_DEFINE_ME
|
||||
hscFiredBaz :: String
|
||||
hscFiredBaz = "hscFiredBaz"
|
||||
#endif
|
||||
1
third_party/bazel/rules_haskell/tests/hsc/BinHsc.hsc
vendored
Normal file
1
third_party/bazel/rules_haskell/tests/hsc/BinHsc.hsc
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
module BinHsc () where
|
||||
8
third_party/bazel/rules_haskell/tests/hsc/Flags.hsc
vendored
Normal file
8
third_party/bazel/rules_haskell/tests/hsc/Flags.hsc
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
module Flags (hscFlags) where
|
||||
|
||||
#ifdef THIS_IS_TRUE
|
||||
#ifdef THIS_TOO_IS_TRUE
|
||||
hscFlags :: String
|
||||
hscFlags = "hscFlags"
|
||||
#endif
|
||||
#endif
|
||||
8
third_party/bazel/rules_haskell/tests/hsc/Foo.hsc
vendored
Normal file
8
third_party/bazel/rules_haskell/tests/hsc/Foo.hsc
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
module Foo (hscFiredFoo) where
|
||||
|
||||
#if __GLASGOW_HASKELL__ >= 700
|
||||
#ifndef _INTERNAL_HSC_DO_NOT_DEFINE_ME
|
||||
hscFiredFoo :: String
|
||||
hscFiredFoo = "hscFiredFoo"
|
||||
#endif
|
||||
#endif
|
||||
10
third_party/bazel/rules_haskell/tests/hsc/Main.hs
vendored
Normal file
10
third_party/bazel/rules_haskell/tests/hsc/Main.hs
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
module Main (main) where
|
||||
|
||||
import BinHsc ()
|
||||
import Foo (hscFiredFoo)
|
||||
import Bar (hscFiredBar)
|
||||
import Bar.Baz (hscFiredBaz)
|
||||
import Flags (hscFlags)
|
||||
|
||||
main :: IO ()
|
||||
main = putStrLn (hscFiredFoo ++ hscFiredBar ++ hscFiredBaz ++ hscFlags)
|
||||
Loading…
Add table
Add a link
Reference in a new issue