mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
9179b2e7d0
* Add _distribute.jar target with correct license Use it everywhere * Fixes from review * Change NOTICES to NOTICES.txt for consistency
28 lines
686 B
Bash
Executable File
28 lines
686 B
Bash
Executable File
#!/bin/bash
|
|
# Copyright (c) 2023 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
SRC=$1
|
|
OUT=$2
|
|
NOTICES=$3
|
|
LICENSE=$4
|
|
LICENSE_EE=$5
|
|
IS_EE=$6
|
|
|
|
cp $SRC $OUT
|
|
chmod +w $OUT
|
|
zip -dq $OUT "/LICENSE*" "/META-INF/LICENSE*" "/NOTICE*" "/META-INF/NOTICE*"
|
|
|
|
# both licenses have the wrong file name/directory, so we copy to a temp dir
|
|
TMP_LICENSE_DIR=$(mktemp -d)
|
|
cp $NOTICES $TMP_LICENSE_DIR/NOTICES.txt
|
|
if [[ "$IS_EE" -eq 1 ]]; then
|
|
cp $LICENSE_EE $TMP_LICENSE_DIR/LICENSE.txt
|
|
else
|
|
cp $LICENSE $TMP_LICENSE_DIR/LICENSE.txt
|
|
fi
|
|
zip -ujq $OUT $TMP_LICENSE_DIR/LICENSE.txt $TMP_LICENSE_DIR/NOTICES.txt
|
|
rm -rf $TMP_LICENSE_DIR
|
|
|