summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-11-11 13:36:44 (GMT)
committerSwift Review <review@swift.im>2014-11-12 11:13:59 (GMT)
commit4dbd27df03a98d4480ed105b1fb401426aeb9a86 (patch)
treefe1b4be104596f395c97b0ca91b622ca40ce3284 /Documentation
parenta2f2cd23591330da4d1e98a1e49cd115ad1de276 (diff)
downloadswift-4dbd27df03a98d4480ed105b1fb401426aeb9a86.zip
swift-4dbd27df03a98d4480ed105b1fb401426aeb9a86.tar.bz2
Add build and test documentation for Android.
Test-Information: Tested documentation with Android NDK android-ndk-r10c on Mac OS X 10.9.5, Android NDK API level 14 and ARM architecture. Successfully ran all integration and unit tests. Change-Id: Ief0e7493e410a9c6cf80c4ca147ec0058293d1b1
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/BuildingOnAndroid.txt97
1 files changed, 97 insertions, 0 deletions
diff --git a/Documentation/BuildingOnAndroid.txt b/Documentation/BuildingOnAndroid.txt
new file mode 100644
index 0000000..7122aca
--- /dev/null
+++ b/Documentation/BuildingOnAndroid.txt
@@ -0,0 +1,97 @@
+Prerequisites
+-------------
+- Android SDK
+- Android NDK
+- Python
+- Other requirements that are obtained during this guide
+ - LDNS
+ - Unbound
+ - OpenSSL
+
+Supported Components
+--------------------
+- Swiften
+ Note: File-transfer support has not been tested on Android. Link-local features are not supported under Android.
+
+Supported Android NDK Level
+---------------------------
+The minimal supported Android NDK API level is 14 (see --platform parameter of make-standalone-toolchain.sh).
+This is the NDK API level associated with Android 4.0. Higher Android NDK API levels however should work.
+
+Preparation of Build Environment
+--------------------------------
+1. Fetch 3rd-party dependencies
+
+1.1 LDNS
+ cd 3rdParty/Ldns
+ bash prepare_ldns.sh
+
+1.2 Unbound
+ cd 3rdParty/Unbound
+ bash prepare_unbound.sh
+
+1.3 OpenSSL
+ cd 3rdParty/OpenSSL
+ curl -O http://www.openssl.org/source/openssl-1.0.0a.tar.gz
+ tar -xf openssl-1.0.0a.tar.gz
+ mv openssl-1.0.0a openssl
+
+2. Patch 3rd-party dependencies
+ patch -p0 < 3rdParty/Ldns/01_andoird_compilation_fixes.diff
+ patch -p1 < 3rdParty/LibMiniUPnPc/01_android_compilation_fixes.diff
+ patch -p1 < 3rdParty/Unbound/01_android_fixes.diff
+
+3. Create Android NDK Toolchain
+ cd $ANDROID_NDK_ROOT (this is the folder where you extracted Android NDK)
+ bash ./build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=$HOME/android-14-tc
+
+Configuring Swift Build
+-----------------------
+1. Set config.py to (probably other paths, replace $NDK_TOOLCHAIN_INSTALL_DIR with the expanded path of the install dir used in the previous step):
+ > android_toolchain=$NDK_TOOLCHAIN_INSTALL_DIR
+ > android_sdk_bin="/usr/local/bin"
+ > target = "android"
+ > unbound = 1
+
+Building
+--------
+./scons test=none Swiften Swift/Controllers QA max_jobs=1
+
+Testing
+-------
+Running Swift's test suite on Android requires a one time preparation of a testing environment.
+This creates an Android VM where the test will be deployed to and run on.
+
+1. Preparation of test environment (one time)
+
+1.1 Starting AVD (Android Device Manager)
+ android avd
+
+1.2 Create a test VM
+ Click "Create..." button
+
+1.3 Fill out dialog
+ AVD Name: swift_test
+ Device: Nexus 4
+ Target: Anything with API level equal or greater than your toolchain you build
+ CPU/ABI: ARM (unless you build a different toolchain)
+
+ Click "Ok" button
+
+1.4 Close AVD
+
+2. Running integration and unit tests
+
+To run the unit tests you need to have an Android VM running while the test suite is running.
+This requires to leave the command under step 2.1 running while you execute step 2.2.
+
+Running the test suite on Android can take quite some time ( >30 minutes ) compared to a native run.
+This is due to
+ a) the slow transfer speed from host machine to VM (~ 2 MB/s) and
+ b) the test environment being emulated for an different CPU architecture.
+
+2.1 Start Android VM with resized /system partition
+ emulator -partition-size 2048 @swift_test
+
+2.2 Run integration and unit tests (wait until the android boot screen is gone)
+ env SWIFT_CLIENTTEST_JID="some jabber id" SWIFT_CLIENTTEST_PASS="password for the jabber id" ./scons test=all Swiften Swift/Controllers QA