diff options
-rw-r--r-- | iphone/Maps/Maps.xcodeproj/project.pbxproj | 32 | ||||
-rw-r--r-- | tools/autobuild/build.sh | 3 | ||||
-rw-r--r-- | tools/autobuild/detect_xcode.sh | 35 | ||||
-rw-r--r-- | tools/autobuild/ios.sh | 46 |
4 files changed, 113 insertions, 3 deletions
diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 6ace2d58b9..bbabd5dc5e 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -2883,6 +2883,7 @@ isa = PBXNativeTarget; buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "MapsWithMe Pro" */; buildPhases = ( + FA3A60E715AD5BBD00F40D20 /* ShellScript */, 1D60588D0D05DD3D006BFB54 /* Resources */, 1D60588E0D05DD3D006BFB54 /* Sources */, 1D60588F0D05DD3D006BFB54 /* Frameworks */, @@ -2901,6 +2902,7 @@ isa = PBXNativeTarget; buildConfigurationList = FAFB0913151215EE0041901D /* Build configuration list for PBXNativeTarget "MapsWithMe Lite" */; buildPhases = ( + FA78191C15C5F673009E0278 /* ShellScript */, FAFB06AA151215EE0041901D /* Resources */, FAFB08E8151215EE0041901D /* Sources */, FAFB08FA151215EE0041901D /* Frameworks */, @@ -4163,6 +4165,19 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + FA3A60E715AD5BBD00F40D20 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + 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"; + }; FA40A8FF149B86E400AD1225 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 12; @@ -4173,9 +4188,22 @@ outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; + shellPath = /bin/bash; shellScript = "LOWERED_CONFIG=`echo $CONFIGURATION | tr [A-Z] [a-z]`\nif [[ \"$LOWERED_CONFIG\" != *production* ]]; 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; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + 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; @@ -4186,7 +4214,7 @@ outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; + shellPath = /bin/bash; shellScript = "LOWERED_CONFIG=`echo $CONFIGURATION | tr [A-Z] [a-z]`\nif [[ \"$LOWERED_CONFIG\" != *production* ]]; 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\"\n echo \"Using countries.txt without search support\"\n mv \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/countries.txt.nosearch\" \"$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/countries.txt\"\nfi"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/tools/autobuild/build.sh b/tools/autobuild/build.sh index 442c1670b9..691d384474 100644 --- a/tools/autobuild/build.sh +++ b/tools/autobuild/build.sh @@ -1,6 +1,7 @@ set -e -x -LOCAL_DIRNAME="${PWD}/$(dirname "$0")" +LOCAL_DIRNAME="$(dirname "$0")" +#LOCAL_DIRNAME="${PWD}/$(dirname "$0")" source "$LOCAL_DIRNAME/detect_qmake.sh" diff --git a/tools/autobuild/detect_xcode.sh b/tools/autobuild/detect_xcode.sh new file mode 100644 index 0000000000..a57c9ac78b --- /dev/null +++ b/tools/autobuild/detect_xcode.sh @@ -0,0 +1,35 @@ +# Add your paths into these arrays +KNOWN_IOS_SDK_PATHS=( \ + /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk \ + /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/ +) + +KNOWN_IOS_SDK_SIMULATOR_PATHS=( \ + /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk \ + /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk +) + + +# Prints path to directory with iOS SDK +# Pameter is configuration name: <debug|release|production|simulator> +# Returns 1 in case of not found and 0 in case of success +PrintIOSSDKPath() { + PATHS_ARRAY="${KNOWN_IOS_SDK_PATHS[@]}" + if [[ $1 == "simulator" ]]; then + for path in "${KNOWN_IOS_SDK_SIMULATOR_PATHS[@]}"; do + if [ -d "${path}" ]; then + echo "${path}" + return 0 + fi + done + else + for path in "${KNOWN_IOS_SDK_PATHS[@]}"; do + if [ -d "${path}" ]; then + echo "${path}" + return 0 + fi + done + fi + # Not found + return 1 +} diff --git a/tools/autobuild/ios.sh b/tools/autobuild/ios.sh new file mode 100644 index 0000000000..68eba54280 --- /dev/null +++ b/tools/autobuild/ios.sh @@ -0,0 +1,46 @@ +# Script takes configuration as a parameter and optional clean keyword. +# Possible configurations: debug release production + +set -e -u -x + +LOCAL_DIRNAME="$(dirname "$0")" +#LOCAL_DIRNAME="${PWD}/$(dirname "$0")" + +if [[ $# < 1 ]]; then + echo "Usage: $0 <debug|release|production|simulator> [clean]" + exit 1 +fi +CONFIGURATION="$1" + +source "$LOCAL_DIRNAME/build.sh" +source "$LOCAL_DIRNAME/detect_xcode.sh" + +SDK_ROOT="$(PrintIOSSDKPath "$CONFIGURATION")" +if [[ $? -ne 0 ]]; then + echo "Is XCode installed? Check tools/autobuild/detect_xcode.sh script" + exit 1 +fi +export SDK_ROOT + +MKSPEC="$LOCAL_DIRNAME/../mkspecs/iphonedevice-llvm" +QMAKE_PARAMS="CONFIG+=${CONFIGURATION}" +if [[ $CONFIGURATION == "production" ]] ; then + QMAKE_PARAMS="$QMAKE_PARAMS CONFIG+=release" +fi + +SHADOW_DIR_BASE="$LOCAL_DIRNAME/../../../omim-iphone" + +if [[ $CONFIGURATION == "simulator" ]]; then + SHADOW_DIR="${SHADOW_DIR_BASE}sim-debug" + MKSPEC="$LOCAL_DIRNAME/../mkspecs/iphonesimulator-clang" +else + SHADOW_DIR="${SHADOW_DIR_BASE}-${CONFIGURATION}" + MKSPEC="$LOCAL_DIRNAME/../mkspecs/iphonedevice-llvm" +fi + +if [[ $# > 1 && "$2" == "clean" ]] ; then + echo "Cleaning $CONFIGURATION configuration..." + rm -rf "$SHADOW_DIR" +else + BuildQt "$SHADOW_DIR" "$MKSPEC" "$QMAKE_PARAMS" || ( echo "ERROR while building $CONFIGURATION config"; exit 1 ) +fi |