2019-09-05 13:56:41 +03:00
|
|
|
# Copyright (c) 2019 The DAML Authors. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
load(
|
|
|
|
"//bazel_tools:scala.bzl",
|
|
|
|
"da_scala_binary",
|
|
|
|
)
|
|
|
|
load(
|
|
|
|
"//bazel_tools/client_server_test:client_server_test.bzl",
|
|
|
|
"client_server_test",
|
|
|
|
)
|
|
|
|
|
|
|
|
genrule(
|
|
|
|
name = "acs",
|
|
|
|
srcs =
|
|
|
|
glob(["**/*.daml"]) + [
|
2019-09-30 12:15:11 +03:00
|
|
|
"//triggers/daml:daml-trigger.dar",
|
2019-09-05 13:56:41 +03:00
|
|
|
],
|
|
|
|
outs = ["acs.dar"],
|
|
|
|
cmd = """
|
|
|
|
set -eou pipefail
|
2019-09-08 20:49:00 +03:00
|
|
|
TMP_DIR=$$(mktemp -d)
|
|
|
|
mkdir -p $$TMP_DIR/daml
|
|
|
|
cp -L $(location :daml/ACS.daml) $$TMP_DIR/daml
|
2019-10-08 16:34:14 +03:00
|
|
|
cp -L $(location :daml/Copy.daml) $$TMP_DIR/daml
|
2019-09-30 12:15:11 +03:00
|
|
|
cp -L $(location //triggers/daml:daml-trigger.dar) $$TMP_DIR/
|
2019-09-08 20:49:00 +03:00
|
|
|
cat << EOF > $$TMP_DIR/daml.yaml
|
2019-09-05 13:56:41 +03:00
|
|
|
sdk-version: 0.0.0
|
|
|
|
name: acs
|
2019-09-08 20:49:00 +03:00
|
|
|
source: daml
|
2019-09-05 13:56:41 +03:00
|
|
|
version: 0.0.1
|
|
|
|
dependencies:
|
|
|
|
- daml-stdlib
|
|
|
|
- daml-prim
|
2019-09-30 12:15:11 +03:00
|
|
|
- daml-trigger.dar
|
2019-09-05 13:56:41 +03:00
|
|
|
EOF
|
2019-09-23 13:49:01 +03:00
|
|
|
$(location //compiler/damlc) build --target=1.dev --project-root=$$TMP_DIR -o $$PWD/$(location acs.dar)
|
2019-09-08 20:49:00 +03:00
|
|
|
rm -rf $$TMP_DIR
|
2019-09-05 13:56:41 +03:00
|
|
|
""",
|
|
|
|
tools = ["//compiler/damlc"],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
da_scala_binary(
|
2019-10-04 11:59:02 +03:00
|
|
|
name = "test_client",
|
2019-09-05 13:56:41 +03:00
|
|
|
srcs = glob(["src/**/*.scala"]),
|
2019-10-04 11:59:02 +03:00
|
|
|
main_class = "com.daml.trigger.test.TestMain",
|
2019-09-05 13:56:41 +03:00
|
|
|
deps = [
|
|
|
|
"//3rdparty/jvm/com/github/scopt",
|
|
|
|
"//3rdparty/jvm/com/typesafe/akka:akka_stream",
|
|
|
|
"//3rdparty/jvm/org/scalaz:scalaz_core",
|
|
|
|
"//daml-lf/archive:daml_lf_archive_scala",
|
|
|
|
"//daml-lf/archive:daml_lf_java_proto",
|
|
|
|
"//daml-lf/data",
|
|
|
|
"//daml-lf/interpreter",
|
|
|
|
"//daml-lf/language",
|
|
|
|
"//daml-lf/transaction",
|
|
|
|
"//language-support/scala/bindings",
|
|
|
|
"//language-support/scala/bindings-akka",
|
|
|
|
"//ledger-api/rs-grpc-bridge",
|
2019-10-04 11:59:02 +03:00
|
|
|
"//ledger/ledger-api-common",
|
2019-09-05 13:56:41 +03:00
|
|
|
"//triggers/runner:trigger-runner-lib",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
client_server_test(
|
2019-10-04 11:59:02 +03:00
|
|
|
name = "test",
|
|
|
|
client = ":test_client",
|
2019-09-05 13:56:41 +03:00
|
|
|
client_files = ["$(rootpath :acs.dar)"],
|
|
|
|
data = [":acs.dar"],
|
|
|
|
server = "//ledger/sandbox:sandbox-binary",
|
|
|
|
server_files = ["$(rootpath :acs.dar)"],
|
|
|
|
)
|