Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions exonum-java-binding/core/rust/generate_licenses.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
#!/usr/bin/env bash
# Gather licenses for every Rust dependency and print it in the file in a readable form.
# Resulting file destination is either specified by `PACKAGING_ETC_DIR` variable, or
# is the script directory (exonum-java-binding/core/rust)

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

cargo license -h &> /dev/null || cargo install cargo-license
cargo-license -h &> /dev/null || cargo install cargo-license

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

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

# Returning to the root EJB directory.
# Restoring initial directory.
cd ${backup_dir}
2 changes: 1 addition & 1 deletion exonum-java-binding/package_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ source ./tests_profile
# Prepare directories
PACKAGING_BASE_DIR="${EJB_RUST_DIR}/target/${BUILD_MODE}"
PACKAGING_NATIVE_LIB_DIR="${PACKAGING_BASE_DIR}/lib/native"
PACKAGING_ETC_DIR="${PACKAGING_BASE_DIR}/etc"
export PACKAGING_ETC_DIR="${PACKAGING_BASE_DIR}/etc"
mkdir -p "${PACKAGING_BASE_DIR}"
mkdir -p "${PACKAGING_NATIVE_LIB_DIR}"
mkdir -p "${PACKAGING_ETC_DIR}"
Expand Down