2019-09-09 16:37:03 +03:00
|
|
|
#!/usr/bin/env bash
|
2021-01-01 21:49:51 +03:00
|
|
|
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
2019-09-09 16:37:03 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
set -eou pipefail
|
|
|
|
|
|
|
|
if [ "$#" -ne 1 ]; then
|
|
|
|
echo "Expected exactly one argument."
|
|
|
|
echo "Usage: ${BASH_SOURCE[0]} TARGET_DIR"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-10-03 09:36:14 +03:00
|
|
|
TARGET_DIR=$(realpath $1)
|
2019-09-09 16:37:03 +03:00
|
|
|
|
2019-10-03 09:36:14 +03:00
|
|
|
cd "$(dirname ${BASH_SOURCE[0]})"
|
2019-09-09 16:37:03 +03:00
|
|
|
|
|
|
|
bazel build //ledger-api/grpc-definitions:all-ledger-api-haskellpb-sources
|
|
|
|
|
|
|
|
BAZEL_BIN=$(bazel info bazel-bin)
|
|
|
|
|
|
|
|
rm -rf gen
|
|
|
|
mkdir gen
|
|
|
|
mkdir gen/src
|
|
|
|
|
|
|
|
cp -rp $BAZEL_BIN/ledger-api/grpc-definitions/Google gen/src/Google
|
|
|
|
cp -rp $BAZEL_BIN/ledger-api/grpc-definitions/Com gen/src/Com
|
|
|
|
|
|
|
|
stack sdist --tar-dir $TARGET_DIR
|