Skip to content

Commit

Permalink
Merge pull request #1192 from kiwix/macgills/2.5-mergeable-to-dev
Browse files Browse the repository at this point in the history
Merge 2.5 to dev
  • Loading branch information
macgills authored Jun 20, 2019
2 parents d4d9af2 + 5431afa commit 55aa28e
Show file tree
Hide file tree
Showing 225 changed files with 7,349 additions and 4,118 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ charset = utf-8
continuation_indent_size = 4

# windows command files need windows newline
[*.{bat,cmd}]
[*.{bat, cmd}]
end_of_line = crlf

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ glassify
.project
.classpath

.vscode
.vscode
captures/
88 changes: 79 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,89 @@ jdk: oraclejdk8

sudo: required

env:
global:
- ANDROID_TARGET=android-22
- ANDROID_ABI=armeabi-v7a

before_install:
- openssl aes-256-cbc -K $encrypted_82adfa9c3806_key -iv $encrypted_82adfa9c3806_iv -in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar

install:
- pip install --user 'requests[security]'
- wget -r -nH -nd -np -R index.html* robots.txt* http://download.kiwix.org/dev/android/api/licenses/ -e robots=off -P $ANDROID_HOME/licenses || true
- pip install --user 'requests[security]'
- wget -r -nH -nd -np -R index.html* robots.txt* http://download.kiwix.org/dev/android/api/licenses/ -e robots=off -P $ANDROID_HOME/licenses || true

addons:
apt:
packages:
- lynx

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
directories:
- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
- "$HOME/.android/build-cache"

android:
components:
- tools
- platform-tools
- tools
- build-tools-28.0.3
- android-28
- tools
- platform-tools
- build-tools-28.0.3
- android-28
- extra-android-m2repository
- $ANDROID_TARGET
- sys-img-${ANDROID_ABI}-${ANDROID_TARGET}

licenses:
- '.+'
- ".+"

script:
- ./gradlew lintKiwixDebug jacocoTestKiwixDebugUnitTestReport
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI -c 100M
- emulator -avd test -no-window &
- android-wait-for-emulator
- adb shell setprop dalvik.vm.dexopt-flags v=n,o=v
- adb shell input keyevent 82 & # unlock screen by pressing menu button
- adb -e logcat *:D > logcat.log &
- ./gradlew createKiwixDebugCoverageReport

