Skip to content

Commit 91491fd

Browse files
Ilya Bogdanovdmitry-timofeev
Ilya Bogdanov
authored andcommitted
Fix native licenses generation and packaging [ECR-4001] [ECR-3968] (#1305)
Now native licenses are correctly packaged Now native licenses are in JSON format
1 parent b6e50ca commit 91491fd

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
#!/usr/bin/env bash
22
# Gather licenses for every Rust dependency and print it in the file in a readable form.
3+
# Resulting file destination is either specified by `PACKAGING_ETC_DIR` variable, or
4+
# is the script directory (exonum-java-binding/core/rust)
35

46
# Fail immediately in case of errors and/or unset variables
57
set -eu -o pipefail
68

7-
cargo license -h &> /dev/null || cargo install cargo-license
9+
cargo-license -h &> /dev/null || cargo install cargo-license
810

9-
# Going to exonum-java-binding-core/rust directory.
11+
# Going to exonum-java-binding/core/rust directory.
1012
backup_dir=${PWD}
1113
script_dir=$(dirname $(realpath -s "$0")) # Directory of this script. Must be exonum-java-binding/core/rust
1214
cd ${script_dir}
1315

14-
cargo license -da \
15-
| sed 's@registry+https://github.com/rust-lang/crates.io-index, @@g' `# Remove unnecessary information from the list` \
16-
| sed 's/\x1b\[[0-9;]*m//g' `# Remove color escape sequences from the list` \
17-
> "${PACKAGING_ETC_DIR:-.}/LICENSES-THIRD-PARTY-NATIVE"
16+
cargo-license --json > "${PACKAGING_ETC_DIR:-.}/LICENSES-THIRD-PARTY-NATIVE"
1817

19-
# Returning to the root EJB directory.
18+
# Restoring initial directory.
2019
cd ${backup_dir}

exonum-java-binding/package_app.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ source ./tests_profile
102102
# Prepare directories
103103
PACKAGING_BASE_DIR="${EJB_RUST_DIR}/target/${BUILD_MODE}"
104104
PACKAGING_NATIVE_LIB_DIR="${PACKAGING_BASE_DIR}/lib/native"
105-
PACKAGING_ETC_DIR="${PACKAGING_BASE_DIR}/etc"
105+
export PACKAGING_ETC_DIR="${PACKAGING_BASE_DIR}/etc"
106106
mkdir -p "${PACKAGING_BASE_DIR}"
107107
mkdir -p "${PACKAGING_NATIVE_LIB_DIR}"
108108
mkdir -p "${PACKAGING_ETC_DIR}"

0 commit comments

Comments
 (0)