diff --git a/android/custom_rules.xml b/android/custom_rules.xml index b25868950f..7c8a58b202 100644 --- a/android/custom_rules.xml +++ b/android/custom_rules.xml @@ -7,6 +7,10 @@ + + + + @@ -28,7 +32,7 @@ - + @@ -42,7 +46,7 @@ - + @@ -118,7 +122,7 @@ - + @@ -135,7 +139,7 @@ - + diff --git a/docs/android_toolchain_windows.txt b/docs/android_toolchain_windows.txt new file mode 100644 index 0000000000..eb335e6699 --- /dev/null +++ b/docs/android_toolchain_windows.txt @@ -0,0 +1,28 @@ +0. Install Android SDK to the path without spaces (e.g. C:\Projects\android-sdk) with platform-tools and latest Android API +1. Fix aapt tool in Android SDK, it's needed to create apks where some files are not compressed: + - Rename file android-sdk\platform-tools\aapt.exe to aapt2.exe + - Copy aapt.exe from repository omim/tools/android/aapt.exe to android-sdk\platform-tools\ folder +2. Install Android NDK to the path without spaces (e.g. C:\Projects\android-ndk) +3. Install msysgit to the path without spaces (e.g. C:\Projects\Git) +4. Install Apache ant to the path without spaces (e.g. C:\Projects\apache-ant) +5. Install mingw build of QT to the path without spaces (e.g. C:\Projects\Qt) +6. Install JDK and JRE +7. Launch GitBash console from msysgit +8. Create symlink to 'make' binary: + $ ln -s /c/Qt/SDK/mingw/bin/mingw32-make.exe /bin/make +9. Update PATH environment variable: + - Path to qmake for mingw build of QT + - Path to ant + $ export PATH=/c/Projects/Qt/Desktop/Qt//mingw/bin:/c/Projects/apache-ant/bin:$PATH +10.Set JAVA_HOME environment variable to JDK location + $ export JAVA_HOME='C:\Program Files (x86)\Java\jdk1.6.0_37' +11.Update symlinks to assets (this should be done when new asset is added or modified): + $ cd omim/tools/android + $ ./update_assets.sh # or bash update_assets.sh +12.Build omim static libraries and apk from GitBash: + $ cd omim/android/MapsWithMePro + $ ant debug + # You can also build release version or production version with 'ant release' or 'ant production' + +Bonus: PATH and JAVA_HOME can be set automatically when launching GitBash. To do that, insert export commands from 9. and 10. to C:\Users\\.bashrc +You can also automatically open GitBash on the repository folder (to perform build and git tasks) by adding 'cd /c/Projects/omim' to .bashrc diff --git a/tools/android/aapt.exe b/tools/android/aapt.exe new file mode 100644 index 0000000000..21e94a99dd Binary files /dev/null and b/tools/android/aapt.exe differ diff --git a/tools/autobuild/build.sh b/tools/autobuild/build.sh index e7004fd8a4..570b6bb72d 100644 --- a/tools/autobuild/build.sh +++ b/tools/autobuild/build.sh @@ -9,9 +9,12 @@ source "$LOCAL_DIRNAME/detect_qmake.sh" # Prints number of cores to stdout GetCPUCores() { case "$OSTYPE" in + # it's GitBash under Windows + msys) echo $NUMBER_OF_PROCESSORS + ;; linux-gnu) grep -c ^processor /proc/cpuinfo 2>/dev/null ;; - darwin*) sysctl -n hw.ncpu + darwin*) sysctl -n hw.ncpu ;; *) echo "Unsupported platform in $0" exit 1 diff --git a/tools/autobuild/ndk_helper.sh b/tools/autobuild/ndk_helper.sh index 6e52f2e8b3..ff15078856 100644 --- a/tools/autobuild/ndk_helper.sh +++ b/tools/autobuild/ndk_helper.sh @@ -27,6 +27,10 @@ GetNdkHost() echo "darwin-x86" return 0 fi - # TODO add Windows + if [[ "$OSTYPE" == "msys" ]]; then + echo windows + return 0 + fi + echo "ERROR: Can't detect your host OS" return 1 }