This module ensures that commonmark-java is supported on Android
Requirements:
- Java 7 or above
- Android SDK 15
- Running emulator or connected android device
Configuration
- Download Android SDK
- Be sure that SDK Platform 15 and emulator for this platform (system image) are installed. It's recommended to use x86
- Export to PATH:
path_to_android_sdk/platform-toolsandpath_to_android_sdk/tools - Create 2 properties files in commonmark-android-test
/local.properties
sdk.dir=/path_to_android_sdk/test.properties
# Absolute or relative (./ == /app) path to test reports. path.report=../report # Version number of commonmark and extensions in maven central. version.maven=0.8.0 # Version number of autolink in maven central (not bundled with extension jar). version.maven_autolink=0.6.0 # Version number of commonmark and extensions in project. version.snapshot=0.8.0-SNAPSHOT # Version number of autolink for snapshots (not bundled in extension jar). version.snapshot_autolink=0.6.0
If you're going to test on device with Android 15 then you can skip downloading emulator.
Usage
Run test with MAVEN version
on Mac/Linux:
./gradlew :app:connectedMavenDebugAndroidTest
on Windows:
.\gradlew :app:connectedMavenDebugAndroidTest
Run test with SNAPSHOT version
Before running tests you need to run mvn clean install in the root of
this repository.
on Mac/Linux:
./gradlew :app:connectedSnapshotDebugAndroidTest
on Windows:
.\gradlew :app:connectedSnapshotDebugAndroidTest
Testing in CI
on Mac/Linux:
echo no | android create avd --force -n test -t "android-15" emulator -avd test & adb wait-for-device ./gradlew :app:clean :app:connectedSnapshotDebugAndroidTest adb emu kill
on Windows:
echo no | android create avd --force -n test -t "android-15" start emulator -avd test adb wait-for-device gradlew :app:clean :app:connectedSnapshotDebugAndroidTest & adb emu kill
There could be problems with command adb wait-for-device which could be resolved by adding additional pause before running test.