forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD
162 lines (133 loc) · 3.21 KB
/
BUILD
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
package(default_visibility = ["//:__subpackages__"])
load("@io_tweag_rules_haskell//haskell:haskell.bzl",
"haskell_toolchain",
)
load("@io_tweag_rules_haskell//haskell:c2hs.bzl",
"c2hs_toolchain",
)
load ("//bazel_tools:haskell.bzl", "da_haskell_library")
exports_files([".hlint.yaml"])
config_setting(
name = "on_linux",
constraint_values = [
"@bazel_tools//platforms:linux",
],
)
config_setting(
name = "on_osx",
constraint_values = [
"@bazel_tools//platforms:osx",
],
)
config_setting(
name = "on_freebsd",
constraint_values = [
"@bazel_tools//platforms:freebsd",
],
)
config_setting(
name = "on_windows",
constraint_values = [
"@bazel_tools//platforms:windows",
],
)
load(
"@io_tweag_rules_haskell//haskell:c2hs.bzl",
"c2hs_toolchain",
)
c2hs_toolchain(
name = "c2hs-toolchain",
c2hs = "@c2hs//:bin",
)
filegroup(name = "node_modules", srcs = glob(["node_modules/**/*"]))
config_setting(
name = "ghci_data",
define_values = {
"ghci_data": "True",
},
)
#
# Metadata
#
# The VERSION file is inlined in a few builds.
exports_files(["NOTICES", "LICENSE", "VERSION", "CHANGELOG", "tsconfig.json"])
# FIXME(#448): We're currently assigning version (100+x).y.z to all components
# in SDK version x.y.z. As long as x < 10, 10x.y.z == (100+x).y.z. Since we'll
# stop splitting the SDK into individual components _very_ soon, this rule
# will not survive until x >= 10.
genrule(
name = "component-version",
srcs = ["VERSION"],
outs = ["COMPONENT-VERSION"],
cmd = """
echo -n 10 > $@
cat $(location VERSION) >> $@
""",
)
genrule(
name = "sdk-version-hs",
srcs = ["VERSION", ":component-version"],
outs = ["SdkVersion.hs"],
cmd = """
SDK_VERSION=$$(cat $(location VERSION))
COMPONENT_VERSION=$$(cat $(location :component-version))
cat > $@ <<EOF
module SdkVersion where
sdkVersion, componentVersion :: String
sdkVersion = "$$SDK_VERSION"
componentVersion = "$$COMPONENT_VERSION"
EOF
""",
)
da_haskell_library(
name = "sdk-version-hs-lib",
srcs = [":sdk-version-hs"],
hazel_deps = ["base"],
visibility = ["//visibility:public"],
)
genrule(
name = "git-revision",
stamp = True,
outs = [".git-revision"],
cmd = """
grep '^STABLE_GIT_REVISION ' bazel-out/stable-status.txt | cut -d ' ' -f 2 > $@
""",
)
#
# Common aliases
#
alias(
name = "damli",
actual = "//daml-foundations/daml-tools/da-hs-damli-app:damli"
)
alias(
name = "damli@ghci",
actual = "//daml-foundations/daml-tools/da-hs-damli-app:damli@ghci"
)
alias(
name = "damli-dist",
actual = "//daml-foundations/daml-tools/da-hs-damli-app:dist"
)
alias(
name = "damlc",
actual = "//daml-foundations/daml-tools/da-hs-damlc-app:da-hs-damlc-app"
)
alias(
name = "damlc@ghci",
actual = "//daml-foundations/daml-tools/da-hs-damlc-app:da-hs-damlc-app@ghci"
)
alias(
name = "damlc-dist",
actual = "//daml-foundations/daml-tools/da-hs-damlc-app:damlc-dist"
)
alias(
name = "daml-lf-repl",
actual = "//daml-lf/repl:repl"
)
alias(
name = "bindings-java",
actual = "//language-support/java/bindings:bindings-java"
)
exports_files([
".scalafmt.conf"
])