1 Star 0 Fork 0

前面那方/commonmark-java

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

commonmark-android-test

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

  1. Download Android SDK
  2. Be sure that SDK Platform 15 and emulator for this platform (system image) are installed. It's recommended to use x86
  3. Export to PATH: path_to_android_sdk/platform-tools and path_to_android_sdk/tools
  4. 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.13.1
# Version number of autolink in maven central (not bundled with extension jar).
version.maven_autolink=0.10.0

# Version number of commonmark and extensions in project.
version.snapshot=0.13.1-SNAPSHOT
# Version number of autolink for snapshots (not bundled in extension jar).
version.snapshot_autolink=0.10.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.

Links

Gradle Documentations Android Gradle Plugin Docs

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhongbin/commonmark-java.git
git@gitee.com:zhongbin/commonmark-java.git
zhongbin
commonmark-java
commonmark-java
master

搜索帮助