2022-01-03 19:36:51 +03:00
|
|
|
# Copyright (c) 2022 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
|
|
|
|
|
2019-06-24 18:39:41 +03:00
|
|
|
load("//bazel_tools:haskell.bzl", "da_haskell_binary", "da_haskell_library", "da_haskell_repl", "da_haskell_test")
|
2019-07-05 17:04:47 +03:00
|
|
|
load("//bazel_tools/packaging:packaging.bzl", "package_app")
|
2019-04-29 18:10:17 +03:00
|
|
|
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(
|
2019-04-12 14:10:16 +03:00
|
|
|
name = "daml-project-config",
|
2019-07-05 17:04:47 +03:00
|
|
|
srcs = glob(["daml-project-config/**/*.hs"]),
|
2019-09-06 12:01:09 +03:00
|
|
|
hackage_deps = [
|
2022-02-01 13:27:11 +03:00
|
|
|
"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",
|
2019-04-10 13:06:38 +03:00
|
|
|
"lens",
|
2019-04-04 11:33:38 +03:00
|
|
|
"safe-exceptions",
|
2019-04-10 13:06:38 +03:00
|
|
|
"semver",
|
2019-04-05 20:34:23 +03:00
|
|
|
"text",
|
|
|
|
"yaml",
|
2019-04-04 11:33:38 +03:00
|
|
|
],
|
2019-04-12 14:10:16 +03:00
|
|
|
src_strip_prefix = "daml-project-config",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [],
|
2019-04-04 11:33:38 +03:00
|
|
|
)
|
|
|
|
|
2019-04-29 11:21:01 +03:00
|
|
|
da_haskell_library(
|
|
|
|
name = "daml-lib",
|
2019-07-05 17:04:47 +03:00
|
|
|
srcs = glob(
|
2019-04-29 11:21:01 +03:00
|
|
|
["src/**/*.hs"],
|
|
|
|
),
|
2019-09-06 12:01:09 +03:00
|
|
|
hackage_deps = [
|
2019-04-15 14:46:53 +03:00
|
|
|
"aeson",
|
2019-04-12 14:10:16 +03:00
|
|
|
"base",
|
|
|
|
"bytestring",
|
|
|
|
"conduit",
|
|
|
|
"conduit-extra",
|
2019-05-23 17:33:07 +03:00
|
|
|
"unordered-containers",
|
2019-04-12 14:10:16 +03:00
|
|
|
"directory",
|
|
|
|
"extra",
|
2021-05-11 19:36:19 +03:00
|
|
|
"filelock",
|
2019-04-12 14:10:16 +03:00
|
|
|
"filepath",
|
2019-04-16 16:26:24 +03:00
|
|
|
"http-client",
|
|
|
|
"http-client-tls",
|
2019-04-12 14:10:16 +03:00
|
|
|
"http-conduit",
|
2021-01-05 16:31:41 +03:00
|
|
|
"http-types",
|
2019-04-12 14:10:16 +03:00
|
|
|
"lens",
|
|
|
|
"optparse-applicative",
|
2020-02-04 17:45:53 +03:00
|
|
|
"process",
|
2019-04-12 14:10:16 +03:00
|
|
|
"safe",
|
|
|
|
"safe-exceptions",
|
|
|
|
"semver",
|
|
|
|
"tar-conduit",
|
|
|
|
"tasty",
|
|
|
|
"tasty-hunit",
|
|
|
|
"tasty-quickcheck",
|
|
|
|
"temporary",
|
|
|
|
"terminal-progress-bar",
|
|
|
|
"text",
|
2019-05-02 16:12:31 +03:00
|
|
|
"time",
|
|
|
|
"tls",
|
2019-08-06 11:49:25 +03:00
|
|
|
"typed-process",
|
2019-04-12 14:10:16 +03:00
|
|
|
"unix-compat",
|
|
|
|
"utf8-string",
|
|
|
|
"yaml",
|
2019-04-29 18:10:17 +03:00
|
|
|
] + (["Win32"] if is_windows else []),
|
2019-04-12 14:10:16 +03:00
|
|
|
src_strip_prefix = "src",
|
|
|
|
visibility = ["//visibility:public"],
|
2019-05-14 22:55:45 +03:00
|
|
|
deps = [
|
|
|
|
":daml-project-config",
|
|
|
|
"//libs-haskell/da-hs-base",
|
|
|
|
],
|
2019-04-29 11:21:01 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
da_haskell_binary(
|
|
|
|
name = "daml",
|
2019-07-29 17:55:55 +03:00
|
|
|
srcs = ["exe/DA/Daml/Assistant.hs"],
|
2019-09-06 12:01:09 +03:00
|
|
|
hackage_deps = [
|
2020-02-14 18:46:25 +03:00
|
|
|
"aeson",
|
2019-04-29 11:21:01 +03:00
|
|
|
"base",
|
2020-02-14 18:46:25 +03:00
|
|
|
"containers",
|
2019-04-29 11:21:01 +03:00
|
|
|
"directory",
|
2019-05-02 16:12:31 +03:00
|
|
|
"extra",
|
2019-04-29 11:21:01 +03:00
|
|
|
"filepath",
|
2019-05-23 17:33:07 +03:00
|
|
|
"safe",
|
2019-04-29 11:21:01 +03:00
|
|
|
"safe-exceptions",
|
2019-07-16 19:21:00 +03:00
|
|
|
"typed-process",
|
2019-05-14 09:46:55 +03:00
|
|
|
"text",
|
2020-02-14 18:46:25 +03:00
|
|
|
"unordered-containers",
|
2019-04-29 11:21:01 +03:00
|
|
|
],
|
2019-07-29 17:55:55 +03:00
|
|
|
main_function = "DA.Daml.Assistant.main",
|
2019-04-29 11:21:01 +03:00
|
|
|
src_strip_prefix = "exe",
|
|
|
|
visibility = ["//visibility:public"],
|
2019-04-04 11:33:38 +03:00
|
|
|
deps = [
|
2019-04-29 11:21:01 +03:00
|
|
|
":daml-lib",
|
2019-04-04 11:33:38 +03:00
|
|
|
":daml-project-config",
|
2019-04-12 14:10:16 +03:00
|
|
|
"//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(
|
2019-04-12 14:10:16 +03:00
|
|
|
name = "test",
|
2019-07-29 17:55:55 +03:00
|
|
|
srcs = ["test/DA/Daml/Assistant/Tests.hs"],
|
2019-09-06 12:01:09 +03:00
|
|
|
hackage_deps = [
|
2019-04-12 14:10:16 +03:00
|
|
|
"base",
|
|
|
|
"conduit",
|
|
|
|
"conduit-extra",
|
|
|
|
"directory",
|
|
|
|
"extra",
|
|
|
|
"filepath",
|
|
|
|
"safe-exceptions",
|
|
|
|
"tar-conduit",
|
|
|
|
"tasty",
|
|
|
|
"tasty-hunit",
|
|
|
|
"tasty-quickcheck",
|
|
|
|
"temporary",
|
|
|
|
"text",
|
|
|
|
"unix-compat",
|
|
|
|
],
|
2019-07-29 17:55:55 +03:00
|
|
|
main_function = "DA.Daml.Assistant.Tests.main",
|
2019-04-29 11:21:01 +03:00
|
|
|
src_strip_prefix = "test",
|
2019-04-12 14:10:16 +03:00
|
|
|
visibility = ["//visibility:public"],
|
2019-04-04 11:33:38 +03:00
|
|
|
deps = [
|
2019-04-29 11:21:01 +03:00
|
|
|
":daml-lib",
|
2019-04-04 11:33:38 +03:00
|
|
|
":daml-project-config",
|
2019-04-12 14:10:16 +03:00
|
|
|
"//libs-haskell/da-hs-base",
|
2020-03-30 20:20:47 +03:00
|
|
|
"//libs-haskell/test-utils",
|
2019-04-04 11:33:38 +03:00
|
|
|
],
|
|
|
|
)
|
2019-06-24 18:39:41 +03:00
|
|
|
|
|
|
|
# Target for da-ghcid, includes everything except integration tests.
|
|
|
|
da_haskell_repl(
|
|
|
|
name = "repl",
|
2019-07-17 16:09:55 +03:00
|
|
|
testonly = True,
|
2019-06-24 18:39:41 +03:00
|
|
|
collect_data = False,
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
"//daml-assistant:daml",
|
2019-07-17 16:09:55 +03:00
|
|
|
"//daml-assistant:test",
|
2019-06-24 18:39:41 +03:00
|
|
|
"//daml-assistant/daml-helper",
|
|
|
|
],
|
|
|
|
)
|