2019-06-04 16:50:29 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-07-26 14:51:06 +00:00
|
|
|
if [[ -z "${IN_NIX_SHELL}" ]]; then
|
|
|
|
echo "Remember to call 'make shell'!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-06-04 16:50:29 +00:00
|
|
|
#
|
|
|
|
# This script takes care of generating/updating the maven-sources.nix file
|
|
|
|
# representing the offline Maven repo containing the dependencies
|
|
|
|
# required to build the project
|
|
|
|
#
|
|
|
|
|
|
|
|
set -Eeu
|
|
|
|
|
|
|
|
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
|
|
|
|
current_dir=$(cd "${BASH_SOURCE%/*}" && pwd)
|
|
|
|
inputs_file_path="${current_dir}/maven-inputs.txt"
|
|
|
|
output_nix_file_path="${current_dir}/maven-sources.nix"
|
2020-05-01 14:49:17 +00:00
|
|
|
inputs2nix="${GIT_ROOT}/nix/mobile/android/maven-and-npm-deps/maven/maven-inputs2nix.sh"
|
2019-06-04 16:50:29 +00:00
|
|
|
|
|
|
|
echo "Regenerating Nix files, this process should take about 90 minutes"
|
2020-01-21 14:49:20 +00:00
|
|
|
nix-shell --run "set -Eeuo pipefail; LC_ALL=C ${current_dir}/fetch-maven-deps.sh | sort -u -o ${inputs_file_path}" \
|
|
|
|
-A targets.mobile.android.generate-maven-and-npm-deps-shell --show-trace "${GIT_ROOT}/default.nix"
|
2019-06-04 16:50:29 +00:00
|
|
|
|
|
|
|
pushd ${current_dir}
|
|
|
|
${inputs2nix} ${inputs_file_path} > ${output_nix_file_path}
|
|
|
|
echo "Done"
|
|
|
|
popd
|