diff options
author | Constantin Shalnev <c.shalnev@corp.mail.ru> | 2015-08-25 14:34:06 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:02:24 +0300 |
commit | 607474586452b9cbb1f763ac2452a999fbf0f205 (patch) | |
tree | 48b8a6424d26b1c4ca52cdbd8319273523474751 /tools | |
parent | 0d605c25135b573d31c44228b3e7b1706b444d96 (diff) |
Fixed script paths and added step for building clear style
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/android/update_assets_yota.sh | 12 | ||||
-rwxr-xr-x | tools/unix/generate_drules.sh | 32 | ||||
-rwxr-xr-x | tools/unix/generate_styles.sh | 13 | ||||
-rwxr-xr-x | tools/unix/generate_symbols.sh | 77 |
4 files changed, 65 insertions, 69 deletions
diff --git a/tools/android/update_assets_yota.sh b/tools/android/update_assets_yota.sh index 251c526025..e243ebd493 100755 --- a/tools/android/update_assets_yota.sh +++ b/tools/android/update_assets_yota.sh @@ -14,6 +14,7 @@ DST=../../android/YoPme/assets rm -rf $DST/drules_proto.bin rm -rf $DST/drules_proto_dark.bin +rm -rf $DST/drules_proto_clear.bin ln -s $SRC/drules_proto-bw.bin $DST/drules_proto.bin rm -rf $DST/resources-ldpi @@ -26,6 +27,11 @@ rm -rf $DST/resources-mdpi_dark rm -rf $DST/resources-hdpi_dark rm -rf $DST/resources-xhdpi_dark rm -rf $DST/resources-xxhdpi_dark +rm -rf $DST/resources-ldpi_clear +rm -rf $DST/resources-mdpi_clear +rm -rf $DST/resources-hdpi_clear +rm -rf $DST/resources-xhdpi_clear +rm -rf $DST/resources-xxhdpi_clear ln -s $SRC/resources-yota $DST/resources-mdpi # Yota 2nd generation @@ -38,6 +44,7 @@ DST=../../android/YoPme2/assets rm -rf $DST/drules_proto.bin rm -rf $DST/drules_proto_dark.bin +rm -rf $DST/drules_proto_clear.bin ln -s $SRC/drules_proto-bw.bin $DST/drules_proto.bin rm -rf $DST/resources-ldpi @@ -50,4 +57,9 @@ rm -rf $DST/resources-mdpi_dark rm -rf $DST/resources-hdpi_dark rm -rf $DST/resources-xhdpi_dark rm -rf $DST/resources-xxhdpi_dark +rm -rf $DST/resources-ldpi_clear +rm -rf $DST/resources-mdpi_clear +rm -rf $DST/resources-hdpi_clear +rm -rf $DST/resources-xhdpi_clear +rm -rf $DST/resources-xxhdpi_clear ln -s $SRC/resources-yota $DST/resources-mdpi diff --git a/tools/unix/generate_drules.sh b/tools/unix/generate_drules.sh index 173c25e292..85188e782e 100755 --- a/tools/unix/generate_drules.sh +++ b/tools/unix/generate_drules.sh @@ -3,36 +3,32 @@ set -e -u -x export PYTHONDONTWRITEBYTECODE=1 +DATA_PATH="$(dirname "$0")/../../data" + function BuildDrawingRules() { - styleName=$1 - suffix=$2 + styleType=$1 + styleName=$2 + suffix=${3-} echo "Building drawing rules for style $styleName" # Cleanup - rm ../../data/drules_proto$suffix.bin || true - rm ../../data/drules_proto$suffix.txt || true + rm $DATA_PATH/drules_proto$suffix.bin || true + rm $DATA_PATH/drules_proto$suffix.txt || true # Run script to build style - python ../kothic/libkomwm.py -s ../../data/styles/style-$styleName/style.mapcss \ - -o ../../data/drules_proto$suffix - res=$? - # Check result - if [ $res -ne 0 ]; then - echo "Error" - exit 1 # error - fi + python ../kothic/libkomwm.py -s $DATA_PATH/styles/$styleType/style-$styleName/style.mapcss \ + -o $DATA_PATH/drules_proto$suffix } # Cleanup cleanup=(classificator.txt types.txt visibility.txt) for item in ${cleanup[*]} do - rm ../../data/$item || true + rm $DATA_PATH/$item || true done -# Building drawing rules light -BuildDrawingRules light "" - -# Building drawing rules dark -BuildDrawingRules dark "_dark" +# Building drawing rules +BuildDrawingRules legacy light +BuildDrawingRules legacy dark _dark +BuildDrawingRules clear clear _clear echo "Done" exit 0 # ok diff --git a/tools/unix/generate_styles.sh b/tools/unix/generate_styles.sh index 50ef7508ed..90197eb7cb 100755 --- a/tools/unix/generate_styles.sh +++ b/tools/unix/generate_styles.sh @@ -4,16 +4,8 @@ set -e -u -x MY_PATH=`pwd` sh ./generate_symbols.sh -if [ $? -ne 0 ]; then - echo "Error" - exit 1 # error -fi sh ./generate_drules.sh -if [ $? -ne 0 ]; then - echo "Error" - exit 1 # error -fi cd ../android @@ -21,11 +13,6 @@ scripts=(update_assets.sh update_assets_yota.sh) for item in ${scripts[*]} do sh $item - if [ $? -ne 0 ]; then - cd $MY_PATH - echo "Error" - exit 1 # error - fi done cd $MY_PATH diff --git a/tools/unix/generate_symbols.sh b/tools/unix/generate_symbols.sh index 011d5bbad2..9467e6204f 100755 --- a/tools/unix/generate_symbols.sh +++ b/tools/unix/generate_symbols.sh @@ -26,71 +26,72 @@ then fi # Helper function to build skin -# Parameter $1 - style name (dark, light, yota, ...) -# Parameter $2 - resource name (ldpi, mdpi, hdpi, ...) -# Parameter $3 - symbol size -# Parameter $4 - does color correction required +# Parameter $1 - style type (legacy, clear) +# Parameter $2 - style name (dark, light, yota, clear, ...) +# Parameter $3 - resource name (ldpi, mdpi, hdpi, ...) +# Parameter $4 - symbol size +# Parameter $5 - does color correction required +# Parameter $6 - style suffix (none, _dark, _clear) function BuildSkin() { - styleName=$1 - resourceName=$2 - symbolSize=$3 - colorCorrection=$4 - suffix=$5 + styleType=$1 + styleName=$2 + resourceName=$3 + symbolSize=$4 + colorCorrection=$5 + suffix=${6-} echo "Building skin for $styleName/$resourceName" # Set environment - PNG_PATH="$DATA_PATH/styles/style-$styleName/symbols/png" + PNG_PATH="$DATA_PATH/styles/$styleType/style-$styleName/symbols/png" rm -r $PNG_PATH || true - ln -s "$DATA_PATH/styles/style-$styleName/$resourceName" $PNG_PATH + ln -s "$DATA_PATH/styles/$styleType/style-$styleName/$resourceName" $PNG_PATH # Run sking generator if [ $colorCorrection = "true" ]; then "$BINARY_PATH" --symbolWidth $symbolSize --symbolHeight $symbolSize \ - --symbolsDir "$DATA_PATH/styles/style-$styleName/symbols" \ + --symbolsDir "$DATA_PATH/styles/$styleType/style-$styleName/symbols" \ --skinName "$DATA_PATH/resources-$resourceName$suffix/basic" --skinSuffix="" \ --colorCorrection true else "$BINARY_PATH" --symbolWidth $symbolSize --symbolHeight $symbolSize \ - --symbolsDir "$DATA_PATH/styles/style-$styleName/symbols" \ + --symbolsDir "$DATA_PATH/styles/$styleType/style-$styleName/symbols" \ --skinName "$DATA_PATH/resources-$resourceName$suffix/basic" --skinSuffix="" fi - res=$? # Reset environment rm -r $PNG_PATH || true - # Check result - if [ $res -ne 0 ]; - then - echo "Error" - exit 1 # error - fi } # Cleanup -cleanup=(resources-yota resources-6plus resources-ldpi resources-mdpi resources-hdpi resources-xhdpi resources-xxhdpi \ - resources-6plus_dark resources-ldpi_dark resources-mdpi_dark resources-hdpi_dark resources-xhdpi_dark resources-xxhdpi_dark) +cleanup=(resources-{yota,{6plus,ldpi,mdpi,hdpi,xhdpi,xxhdpi}{,_dark,_clear}}) for item in ${cleanup[*]} do rm -rf ../../data/$item || true mkdir ../../data/$item done -# Build style yota -BuildSkin yota yota 19 true "" +# Build styles + +BuildSkin legacy yota yota 19 true + +BuildSkin legacy light ldpi 16 false +BuildSkin legacy light mdpi 16 false +BuildSkin legacy light hdpi 24 false +BuildSkin legacy light xhdpi 36 false +BuildSkin legacy light xxhdpi 48 false +BuildSkin legacy light 6plus 38 false -# Build style light -BuildSkin light ldpi 16 false "" -BuildSkin light mdpi 16 false "" -BuildSkin light hdpi 24 false "" -BuildSkin light xhdpi 36 false "" -BuildSkin light xxhdpi 48 false "" -BuildSkin light 6plus 38 false "" +BuildSkin legacy dark ldpi 16 false _dark +BuildSkin legacy dark mdpi 16 false _dark +BuildSkin legacy dark hdpi 24 false _dark +BuildSkin legacy dark xhdpi 36 false _dark +BuildSkin legacy dark xxhdpi 48 false _dark +BuildSkin legacy dark 6plus 38 false _dark -# Build style dark -BuildSkin dark ldpi 16 false "_dark" -BuildSkin dark mdpi 16 false "_dark" -BuildSkin dark hdpi 24 false "_dark" -BuildSkin dark xhdpi 36 false "_dark" -BuildSkin dark xxhdpi 48 false "_dark" -BuildSkin dark 6plus 38 false "_dark" +BuildSkin clear clear ldpi 16 false _clear +BuildSkin clear clear mdpi 16 false _clear +BuildSkin clear clear hdpi 24 false _clear +BuildSkin clear clear xhdpi 36 false _clear +BuildSkin clear clear xxhdpi 48 false _clear +BuildSkin clear clear 6plus 38 false _clear # Success echo "Done" |