2020-05-13 11:39:51 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
# Copy-pasted from the Bazel Bash runfiles library v2.
|
|
|
|
set -uo pipefail; f=bazel_tools/tools/bash/runfiles/runfiles.bash
|
|
|
|
source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
|
|
|
|
source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \
|
|
|
|
source "$0.runfiles/$f" 2>/dev/null || \
|
|
|
|
source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
|
|
|
|
source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
|
|
|
|
{ echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e
|
|
|
|
# --- end runfiles.bash initialization v2 ---
|
2020-05-22 15:02:59 +03:00
|
|
|
set -euo pipefail
|
2020-05-13 11:39:51 +03:00
|
|
|
|
2020-05-25 17:25:10 +03:00
|
|
|
canonicalize_rlocation() {
|
|
|
|
# Bazel will add a . at the beginning of locations in the root package
|
|
|
|
# which breaks rlocation.
|
|
|
|
rlocation $(realpath -L -s -m --relative-to=$PWD $TEST_WORKSPACE/$1)
|
|
|
|
}
|
|
|
|
|
2020-05-13 11:39:51 +03:00
|
|
|
RUNNER="$(rlocation "$TEST_WORKSPACE/$1")"
|
|
|
|
DAML="$(rlocation "$TEST_WORKSPACE/$2")"
|
2020-05-22 15:02:59 +03:00
|
|
|
# These things are only used in the jest tests so rather
|
|
|
|
# than adding a lot of boilerplate to the Haskell code
|
|
|
|
# to parse them only to pass them on, we simply set them here.
|
|
|
|
export DAML_SANDBOX="$(rlocation "$TEST_WORKSPACE/$3")"
|
|
|
|
export SANDBOX_VERSION="${4}"
|
|
|
|
export DAML_JSON_API="$(rlocation "$TEST_WORKSPACE/$5")"
|
|
|
|
export JSON_API_VERSION="${6}"
|
|
|
|
DAML_TYPES="$(rlocation "$TEST_WORKSPACE/$7")"
|
|
|
|
DAML_LEDGER="$(rlocation "$TEST_WORKSPACE/$8")"
|
|
|
|
DAML_REACT="$(rlocation "$TEST_WORKSPACE/$9")"
|
|
|
|
MESSAGING_PATCH="$(rlocation "$TEST_WORKSPACE/${10}")"
|
|
|
|
YARN="$(rlocation "$TEST_WORKSPACE/${11}")"
|
|
|
|
PATCH="$(rlocation "$TEST_WORKSPACE/${12}")"
|
|
|
|
TEST_DEPS="$(rlocation "$TEST_WORKSPACE/${13}")"
|
|
|
|
TEST_TS="$(rlocation "$TEST_WORKSPACE/${14}")"
|
2020-05-25 17:25:10 +03:00
|
|
|
CODEGEN_OUTPUT="$(canonicalize_rlocation "${15}")"
|
|
|
|
export DAR_PATH="$(canonicalize_rlocation "${16}")"
|
2020-05-13 11:39:51 +03:00
|
|
|
|
|
|
|
"$RUNNER" \
|
|
|
|
--daml "$DAML" \
|
|
|
|
--daml-types "$DAML_TYPES" \
|
|
|
|
--daml-ledger "$DAML_LEDGER" \
|
|
|
|
--daml-react "$DAML_REACT" \
|
2020-05-18 15:37:16 +03:00
|
|
|
--messaging-patch "$MESSAGING_PATCH" \
|
2020-05-13 11:39:51 +03:00
|
|
|
--yarn "$YARN" \
|
2020-05-18 15:37:16 +03:00
|
|
|
--patch "$PATCH" \
|
2020-05-22 15:02:59 +03:00
|
|
|
--test-deps "$TEST_DEPS" \
|
|
|
|
--test-ts "$TEST_TS" \
|
2020-05-25 17:25:10 +03:00
|
|
|
--codegen "$CODEGEN_OUTPUT" \
|