daml/daml-assistant/BUILD.bazel
nickchapman-da ddc11a7063
Refactor deployment tests: (#5342)
- Move deployment tests (deployTest, fetchTest) out of integration-tests.
- Use DA.Test.Sandbox where appropriate.
- Split out code for useful test patterns: i.e. calling commands quietly, getFreePort.

changelog_begin
changelog_end
2020-04-02 10:17:21 +01:00

149 lines
3.5 KiB
Python

# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load("//bazel_tools:haskell.bzl", "da_haskell_binary", "da_haskell_library", "da_haskell_repl", "da_haskell_test")
load("//bazel_tools/packaging:packaging.bzl", "package_app")
load("@os_info//:os_info.bzl", "is_windows")
# 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 = [
"base",
"directory",
"extra",
"filepath",
"lens",
"safe-exceptions",
"semver",
"text",
"yaml",
],
src_strip_prefix = "daml-project-config",
visibility = ["//visibility:public"],
deps = [],
)
da_haskell_library(
name = "daml-lib",
srcs = glob(
["src/**/*.hs"],
),
hackage_deps = [
"aeson",
"base",
"bytestring",
"conduit",
"conduit-extra",
"unordered-containers",
"directory",
"extra",
"filepath",
"http-client",
"http-client-tls",
"http-conduit",
"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"],
deps = [
":daml-lib",
":daml-project-config",
"//libs-haskell/da-hs-base",
],
)
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"],
deps = [
":daml-lib",
":daml-project-config",
"//libs-haskell/da-hs-base",
"//libs-haskell/test-utils",
],
)
# 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",
],
)