diff --git a/3party/protobuf/protobuf.pro b/3party/protobuf/protobuf.pro index 6718a6fb6d..908ba63122 100644 --- a/3party/protobuf/protobuf.pro +++ b/3party/protobuf/protobuf.pro @@ -11,7 +11,7 @@ include($$ROOT_DIR/common.pri) !win32:DEFINES += HAVE_PTHREAD -win32-msvc2008 { +win32-msvc* { # Signed/unsigned comparison warning. Conversion from double to float. QMAKE_CXXFLAGS *= -wd4018 -wd4244 -wd4355 } @@ -20,8 +20,8 @@ unix|win32-g++ { QMAKE_CXXFLAGS_WARN_ON += -Wno-unused -Wno-extra } -CONFIG(production) { +# Lite runtime files are included in all platforms and devices SOURCES += \ src/google/protobuf/stubs/common.cc \ src/google/protobuf/stubs/once.cc \ @@ -34,32 +34,23 @@ SOURCES += \ src/google/protobuf/io/zero_copy_stream.cc \ src/google/protobuf/io/zero_copy_stream_impl_lite.cc \ -} else { +# Full runtime files are included only in desktop configs +linux-*|win32-*|macx-* { SOURCES += \ src/google/protobuf/descriptor.cc \ src/google/protobuf/descriptor.pb.cc \ src/google/protobuf/descriptor_database.cc \ src/google/protobuf/dynamic_message.cc \ - src/google/protobuf/extension_set.cc \ src/google/protobuf/extension_set_heavy.cc \ - src/google/protobuf/generated_message_util.cc \ src/google/protobuf/generated_message_reflection.cc \ src/google/protobuf/message.cc \ - src/google/protobuf/message_lite.cc \ src/google/protobuf/reflection_ops.cc \ - src/google/protobuf/repeated_field.cc \ src/google/protobuf/text_format.cc \ src/google/protobuf/unknown_field_set.cc \ src/google/protobuf/wire_format.cc \ - src/google/protobuf/wire_format_lite.cc \ - src/google/protobuf/io/coded_stream.cc \ src/google/protobuf/io/tokenizer.cc \ - src/google/protobuf/io/zero_copy_stream.cc \ src/google/protobuf/io/zero_copy_stream_impl.cc \ - src/google/protobuf/io/zero_copy_stream_impl_lite.cc \ - src/google/protobuf/stubs/common.cc \ - src/google/protobuf/stubs/once.cc \ src/google/protobuf/stubs/stringprintf.cc \ src/google/protobuf/stubs/structurally_valid.cc \ src/google/protobuf/stubs/strutil.cc \ diff --git a/android/MapsWithMeLite.Samsung/custom_rules.xml b/android/MapsWithMeLite.Samsung/custom_rules.xml index 4a82b8d14d..caf3bbb5c6 100644 --- a/android/MapsWithMeLite.Samsung/custom_rules.xml +++ b/android/MapsWithMeLite.Samsung/custom_rules.xml @@ -35,8 +35,7 @@ - diff --git a/android/MapsWithMeLite/custom_rules.xml b/android/MapsWithMeLite/custom_rules.xml index 4a82b8d14d..caf3bbb5c6 100644 --- a/android/MapsWithMeLite/custom_rules.xml +++ b/android/MapsWithMeLite/custom_rules.xml @@ -35,8 +35,7 @@ - diff --git a/android/MapsWithMePro/custom_rules.xml b/android/MapsWithMePro/custom_rules.xml index 4a82b8d14d..caf3bbb5c6 100644 --- a/android/MapsWithMePro/custom_rules.xml +++ b/android/MapsWithMePro/custom_rules.xml @@ -35,8 +35,7 @@ - diff --git a/android/MapsWithMeTest/custom_rules.xml b/android/MapsWithMeTest/custom_rules.xml index 4a82b8d14d..caf3bbb5c6 100644 --- a/android/MapsWithMeTest/custom_rules.xml +++ b/android/MapsWithMeTest/custom_rules.xml @@ -35,8 +35,7 @@ - diff --git a/android/common_custom_rules.xml b/android/common_custom_rules.xml index b6f3c2ae5a..7dea17dcf8 100644 --- a/android/common_custom_rules.xml +++ b/android/common_custom_rules.xml @@ -4,24 +4,10 @@ - - - - - - - - - - - - + - - - - + diff --git a/data/World.mwm.nosearch b/data/World.mwm.nosearch deleted file mode 100644 index 27995fe27d..0000000000 Binary files a/data/World.mwm.nosearch and /dev/null differ diff --git a/defines.hpp b/defines.hpp index 93d138b847..215ca86e16 100644 --- a/defines.hpp +++ b/defines.hpp @@ -31,7 +31,6 @@ #define EXTERNAL_RESOURCES_FILE "external_resources.txt" -#define DRAWING_RULES_TXT_FILE "drules_proto.txt" #define DRAWING_RULES_BIN_FILE "drules_proto.bin" /// How many langs we're supporting on indexing stage diff --git a/generator/generator_tool/generator_tool.cpp b/generator/generator_tool/generator_tool.cpp index 063ff20fdc..a620291aeb 100644 --- a/generator/generator_tool/generator_tool.cpp +++ b/generator/generator_tool/generator_tool.cpp @@ -29,13 +29,14 @@ #include "../../std/iomanip.hpp" #include "../../std/numeric.hpp" +// Use txt rules only in generator. @todo kill'em totally in the future! +#define DRAWING_RULES_TEXT_FILE "drules_proto.txt" + DEFINE_bool(generate_update, false, "If specified, update.maps file will be generated from cells in the data path"); -#ifndef OMIM_PRODUCTION DEFINE_bool(generate_classif, false, "Generate classificator."); -#endif DEFINE_bool(preprocess_xml, false, "1st pass - create nodes/ways/relations data"); DEFINE_bool(make_coasts, false, "create intermediate file with coasts data"); @@ -91,21 +92,19 @@ int main(int argc, char ** argv) string const path = FLAGS_data_path.empty() ? pl.WritableDir() : AddSlashIfNeeded(FLAGS_data_path); -#ifndef OMIM_PRODUCTION // Make a classificator if (FLAGS_generate_classif) { drule::RulesHolder & rules = drule::rules(); string buffer; - ModelReaderPtr(pl.GetReader(DRAWING_RULES_TXT_FILE)).ReadAsString(buffer); + ModelReaderPtr(pl.GetReader(DRAWING_RULES_TEXT_FILE)).ReadAsString(buffer); rules.LoadFromTextProto(buffer); ofstream s((path + DRAWING_RULES_BIN_FILE).c_str(), ios::out | ios::binary); rules.SaveToBinaryProto(buffer, s); } -#endif // Generating intermediate files if (FLAGS_preprocess_xml) diff --git a/indexer/classificator_loader.cpp b/indexer/classificator_loader.cpp index 9d3e31f962..9015a63552 100644 --- a/indexer/classificator_loader.cpp +++ b/indexer/classificator_loader.cpp @@ -50,19 +50,10 @@ namespace classificator //LOG(LINFO, ("Reading of drawing rules")); drule::RulesHolder & rules = drule::rules(); -#if defined(OMIM_PRODUCTION) // Load from proto buffer binary file. string buffer; ModelReaderPtr(p.GetReader(DRAWING_RULES_BIN_FILE)).ReadAsString(buffer); - rules.LoadFromBinaryProto(buffer); -#else - // Load from proto buffer text file. - string buffer; - ModelReaderPtr(p.GetReader(DRAWING_RULES_TXT_FILE)).ReadAsString(buffer); - - rules.LoadFromTextProto(buffer); -#endif LOG(LDEBUG, ("Reading of classificator finished")); } diff --git a/indexer/drawing_rules.cpp b/indexer/drawing_rules.cpp index 8eb9adc53f..b69fdf6a06 100644 --- a/indexer/drawing_rules.cpp +++ b/indexer/drawing_rules.cpp @@ -1,14 +1,9 @@ -#include "../base/SRC_FIRST.hpp" +#include "../std/target_os.hpp" #include "drawing_rules.hpp" #include "scales.hpp" #include "classificator.hpp" - -#ifdef OMIM_PRODUCTION - #include "drules_struct_lite.pb.h" -#else - #include "drules_struct.pb.h" -#endif +#include "drules_include.hpp" #include "../std/bind.hpp" #include "../std/iterator_facade.hpp" @@ -373,7 +368,7 @@ namespace }; } -#ifndef OMIM_PRODUCTION +#ifdef OMIM_OS_DESKTOP void RulesHolder::LoadFromTextProto(string const & buffer) { Clean(); diff --git a/indexer/drawing_rules.hpp b/indexer/drawing_rules.hpp index 575673cee6..a266f96a0a 100644 --- a/indexer/drawing_rules.hpp +++ b/indexer/drawing_rules.hpp @@ -9,6 +9,7 @@ #include "../std/array.hpp" #include "../std/string.hpp" #include "../std/iostream.hpp" +#include "../std/target_os.hpp" class LineDefProto; @@ -79,7 +80,7 @@ namespace drule BaseRule const * Find(Key const & k) const; -#ifndef OMIM_PRODUCTION +#ifdef OMIM_OS_DESKTOP void LoadFromTextProto(string const & buffer); static void SaveToBinaryProto(string const & buffer, ostream & s); #endif diff --git a/indexer/drules_include.hpp b/indexer/drules_include.hpp new file mode 100644 index 0000000000..476c937cf1 --- /dev/null +++ b/indexer/drules_include.hpp @@ -0,0 +1,9 @@ +#pragma once + +#include "../std/target_os.hpp" + +#ifdef OMIM_OS_DESKTOP + #include "drules_struct.pb.h" +#else + #include "drules_struct_lite.pb.h" +#endif diff --git a/indexer/indexer.pro b/indexer/indexer.pro index 393cc5a6ec..416015dadd 100644 --- a/indexer/indexer.pro +++ b/indexer/indexer.pro @@ -86,17 +86,17 @@ HEADERS += \ search_delimiters.hpp \ mwm_set.hpp \ categories_holder.hpp \ - drules_struct.pb.h \ string_file.hpp \ feature_algo.hpp \ mwm_version.hpp \ + drules_include.hpp \ OTHER_FILES += drules_struct.proto -CONFIG(production) { - SOURCES += drules_struct_lite.pb.cc - HEADERS += drules_struct_lite.pb.h -} else { +macx-*|win32-*|linux-* { SOURCES += drules_struct.pb.cc HEADERS += drules_struct.pb.h +} else { + SOURCES += drules_struct_lite.pb.cc + HEADERS += drules_struct_lite.pb.h } diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 2e4b632691..a5dc2eeb24 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -3007,7 +3007,6 @@ 1D60588D0D05DD3D006BFB54 /* Resources */, 1D60588E0D05DD3D006BFB54 /* Sources */, 1D60588F0D05DD3D006BFB54 /* Frameworks */, - FA40A8FF149B86E400AD1225 /* ShellScript */, ); buildRules = ( ); @@ -3026,7 +3025,6 @@ FAFB06AA151215EE0041901D /* Resources */, FAFB08E8151215EE0041901D /* Sources */, FAFB08FA151215EE0041901D /* Frameworks */, - FAFB0912151215EE0041901D /* ShellScript */, ); buildRules = ( ); @@ -4302,19 +4300,6 @@ shellPath = /bin/bash; shellScript = "LOWERED_CONFIG=`echo $CONFIGURATION | tr [A-Z] [a-z]`\nCONF=\"simulator\"\nif [[ \"$LOWERED_CONFIG\" == *production* || \"$LOWERED_CONFIG\" == *adhoc* ]]; then\n CONF=\"production\"\nelif [[ \"$LOWERED_CONFIG\" == *debug* ]]; then\n CONF=\"debug\"\nelif [[ \"$LOWERED_CONFIG\" == *release* ]]; then\n if [[ \"$LOWERED_CONFIG\" == *simulator* ]]; then\n CONF=\"simulator-release\"\n else\n CONF=\"release\"\n fi\nfi\n\necho \"Building $CONF configuration\"\nbash \"$SRCROOT/../../tools/autobuild/ios.sh\" $CONF"; }; - FA40A8FF149B86E400AD1225 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 12; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/bash; - shellScript = "LOWERED_CONFIG=`echo $CONFIGURATION | tr [A-Z] [a-z]`\nif [[ \"$LOWERED_CONFIG\" != *production* && \"$LOWERED_CONFIG\" != *adhoc* ]]; then\n echo \"Copy drules_proto.txt in non-production build\"\n cp \"$SRCROOT/../../data/drules_proto.txt\" \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/\"\nfi"; - }; FA78191C15C5F673009E0278 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -4328,19 +4313,6 @@ shellPath = /bin/bash; shellScript = "LOWERED_CONFIG=`echo $CONFIGURATION | tr [A-Z] [a-z]`\nCONF=\"simulator\"\nif [[ \"$LOWERED_CONFIG\" == *production* || \"$LOWERED_CONFIG\" == *adhoc* ]]; then\n CONF=\"production\"\nelif [[ \"$LOWERED_CONFIG\" == *debug* ]]; then\n CONF=\"debug\"\nelif [[ \"$LOWERED_CONFIG\" == *release* ]]; then\n CONF=\"release\"\nfi\n\necho \"Building $CONF configuration\"\nbash \"$SRCROOT/../../tools/autobuild/ios.sh\" $CONF"; }; - FAFB0912151215EE0041901D /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 12; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/bash; - shellScript = "LOWERED_CONFIG=`echo $CONFIGURATION | tr [A-Z] [a-z]`\nif [[ \"$LOWERED_CONFIG\" != *production* && \"$LOWERED_CONFIG\" != *adhoc* ]]; then\n echo \"Copy drules_proto.txt in non-production build\"\n cp \"$SRCROOT/../../data/drules_proto.txt\" \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/\"\nfi\nif [[ \"$LOWERED_CONFIG\" == *lite* ]]; then\n echo \"Using World file without search index\"\n mv \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/World.mwm.nosearch\" \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/World.mwm\"\nfi"; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/map/drawer.cpp b/map/drawer.cpp index 923152e57d..2a39857eba 100644 --- a/map/drawer.cpp +++ b/map/drawer.cpp @@ -12,12 +12,7 @@ #include "../graphics/resource_manager.hpp" #include "../graphics/straight_text_element.hpp" -#ifdef OMIM_PRODUCTION - #include "../indexer/drules_struct_lite.pb.h" -#else - #include "../indexer/drules_struct.pb.h" -#endif - +#include "../indexer/drules_include.hpp" #include "../indexer/feature.hpp" #include "../geometry/screenbase.hpp" diff --git a/map/feature_styler.cpp b/map/feature_styler.cpp index f0ff6fe72d..317f8797a3 100644 --- a/map/feature_styler.cpp +++ b/map/feature_styler.cpp @@ -6,12 +6,7 @@ #include "../indexer/feature.hpp" #include "../indexer/feature_visibility.hpp" #include "../indexer/scales.hpp" - -#ifdef OMIM_PRODUCTION - #include "../indexer/drules_struct_lite.pb.h" -#else - #include "../indexer/drules_struct.pb.h" -#endif +#include "../indexer/drules_include.hpp" #include "../geometry/screenbase.hpp" diff --git a/map/framework.cpp b/map/framework.cpp index 63e9b6cdd3..38e1642dee 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -228,7 +228,7 @@ Framework::Framework() m_informationDisplay.enableRuler(true); m_informationDisplay.setRulerParams(m_minRulerWidth, m_metresMinWidth, m_metresMaxWidth); -#ifndef OMIM_PRODUCTION +#ifdef DEBUG m_informationDisplay.enableDebugInfo(true); #endif diff --git a/map/proto_to_styles.cpp b/map/proto_to_styles.cpp index 732007f440..ebc32fdf00 100644 --- a/map/proto_to_styles.cpp +++ b/map/proto_to_styles.cpp @@ -1,11 +1,6 @@ #include "proto_to_styles.hpp" -#ifdef OMIM_PRODUCTION - #include "../indexer/drules_struct_lite.pb.h" -#else - #include "../indexer/drules_struct.pb.h" -#endif - +#include "../indexer/drules_include.hpp" #include "../std/algorithm.hpp" diff --git a/platform/platform_tests/platform_test.cpp b/platform/platform_tests/platform_test.cpp index f2d290e629..e25b8baaaf 100644 --- a/platform/platform_tests/platform_test.cpp +++ b/platform/platform_tests/platform_test.cpp @@ -41,7 +41,6 @@ UNIT_TEST(GetReader) { char const * NON_EXISTING_FILE = "mgbwuerhsnmbui45efhdbn34.tmp"; char const * arr[] = { - "drules_proto.txt", "resources-ldpi/basic.skn", "classificator.txt", "minsk-pass.mwm" diff --git a/qt/qt.pro b/qt/qt.pro index de2d0da384..ab1cab431f 100644 --- a/qt/qt.pro +++ b/qt/qt.pro @@ -43,12 +43,8 @@ linux* { ../data/packed_polygons.bin res/logo.png CLASSIFICATOR_RES.path = $$RESDIR CLASSIFICATOR_RES.files = ../data/classificator.txt \ - ../data/types.txt - CONFIG(production) { - CLASSIFICATOR_RES.files += ../data/drules_proto.bin - } else { - CLASSIFICATOR_RES.files += ../data/drules_proto.txt - } + ../data/types.txt \ + ../data/drules_proto.bin MDPI_SKIN_RES.path = $$RESDIR/resources-mdpi MDPI_SKIN_RES.files = ../data/resources-mdpi/basic.skn ../data/resources-mdpi/symbols.png XHDPI_SKIN_RES.path = $$RESDIR/resources-xhdpi @@ -95,12 +91,8 @@ macx-* { ../data/packed_polygons.bin CLASSIFICATOR_RES.path = Contents/Resources CLASSIFICATOR_RES.files = ../data/classificator.txt \ - ../data/types.txt - CONFIG(production) { - CLASSIFICATOR_RES.files += ../data/drules_proto.bin - } else { - CLASSIFICATOR_RES.files += ../data/drules_proto.txt - } + ../data/types.txt \ + ../data/drules_proto.bin SKIN_RES.path = Contents/Resources SKIN_RES.files = ../data/resources-mdpi/basic.skn ../data/resources-mdpi/symbols.png FONT_RES.path = Contents/Resources diff --git a/tools/android/update_assets_for_version.sh b/tools/android/update_assets_for_version.sh index 3d25904064..4530fac6e9 100755 --- a/tools/android/update_assets_for_version.sh +++ b/tools/android/update_assets_for_version.sh @@ -10,12 +10,9 @@ mkdir $DST files=(about.html resources-ldpi resources-mdpi resources-hdpi resources-xhdpi resources-xxhdpi categories.txt classificator.txt types.txt fonts_blacklist.txt fonts_whitelist.txt languages.txt unicode_blocks.txt \ - drules_proto.txt drules_proto.bin external_resources.txt packed_polygons.bin android-guides.json) + drules_proto.bin external_resources.txt packed_polygons.bin android-guides.json countries.txt) for item in ${files[*]} do ln -s $SRC/$item $DST/$item done - -# Separate case for World and countries list files without search support -ln -s $SRC/countries.txt $DST/countries.txt diff --git a/tools/unix/planet.sh b/tools/unix/planet.sh index baa12cc445..2e70195f8c 100755 --- a/tools/unix/planet.sh +++ b/tools/unix/planet.sh @@ -169,8 +169,6 @@ if [[ $1 == "--generate" || $1 == "--continue" || $1 == "--full" ]]; then wait - # Save World without search index - cp "$DATA_PATH/World.mwm" "$DATA_PATH/World.mwm.nosearch" # Generate search index for World $GENERATOR_TOOL -data_path=$DATA_PATH -generate_search_index -output=World