diff options
author | Ilya Zverev <zverik@textual.ru> | 2016-01-18 18:58:45 +0300 |
---|---|---|
committer | Ilya Zverev <zverik@textual.ru> | 2016-01-19 19:25:39 +0300 |
commit | 0cd815603f183f744de4ea825c1d0c5079b16867 (patch) | |
tree | 43e583fd84bc0c28fa2169d219577b5592b8dfa5 /tools/android | |
parent | 847e46a96c95da12eccb27f4dde7fab1c4aab050 (diff) |
[build] Fixed paths in scripts
Diffstat (limited to 'tools/android')
-rwxr-xr-x | tools/android/add_assets_mwm-ttf.sh | 9 | ||||
-rwxr-xr-x | tools/android/update_assets.sh | 7 | ||||
-rwxr-xr-x | tools/android/update_assets_for_version.sh | 13 | ||||
-rwxr-xr-x | tools/android/update_assets_yota.sh | 18 |
4 files changed, 27 insertions, 20 deletions
diff --git a/tools/android/add_assets_mwm-ttf.sh b/tools/android/add_assets_mwm-ttf.sh index 2446de647e..51e8cd093e 100755 --- a/tools/android/add_assets_mwm-ttf.sh +++ b/tools/android/add_assets_mwm-ttf.sh @@ -1,13 +1,14 @@ #!/bin/bash -set -x -u +set -e -u -SRC=../../../data -DST=$1 +[ $# -lt 2 ] && echo "Usage: $0 <source> <dest>" && exit 1 +SRC="$1" +DST="$2" files=(World.mwm WorldCoasts.mwm \ 01_dejavusans.ttf 02_droidsans-fallback.ttf 03_jomolhari-id-a3d.ttf 04_padauk.ttf 05_khmeros.ttf 06_code2000.ttf) for item in ${files[*]} do - ln -s -f $SRC/$item $DST/$item + ln -s -f "$SRC/$item" "$DST/$item" done diff --git a/tools/android/update_assets.sh b/tools/android/update_assets.sh index 4faf087177..7509b8f69e 100755 --- a/tools/android/update_assets.sh +++ b/tools/android/update_assets.sh @@ -1,2 +1,5 @@ -./update_assets_for_version.sh ../../data ../../android/assets -./add_assets_mwm-ttf.sh ../../android/flavors/mwm-ttf-assets +#!/bin/bash +SCRIPTS_PATH="$(dirname "$0")" +OMIM_PATH="${OMIM_PATH:-$SCRIPTS_PATH/../..}" +"$SCRIPTS_PATH/update_assets_for_version.sh" "$OMIM_PATH/data" "$OMIM_PATH/android/assets" +"$SCRIPTS_PATH/add_assets_mwm-ttf.sh" "$OMIM_PATH/data" "$OMIM_PATH/android/flavors/mwm-ttf-assets" diff --git a/tools/android/update_assets_for_version.sh b/tools/android/update_assets_for_version.sh index a22d62988d..9764a0829a 100755 --- a/tools/android/update_assets_for_version.sh +++ b/tools/android/update_assets_for_version.sh @@ -1,12 +1,13 @@ #!/bin/bash -set -e -x -u +set -e -u -SRC=$1 -DST=$2 +[ $# -lt 2 ] && echo "Usage: $0 <source> <dest>" && exit 1 +SRC="$1" +DST="$2" # Remove old links -rm -rf $DST || true -mkdir $DST || true +rm -rf "$DST" || true +mkdir "$DST" || true files=(copyright.html faq.html resources-default resources-ldpi_legacy resources-mdpi_legacy resources-hdpi_legacy resources-xhdpi_legacy resources-xxhdpi_legacy categories.txt classificator.txt resources-ldpi_dark resources-mdpi_dark resources-hdpi_dark resources-xhdpi_dark resources-xxhdpi_dark @@ -17,5 +18,5 @@ files=(copyright.html faq.html resources-default resources-ldpi_legacy resources for item in ${files[*]} do - ln -s $SRC/$item $DST/$item + ln -s "$SRC/$item" "$DST/$item" done diff --git a/tools/android/update_assets_yota.sh b/tools/android/update_assets_yota.sh index eff665e550..a7749bbe09 100755 --- a/tools/android/update_assets_yota.sh +++ b/tools/android/update_assets_yota.sh @@ -1,15 +1,17 @@ #!/bin/bash -set -x -u +set -u # Pre-installed lite version apk should have a reference to mwm and ttf assets in the gradle file # Yota 1st generation -SRC=../../../data -DST=../../android/YoPme/assets +SCRIPTS_PATH="$(dirname "$0")" +OMIM_PATH="${OMIM_PATH:-$SCRIPTS_PATH/../..}" +SRC="$OMIM_PATH/data" +DST="$OMIM_PATH/android/YoPme/assets" -./update_assets_for_version.sh $SRC $DST -./add_assets_mwm-ttf.sh $DST +"$SCRIPTS_PATH/update_assets_for_version.sh" "$SRC" "$DST" +"$SCRIPTS_PATH/add_assets_mwm-ttf.sh" "$SRC" "$DST" rm -rf $DST/drules_proto_legacy.bin @@ -43,10 +45,10 @@ ln -s $SRC/resources-yota_legacy $DST/resources-mdpi_legacy # Yota 2nd generation -DST=../../android/YoPme2/assets +DST="$OMIM_PATH/android/YoPme2/assets" -./update_assets_for_version.sh $SRC $DST -./add_assets_mwm-ttf.sh $DST +"$SCRIPTS_PATH/update_assets_for_version.sh" "$SRC" "$DST" +"$SCRIPTS_PATH/add_assets_mwm-ttf.sh" "$SRC" "$DST" rm -rf $DST/drules_proto_legacy.bin |