daml/daml-assistant/BUILD.bazel

155 lines
3.7 KiB
Python
Raw Normal View History

# Copyright (c) 2023 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
2019-04-04 11:33:38 +03:00
# SPDX-License-Identifier: Apache-2.0
load("//bazel_tools:haskell.bzl", "da_haskell_binary", "da_haskell_library", "da_haskell_repl", "da_haskell_test", "generate_and_track_cabal")
load("//bazel_tools/packaging:packaging.bzl", "package_app")
load("@os_info//:os_info.bzl", "is_windows")
2019-04-04 11:33:38 +03:00
# This library is intended to be used by applications called by the assistant,
# e.g., damlc, to get the names of the various environment variables set by the assistant.
da_haskell_library(
name = "daml-project-config",
srcs = glob(["daml-project-config/**/*.hs"]),
hackage_deps = [
"aeson",
2019-04-04 11:33:38 +03:00
"base",
"directory",
2019-04-05 20:34:23 +03:00
"extra",
2019-04-04 11:33:38 +03:00
"filepath",
"lens",
2019-04-04 11:33:38 +03:00
"safe-exceptions",
"semver",
2019-04-05 20:34:23 +03:00
"text",
"yaml",
2019-04-04 11:33:38 +03:00
],
src_strip_prefix = "daml-project-config",
visibility = ["//visibility:public"],
deps = [],
2019-04-04 11:33:38 +03:00
)
da_haskell_library(
name = "daml-lib",
srcs = glob(
["src/**/*.hs"],
),
hackage_deps = [
"aeson",
"base",
"bytestring",
"conduit",
"conduit-extra",
"containers",
"unordered-containers",
"directory",
"extra",
"filelock",
"filepath",
"http-client",
"http-client-tls",
"http-conduit",
"http-types",
"lens",
"optparse-applicative",
"process",
"safe",
"safe-exceptions",
"semver",
"tar-conduit",
"tasty",
"tasty-hunit",
"tasty-quickcheck",
"temporary",
"terminal-progress-bar",
"text",
"time",
"tls",
"typed-process",
"unix-compat",
"utf8-string",
"yaml",
] + (["Win32"] if is_windows else []),
src_strip_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":daml-project-config",
"//libs-haskell/da-hs-base",
],
)
da_haskell_binary(
name = "daml",
srcs = ["exe/DA/Daml/Assistant.hs"],
hackage_deps = [
"aeson",
"base",
"containers",
"directory",
"extra",
"filepath",
"safe",
"safe-exceptions",
"typed-process",
"text",
"unordered-containers",
],
main_function = "DA.Daml.Assistant.main",
src_strip_prefix = "exe",
visibility = ["//visibility:public"],
2019-04-04 11:33:38 +03:00
deps = [
":daml-lib",
2019-04-04 11:33:38 +03:00
":daml-project-config",
"//libs-haskell/da-hs-base",
2019-04-04 11:33:38 +03:00
],
)
package_app(
name = "daml-dist",
binary = ":daml",
visibility = ["//visibility:public"],
)
da_haskell_test(
name = "test",
srcs = ["test/DA/Daml/Assistant/Tests.hs"],
hackage_deps = [
"base",
"conduit",
"conduit-extra",
"directory",
"extra",
"filepath",
"safe-exceptions",
"tar-conduit",
"tasty",
"tasty-hunit",
"tasty-quickcheck",
"temporary",
"text",
"unix-compat",
],
main_function = "DA.Daml.Assistant.Tests.main",
src_strip_prefix = "test",
visibility = ["//visibility:public"],
2019-04-04 11:33:38 +03:00
deps = [
":daml-lib",
2019-04-04 11:33:38 +03:00
":daml-project-config",
"//libs-haskell/da-hs-base",
"//libs-haskell/test-utils",
2019-04-04 11:33:38 +03:00
],
)
# Target for da-ghcid, includes everything except integration tests.
da_haskell_repl(
name = "repl",
testonly = True,
collect_data = False,
visibility = ["//visibility:public"],
deps = [
"//daml-assistant:daml",
"//daml-assistant:test",
"//daml-assistant/daml-helper",
],
)
generate_and_track_cabal("daml-project-config", None, "daml-project-config")