2019-09-10 09:50:09 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
|
|
|
|
_current_dir=$(cd "${BASH_SOURCE%/*}" && pwd)
|
|
|
|
source "$_current_dir/lib/setup/path-support.sh"
|
|
|
|
|
|
|
|
source_lib "platform.sh"
|
|
|
|
|
2020-01-13 14:28:40 +00:00
|
|
|
config=''
|
|
|
|
config+="status-im.build-type=\"${BUILD_TYPE}\";"
|
2020-01-08 14:41:07 +00:00
|
|
|
if [ -n "${STATUS_GO_SRC_OVERRIDE}" ]; then
|
2020-01-13 14:28:40 +00:00
|
|
|
config+="status-im.status-go.src-override=\"${STATUS_GO_SRC_OVERRIDE}\";"
|
2020-01-08 14:41:07 +00:00
|
|
|
fi
|
2020-01-21 07:19:49 +00:00
|
|
|
if [ -n "${NIMBUS_SRC_OVERRIDE}" ]; then
|
|
|
|
config+="status-im.nimbus.src-override=\"${NIMBUS_SRC_OVERRIDE}\";"
|
|
|
|
fi
|
2020-01-13 14:28:40 +00:00
|
|
|
config+="status-im.status-react.build-number=\"${BUILD_NUMBER}\";"
|
|
|
|
config+="status-im.status-react.keystore-file=\"${STORE_FILE}\";"
|
2019-09-10 09:50:09 +00:00
|
|
|
nixOpts=(
|
2020-01-13 14:28:40 +00:00
|
|
|
"--arg config {${config}}"
|
2019-11-13 11:01:48 +00:00
|
|
|
"--arg env {BUILD_ENV=\"${BUILD_ENV}\";ANDROID_ABI_SPLIT=\"${ANDROID_ABI_SPLIT}\";ANDROID_ABI_INCLUDE=\"${ANDROID_ABI_INCLUDE}\";}"
|
2019-09-10 09:50:09 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if is_macos; then
|
|
|
|
# Start a watchman instance if not started already and store its socket path.
|
|
|
|
# In order to get access to the right versions of watchman and jq, we start an ad-hoc nix-shell that imports the packages from nix/nixpkgs-bootstrap.
|
2020-01-13 14:28:40 +00:00
|
|
|
WATCHMAN_SOCKFILE=$(watchman get-sockname --no-pretty | jq -r .sockname)
|
2019-09-10 09:50:09 +00:00
|
|
|
nixOpts+=(
|
|
|
|
"--argstr watchmanSockPath ${WATCHMAN_SOCKFILE}"
|
|
|
|
"--option extra-sandbox-paths ${STORE_FILE};${WATCHMAN_SOCKFILE}"
|
|
|
|
)
|
|
|
|
else
|
|
|
|
nixOpts+=(
|
|
|
|
"--option extra-sandbox-paths ${STORE_FILE}"
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
|
2019-11-29 10:20:08 +00:00
|
|
|
${GIT_ROOT}/nix/scripts/build.sh targets.mobile.android.release "${nixOpts[@]}"
|