daml/release/BUILD.bazel
Moritz Kiefer b8c03e36b5
Add a test for the file listing of the released protobufs (#12269)
We messed that up in the past and lost the hierarchical structure so
adding a test seems reasonable and these change sufficiently rarely
that updating it isn’t an issue.

changelog_begin
changelog_end
2022-01-05 16:01:52 +00:00

106 lines
2.3 KiB
Python

# Copyright (c) 2022 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")
load("util.bzl", "protos_zip", "sdk_tarball")
load("@build_environment//:configuration.bzl", "sdk_version")
load("@os_info//:os_info.bzl", "is_windows")
da_haskell_binary(
name = "release",
srcs = glob(["src/**/*.hs"]),
hackage_deps = [
"aeson",
"async",
"ansi-terminal",
"base",
"base64-bytestring",
"bytestring",
"conduit",
"conduit-extra",
"containers",
"connection",
"cryptohash",
"directory",
"exceptions",
"extra",
"fast-logger",
"filepath",
"http-client",
"http-client-tls",
"http-conduit",
"http-types",
"lens",
"lifted-async",
"lifted-base",
"monad-control",
"monad-logger",
"optparse-applicative",
"path",
"path-io",
"process",
"retry",
"safe",
"safe-exceptions",
"semver",
"split",
"time",
"text",
"temporary",
"transformers",
"unliftio-core",
"unordered-containers",
"yaml",
"mtl",
"xml-conduit",
],
src_strip_prefix = "src",
visibility = ["//visibility:public"],
deps = [
"//:sdk-version-hs-lib",
"//libs-haskell/test-utils",
],
)
# Disabled on Windows since directory outputs can cause issues.
protos_zip(
name = "protobufs",
) if not is_windows else None
[
sdk_tarball(
"sdk-release-tarball-{}".format(edition),
sdk_version,
edition,
)
for edition in [
"ce",
"ee",
]
]
alias(
name = "sdk-release-tarball",
actual = "sdk-release-tarball-ce",
visibility = ["//visibility:public"],
)
sh_test(
name = "test-protobuf-structure",
srcs = ["test-protobuf-structure.sh"],
args = [
"$(location :protobufs.zip)",
"$(POSIX_DIFF)",
"$(POSIX_SORT)",
],
data = [
":protobufs.zip",
],
toolchains = [
"@rules_sh//sh/posix:make_variables",
],
deps = [
"@bazel_tools//tools/bash/runfiles",
],
) if not is_windows else None