Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2017-05-30 12:02:20 +0300
committerIlya Zverev <ilya@zverev.info>2017-07-04 11:26:12 +0300
commit1fafff5b00b81e89056bc754589c2f3bc3a6aacd (patch)
tree7ec2809ea4feaf6b98a07b8a03672b7d9e6ed1ec /tools
parentaccc48d7b86be276efa07c2a7ee33bd72e66cd56 (diff)
Added possibility to run from IDE
Diffstat (limited to 'tools')
-rw-r--r--tools/autobuild/build_designer.sh58
-rwxr-xr-xtools/python/generate_styles_override.py4
-rw-r--r--tools/python/stylesheet/drules_info.py4
-rwxr-xr-xtools/unix/build_designer.sh13
-rwxr-xr-xtools/unix/generate_drules.sh3
-rwxr-xr-xtools/unix/generate_symbols.sh7
6 files changed, 23 insertions, 66 deletions
diff --git a/tools/autobuild/build_designer.sh b/tools/autobuild/build_designer.sh
deleted file mode 100644
index 2f5b77c11a..0000000000
--- a/tools/autobuild/build_designer.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/bash
-set -e -x -u
-
-MY_PATH="`dirname \"$0\"`" # relative
-MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
-
-source "$MY_PATH/detect_qmake.sh"
-
-# Prints number of cores to stdout
-GetCPUCores() {
- case "$OSTYPE" in
- # it's GitBash under Windows
- cygwin) echo $NUMBER_OF_PROCESSORS
- ;;
- linux-gnu) grep -c ^processor /proc/cpuinfo 2>/dev/null
- ;;
- darwin*) sysctl -n hw.ncpu
- ;;
- *) echo "Unsupported platform in $0"
- exit 1
- ;;
- esac
- return 0
-}
-
-
-# Replaces "/cygwin/c" prefix with "c:" one on Windows platform.
-# Does nothing under other OS.
-# 1st param: path to be modified.
-StripCygwinPrefix() {
- if [[ $(GetNdkHost) == "windows-x86_64" ]]; then
- echo "c:`(echo "$1" | cut -c 12-)`"
- return 0
- fi
-
- echo "$1"
- return 0
-}
-
-# 1st param: shadow directory path
-# 2nd param: mkspec
-# 3rd param: additional qmake parameters
-BuildQt() {
- (
- SHADOW_DIR="$1"
- MKSPEC="$2"
- QMAKE_PARAMS="$3"
-
- mkdir -p "$SHADOW_DIR"
- cd "$SHADOW_DIR"
- echo "Launching qmake..."
- # This call is needed to correctly rebuild c++ sources after switching between branches with added or removed source files.
- # Otherwise we get build errors.
- "$QMAKE" -r CONFIG-=sdk CONFIG+=map_designer "$QMAKE_PARAMS" -spec "$(StripCygwinPrefix $MKSPEC)" "$(StripCygwinPrefix $MY_PATH)/../../omim.pro"
-# make clean > /dev/null || true
- make -j $(GetCPUCores)
- )
-}
diff --git a/tools/python/generate_styles_override.py b/tools/python/generate_styles_override.py
index 4cf542ff8e..4620b35306 100755
--- a/tools/python/generate_styles_override.py
+++ b/tools/python/generate_styles_override.py
@@ -10,14 +10,14 @@ def copy_style_file(style_path, drules_suffix, target_path):
print('Path {0} is not found'.format(style_path))
return
- drules_proto_path = os.path.join(style_path, 'drules_proto.bin')
+ drules_proto_path = os.path.join(style_path, 'drules_proto_design.bin')
if not os.path.exists(drules_proto_path):
print('Path {0} is not found'.format(drules_proto_path))
return
shutil.copyfile(drules_proto_path, os.path.join(target_path, 'drules_proto' + drules_suffix + '.bin'))
for density in ['6plus', 'hdpi', 'mdpi', 'xhdpi', 'xxhdpi']:
- res_path = os.path.join(style_path, 'resources-' + density)
+ res_path = os.path.join(style_path, 'resources-' + density + "_design")
if os.path.exists(res_path):
shutil.copytree(res_path, os.path.join(target_path, 'resources-' + density + drules_suffix))
diff --git a/tools/python/stylesheet/drules_info.py b/tools/python/stylesheet/drules_info.py
index 5b0f2acec6..c3e83fa534 100644
--- a/tools/python/stylesheet/drules_info.py
+++ b/tools/python/stylesheet/drules_info.py
@@ -41,9 +41,9 @@ def GetClassesZoomRange(drules_path):
zooms[1] = elem.scale
if zooms[0] != -1:
if name in result:
- if result[name][0]< zooms[0]:
+ if result[name][0] < zooms[0]:
zooms[0] = result[name][0]
- if result[name][1]> zooms[1]:
+ if result[name][1] > zooms[1]:
zooms[1] = result[name][1]
result[name] = zooms
return result
diff --git a/tools/unix/build_designer.sh b/tools/unix/build_designer.sh
index c5d4462a71..3340ed4c7a 100755
--- a/tools/unix/build_designer.sh
+++ b/tools/unix/build_designer.sh
@@ -23,8 +23,13 @@ DVER
rm -rf "$RELEASE_PATH"
(
cd "$OMIM_PATH"
- ${QMAKE-qmake} omim.pro -r -spec macx-clang CONFIG+=release CONFIG+=x86_64 CONFIG+=map_designer CONFIG+=no-tests
- make -j8
+ ${QMAKE-qmake} omim.pro -r -spec macx-clang CONFIG+=release CONFIG+=x86_64 CONFIG+=map_designer_standalone CONFIG+=no-tests
+ TMP_FILE="build_error.log"
+ if ! make -j8 2> "$TMP_FILE"; then
+ echo '--------------------'
+ cat "$TMP_FILE"
+ exit 1
+ fi
)
# Prepare app package by copying Qt, Kothic, Skin Generator, Style tests
@@ -48,9 +53,9 @@ cp "$OMIM_PATH/tools/python/generate_styles_override.py" "$MAC_RESOURCES/generat
rm -rf $MAC_RESOURCES/drules_proto*
rm -rf $MAC_RESOURCES/resources-*
for i in mdpi hdpi xhdpi xxhdpi 6plus; do
- cp -r $OMIM_PATH/data/resources-${i}_clear/ $MAC_RESOURCES/resources-$i/
+ cp -r $OMIM_PATH/data/resources-${i}_design/ $MAC_RESOURCES/resources-${i}_design/
done
-cp $OMIM_PATH/data/drules_proto_clear.bin $MAC_RESOURCES/drules_proto.bin
+cp $OMIM_PATH/data/drules_proto_design.bin $MAC_RESOURCES/drules_proto_design.bin
for i in resources-default countries-strings cuisine-strings WorldCoasts_obsolete.mwm countries.txt cuisines.txt countries_obsolete.txt packed_polygons.bin packed_polygons_obsolete.bin; do
cp -r $OMIM_PATH/data/$i $MAC_RESOURCES/
done
diff --git a/tools/unix/generate_drules.sh b/tools/unix/generate_drules.sh
index f5500eada2..766b524bdb 100755
--- a/tools/unix/generate_drules.sh
+++ b/tools/unix/generate_drules.sh
@@ -33,6 +33,9 @@ BuildDrawingRules clear night _dark
BuildDrawingRules vehicle clear _vehicle_clear
BuildDrawingRules vehicle night _vehicle_dark
+# In designer mode we use drules_proto_design file instead of standard ones
+cp $OMIM_PATH/data/drules_proto_clear.bin $OMIM_PATH/data/drules_proto_design.bin
+
echo "Merging default and vehicle styles"
python "$OMIM_PATH/tools/python/stylesheet/drules_merge.py" \
"$DATA_PATH/drules_proto_clear.bin" "$DATA_PATH/drules_proto_vehicle_clear.bin" \
diff --git a/tools/unix/generate_symbols.sh b/tools/unix/generate_symbols.sh
index ce2305d6c8..efd355bd3c 100755
--- a/tools/unix/generate_symbols.sh
+++ b/tools/unix/generate_symbols.sh
@@ -108,5 +108,12 @@ BuildSkin clear clear xhdpi 44 false _clear symbols-ad -ad
BuildSkin clear clear xxhdpi 68 false _clear symbols-ad -ad
BuildSkin clear clear 6plus 68 false _clear symbols-ad -ad
+rm -rf $OMIM_PATH/data/resources-{*}
+
+rm -rf $OMIM_PATH/data/resources-*_design
+for i in mdpi hdpi xhdpi xxhdpi 6plus; do
+ cp -r $OMIM_PATH/data/resources-${i}_clear/ $OMIM_PATH/data/resources-${i}_design/
+done
+
echo "Generate local ads symbols"
python "$LOCAL_ADS_SYMBOLS_GENERATOR" "$DATA_PATH/styles" "$DATA_PATH"