after_success:
- bash <(curl -s https://codecov.io/bash)
- ./gradlew kiwixtestUploadKiwix

after_failure:
- export LOG_DIR = ${TRAVIS_HOME}/build/kiwix/kiwix-android/app/build/outputs/reports/androidTests/connected/flavors/KIWIX/
- lynx --dump ${LOG_DIR}com.android.builder.testing.ConnectedDevice.html
- lynx --dump ${LOG_DIR}com.android.builder.testing.html
- lynx --dump ${LOG_DIR}org.kiwix.kiwixmobile.tests.BasicTest.html;
- echo " LOGCAT "; echo "========"; cat logcat.log; pkill -KILL -f adb

before_deploy:
# - export APP_CHANGELOG=$(cat app/src/kiwix/play/release-notes/en-US/default.txt)
- ./gradlew assembleKiwixRelease

deploy:

#publish on github releases
- provider: releases
api_key: "$GITHUB_TOKEN"
file: app/build/outputs/apk/kiwix/release/*
file_glob: true
skip_cleanup: true
overwrite: true
# body: "$APP_CHANGELOG" broken because travis can't escape newlines
draft: true
on:
tags: true

script: ./gradlew assembleKiwixRelease kiwixtestUploadKiwix && ./testdroid.py
#publish on play store
- provider: script
skip_cleanup: true
script: ./gradlew publishKiwixRelease
on:
tags: true
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2.5
NEW: Downloads are now using the DownloadManager
NEW: Downloads/Device/Library completely rewritten

2.4
FIX: External SD card problems
FIX: Some UI translation
Expand Down
43 changes: 43 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,47 @@ Our process for accepting changes operates by [Pull Request (PR)](https://help.g

1. Once you have integrated comments, or waited for feedback, a Lieutenant should merge your changes in!

### Building

The default build is `debug`, with this variant you can use a debugger while developing. To install the application click the `run` button in Android Studio with the `app` configuration selected while you have a device connected. All other build types but `release` can be ignored, the `release` build is what gets uploaded to the Google Play store and can be built locally with the dummy credentials/keystore provided.

### Testing

Unit tests are located in `app/src/test` and to run them locally you
can use the gradle command:

$ gradlew testKiwixDebugUnitTest

or the abbreviated:

$ gradlew tKDUT

Automated tests that require a connected device (UI related tests) are located in `app/src/androidTest` & `app/src/androidTestKiwix`, to run them locally you can use the gradle command:

$ gradlew connectedKiwixDebugAndroidTest

or the abbreviated:


$ gradlew cKDAT

All local test results can be seen under `app/build/reports/`

### Code coverage

To generate coverage reports for your unit tests run:

$ gradlew jacocoTestKiwixDebugUnitTest

To generate coverage reports for your automated tests run:

$ gradlew createKiwixDebugCoverageReport

Code coverage results can be seen under `app/build/reports/`

### Continous Integration

All PRs will have all these tests run and a combined coverage report will be attached, if coverage is to go down the PR will be marked failed. On Travis CI the automated tests are run on an emulator. To
learn more about the commands run on the CI please refer to [.travis.yml](https://github.com/kiwix/kiwix-android/blob/master/.travis.yml)

_These guidelines are based on [Tools for Government Data Archiving](https://github.com/edgi-govdata-archiving/overview/blob/master/CONTRIBUTING.md)'s._
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Kiwix is an offline reader for Web content. One of its main purposes is to make

[![Build Status](https://travis-ci.org/kiwix/kiwix-android.svg?branch=master)](https://travis-ci.org/kiwix/kiwix-android)
[![IRC Web](https://img.shields.io/badge/chat-on%20freenode-brightgreen.svg)](http://chat.kiwix.org)
[![codecov](https://codecov.io/gh/kiwix/kiwix-android/branch/master/graph/badge.svg)](https://codecov.io/gh/kiwix/kiwix-android)
---

## Build Instructions
Expand All @@ -22,16 +23,15 @@ We utilize different build variants (flavours) to build various different versio
## Libraries Used

- [Dagger 2](https://github.com/google/dagger) - A fast dependency injector for Android and Java
- [SquiDb](https://github.com/yahoo/squidb) - SquiDB is a SQLite database library for Android and iOS
- [Retrofit](http://square.github.io/retrofit/) - Retrofit turns your REST API into a Java interface
- [OkHttp](https://github.com/square/okhttp) - An HTTP+SPDY client for Android and Java applications
- [Butterknife](http://jakewharton.github.io/butterknife/) - View "injection" library for Android
- [Mockito](https://github.com/mockito/mockito) - Most popular Mocking framework for unit tests written in Java
- [Guava](https://github.com/google/guava) - Collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, and so forth.
- [Apache](https://github.com/apache/commons-io) - The Apache Commons IO library contains utility classes, stream implementations, file filters, file comparators, endian transformation classes, and much more.
- [Mockito](https://github.com/mockito/mockito) - Most popular Mocking framework for unit tests written in Java
- [RxJava](https://github.com/ReactiveX/RxJava) - Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.


- [ObjectBox] (https://github.com/objectbox/objectbox-java) - Reactive NoSQL Databse to replace SquiDb
- [MockK] (https://github.com/mockk/mockk) - Kotlin mocking library that allows mocking of final classes by default.
- [JUnit5] (https://github.com/junit-team/junit5/) - The next generation of JUnit
- [AssertJ] (https://github.com/joel-costigliola/assertj-core) - Fluent assertions for test code

## Contributing

Expand Down
Loading

0 comments on commit 55aa28e

Please sign in to comment.