[build] Fixed paths in scripts

This commit is contained in:
Ilya Zverev 2016-01-18 18:58:45 +03:00
parent 847e46a96c
commit 0cd815603f
9 changed files with 81 additions and 105 deletions

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -42,8 +42,6 @@ StripCygwinPrefix() {
# 3rd param: additional qmake parameters
BuildQt() {
(
# set qmake path
QMAKE="$(PrintQmakePath)" || ( echo "ERROR: qmake was not found, please add it to your PATH or into the tools/autobuild/detect_qmake.sh"; exit 1 )
SHADOW_DIR="$1"
MKSPEC="$2"
QMAKE_PARAMS="$3"

50
tools/autobuild/detect_qmake.sh Normal file → Executable file
View file

@ -1,40 +1,40 @@
#!/bin/bash
set -e -u
# If QMAKE variable is set, use it
[ -n "${QMAKE-}" -a -x "${QMAKE-}" ] && exit 0
# Add your path into this array
KNOWN_QMAKE_PATHS=( \
/Developer/Tools/qmake \
~/Developer/Qt-4.8.4/bin/qmake \
~/Developer/Qt/5.1.0/clang_64/bin/qmake \
~/Developer/Qt/5.1.1/clang_64/bin/qmake \
~/Developer/Qt/5.2.0/clang_64/bin/qmake \
~/Developer/Qt/5.2.1/clang_64/bin/qmake \
~/Qt/5.2.1/clang_64/bin/qmake \
/usr/local/opt/qt5/bin/qmake \
~/Developer/Qt/5.3/clang_64/bin/qmake \
~/Developer/Qt/5.5/clang_64/bin/qmake \
~/Qt/5.3/clang_64/bin/qmake \
~/Qt/5.4/clang_64/bin/qmake \
~/Qt/5.5/clang_64/bin/qmake \
~/Qt5.3.0/5.3/clang_64/bin/qmake \
~/Developer/Qt/5.4/clang_64/bin/qmake \
~/Developer/Qt/5.5/clang_64/bin/qmake \
/usr/local/opt/qt5/bin/qmake \
/cygdrive/c/Qt/5.5/msvc2013_64/bin/qmake.exe \
)
# Prints path to directory with found qmake binary or prints nothing if not found
# Returns 1 in case of not found and 0 in case of success
PrintQmakePath() {
local QMAKE_PATH
QMAKE_PATH=$(which qmake)
if [ $? -ne 0 ]; then
# qmake binary is not in the path, look for it in the given array
for path in "${KNOWN_QMAKE_PATHS[@]}"; do
if [ -f "${path}" ]; then
echo "${path}"
return 0
fi
done
else
echo "${QMAKE_PATH}"
return 0
fi
# Not found
return 1
}
if QMAKE="$(which qmake-qt5)"; then
return 0
elif QMAKE="$(which qmake)"; then
return 0
else
# qmake binary is not in the path, look for it in the given array
for path in "${KNOWN_QMAKE_PATHS[@]}"; do
if [ -x "${path}" ]; then
QMAKE="${path}"
return 0
fi
done
fi
# Not found
echo "ERROR: qmake was not found, please add it to your PATH or into the tools/autobuild/detect_qmake.sh"
exit 1

View file

@ -50,12 +50,7 @@ else
fi
# Find qmake, prefer qmake-qt5
if [ ! -x "${QMAKE-}" ]; then
QMAKE=qmake-qt5
if ! hash "$QMAKE" 2>/dev/null; then
QMAKE=qmake
fi
fi
source "$OMIM_PATH/tools/autobuild/detect_qmake.sh"
# Find cmake, prefer cmake28
if [ ! -x "${CMAKE-}" ]; then

View file

@ -1,21 +1,10 @@
#!/bin/bash
set -e -u -x
set -e -u
MY_PATH=`pwd`
SCRIPTS_PATH="$(dirname "$0")"
"$SCRIPTS_PATH/generate_symbols.sh"
"$SCRIPTS_PATH/generate_drules.sh"
sh ./generate_symbols.sh
sh ./generate_drules.sh
cd ../android
scripts=(update_assets.sh update_assets_yota.sh)
for item in ${scripts[*]}
do
sh $item
done
cd $MY_PATH
echo "Done"
exit 0 # ok
ANDROID_PATH="$SCRIPTS_PATH/../android"
"$ANDROID_PATH/update_assets.sh"
"$ANDROID_PATH/update_assets_yota.sh"

View file

@ -1,32 +1,26 @@
#!/bin/bash
set -e -u -x
set -e -u
MY_PATH=`pwd`
BINARY_PATH="$MY_PATH/../../out/release/skin_generator"
DATA_PATH="$MY_PATH/../../data"
DETECT_QMAKE="$MY_PATH/../autobuild/detect_qmake.sh"
source "$DETECT_QMAKE"
QMAKE="$(PrintQmakePath)" || ( echo "ERROR: qmake was not found, please add it to your PATH or into the tools/autobuild/detect_qmake.sh"; exit 1 )
OMIM_PATH="${OMIM_PATH:-$(cd "$(dirname "$0")/../.."; pwd)}"
SKIN_GENERATOR="$OMIM_PATH/out/release/skin_generator"
DATA_PATH="$OMIM_PATH/data"
# If skin_generator does not exist then build it
if [ ! -f $BINARY_PATH ];
if [ ! -f $SKIN_GENERATOR ];
then
projects=(freetype gflags)
for project in ${projects[*]}
source "$OMIM_PATH/tools/autobuild/detect_qmake.sh"
for project in freetype gflags
do
cd $MY_PATH/../../3party/$project
cd "$OMIM_PATH/3party/$project"
"$QMAKE" $project.pro -r -spec macx-clang CONFIG+=x86_64
make
done
projects=(base coding geometry skin_generator)
for project in ${projects[*]}
for project in base coding geometry skin_generator
do
cd $MY_PATH/../../$project
cd "$OMIM_PATH/$project"
"$QMAKE" $project.pro -r -spec macx-clang CONFIG+=x86_64
make
done
cd $MY_PATH
fi
# Helper function to build skin
@ -45,21 +39,18 @@ function BuildSkin() {
suffix=${6-}
echo "Building skin for $styleName/$resourceName"
# Set environment
PNG_PATH="$DATA_PATH/styles/$styleType/style-$styleName/symbols/png"
rm -r $PNG_PATH || true
ln -s "$DATA_PATH/styles/$styleType/style-$styleName/$resourceName" $PNG_PATH
STYLE_PATH="$DATA_PATH/styles/$styleType/style-$styleName"
PNG_PATH="$STYLE_PATH/symbols/png"
rm -rf "$PNG_PATH" || true
ln -s "$STYLE_PATH/$resourceName" $PNG_PATH
# Run sking generator
if [ $colorCorrection = "true" ];
then
"$BINARY_PATH" --symbolWidth $symbolSize --symbolHeight $symbolSize \
--symbolsDir "$DATA_PATH/styles/$styleType/style-$styleName/symbols" \
--skinName "$DATA_PATH/resources-$resourceName$suffix/basic" --skinSuffix="" \
--colorCorrection true
if [ $colorCorrection = "true" ]; then
COLOR_CORR="--colorCorrection true"
else
"$BINARY_PATH" --symbolWidth $symbolSize --symbolHeight $symbolSize \
--symbolsDir "$DATA_PATH/styles/$styleType/style-$styleName/symbols" \
--skinName "$DATA_PATH/resources-$resourceName$suffix/basic" --skinSuffix=""
COLOR_CORR=
fi
"$SKIN_GENERATOR" --symbolWidth $symbolSize --symbolHeight $symbolSize --symbolsDir "$STYLE_PATH/symbols" \
--skinName "$DATA_PATH/resources-$resourceName$suffix/basic" --skinSuffix="" $COLOR_CORR
# Reset environment
rm -r $PNG_PATH || true
}
@ -68,8 +59,8 @@ function BuildSkin() {
cleanup=(resources-{yota_legacy,{6plus,ldpi,mdpi,hdpi,xhdpi,xxhdpi}{_legacy,_dark,_clear}})
for item in ${cleanup[*]}
do
rm -rf ../../data/$item || true
mkdir ../../data/$item
rm -rf "$DATA_PATH/$item" || true
mkdir "$DATA_PATH/$item"
done
# Build styles
@ -96,7 +87,3 @@ BuildSkin clear clear hdpi 27 false _clear
BuildSkin clear clear xhdpi 36 false _clear
BuildSkin clear clear xxhdpi 54 false _clear
BuildSkin clear clear 6plus 54 false _clear
# Success
echo "Done"
exit 0 # ok