about summary refs log tree commit diff
path: root/services/tazblog
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-07-04T15·07+0100
committerVincent Ambo <tazjin@google.com>2019-07-04T15·07+0100
commite039a95de612217b7b6a50be05e1495c99ce4da3 (patch)
tree5ede132bf3d9f62429f782e6c4764e8f0a4f7418 /services/tazblog
parentfe243d32fe9adf5a01199440706fdc08f9f9876a (diff)
feat(tazblog): Add Bazel build configuration r/27
Adds a build configuration using rules_haskell and rules_nixpkgs with
all dependencies coming from the centrally configured GHC in the
project root.
Diffstat (limited to 'services/tazblog')
-rw-r--r--services/tazblog/BUILD86
1 files changed, 86 insertions, 0 deletions
diff --git a/services/tazblog/BUILD b/services/tazblog/BUILD
new file mode 100644
index 000000000000..881cbc013837
--- /dev/null
+++ b/services/tazblog/BUILD
@@ -0,0 +1,86 @@
+# Set all target’s visibility in this package to "public".
+package(default_visibility = ["//visibility:public"])
+
+# Load `rules_haskell` rules.
+load(
+    "@io_tweag_rules_haskell//haskell:haskell.bzl",
+    "haskell_binary",
+    "haskell_library",
+    "haskell_toolchain_library",
+)
+
+# Include required external libraries. These are added to the compiler's
+# environment by Nix.
+haskell_toolchain_library(name = "acid-state")
+haskell_toolchain_library(name = "base")
+haskell_toolchain_library(name = "base64-bytestring")
+haskell_toolchain_library(name = "blaze-html")
+haskell_toolchain_library(name = "bytestring")
+haskell_toolchain_library(name = "containers")
+haskell_toolchain_library(name = "cryptohash")
+haskell_toolchain_library(name = "hamlet")
+haskell_toolchain_library(name = "happstack-server")
+haskell_toolchain_library(name = "ixset")
+haskell_toolchain_library(name = "markdown")
+haskell_toolchain_library(name = "mtl")
+haskell_toolchain_library(name = "network")
+haskell_toolchain_library(name = "network-uri")
+haskell_toolchain_library(name = "rss")
+haskell_toolchain_library(name = "safecopy")
+haskell_toolchain_library(name = "shakespeare")
+haskell_toolchain_library(name = "text")
+haskell_toolchain_library(name = "time")
+haskell_toolchain_library(name = "options")
+
+haskell_library(
+    name = "tazblog-lib",
+    src_strip_prefix = "src",
+    srcs = glob(['src/*.hs']),
+    deps = [
+        ":acid-state",
+        ":base",
+        ":base64-bytestring",
+        ":blaze-html",
+        ":bytestring",
+        ":containers",
+        ":cryptohash",
+        ":hamlet",
+        ":happstack-server",
+        ":ixset",
+        ":markdown",
+        ":mtl",
+        ":network",
+        ":network-uri",
+        ":rss",
+        ":safecopy",
+        ":shakespeare",
+        ":text",
+        ":time",
+    ],
+)
+
+# Primary blog server component
+haskell_binary(
+    name = "tazblog",
+    srcs = [":blog/Main.hs"],
+    deps = [
+        ":acid-state",
+        ":base",
+        ":network",
+        ":options",
+        ":tazblog-lib",
+    ],
+)
+
+# Blog database server component
+haskell_binary(
+    name = "tazblog-db",
+    srcs = [":db/Main.hs"],
+    deps = [
+        ":base",
+        ":acid-state",
+        ":network",
+        ":options",
+        ":tazblog-lib",
+    ],
+)