From 3ddebc309638d2d5a7fd4353a37501c5e7e586e2 Mon Sep 17 00:00:00 2001 From: Sean Mac Gillicuddy Date: Fri, 14 Jun 2019 11:06:29 +0100 Subject: [PATCH 1/9] Update CONTRIBUTING.md --- CONTRIBUTING.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5329e12de..861f6e000 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,4 +40,39 @@ 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 and BuildTypes + +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 play store and can be built locally with the dummy credentials/keystore provided. + +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 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 + +To generate coverage reports for your unit tests run: + + gradlew jacocoTestKiwixDebugUnitTest + +To generate coverage reports for your automated tests run: + + gradlew createKiwixDebugCoverageReport + +All local test results can be seen under app/build/reports/ + +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._ From a24818ff9aa9bdb1e9ad79c7f6a78b5b4c57ae2d Mon Sep 17 00:00:00 2001 From: Kelson Date: Fri, 14 Jun 2019 13:52:12 +0200 Subject: [PATCH 2/9] Light reformatting of CONTRIBUTING.md --- CONTRIBUTING.md | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 861f6e000..ffc938217 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,39 +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 and BuildTypes +### 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 play store and can be built locally with the dummy credentials/keystore provided. +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. -Unit tests are located in app/src/test and to run them locally you can use the gradle command: +### Testing + +Unit tests are located in `app/src/test` and to run them locally you +can use the gradle command: + + $ gradlew testKiwixDebugUnitTest - gradlew testKiwixDebugUnitTest - or the abbreviated: - gradlew tKDUT - -Automated tests that require a connected device are located in app/src/androidTest & app/src/androidTestKiwix, to run them locally you can use the gradle command: + $ 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 - gradlew connectedKiwixDebugAndroidTest - or the abbreviated: - gradlew cKDAT - + + $ 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 - + $ gradlew jacocoTestKiwixDebugUnitTest + To generate coverage reports for your automated tests run: - gradlew createKiwixDebugCoverageReport + $ gradlew createKiwixDebugCoverageReport -All local test results can be seen under app/build/reports/ +Code coverage results can be seen under `app/build/reports/` -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) +### 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._ From 92cf08c2330d12235b8487e5bf89c92f19daf6a1 Mon Sep 17 00:00:00 2001 From: Kelson Date: Fri, 14 Jun 2019 13:53:49 +0200 Subject: [PATCH 3/9] Remove SquiDB from README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index ccc295d8d..050f45f02 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,6 @@ 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 From 14df2a1dbd032b0148cb92a1a8802bfa11d0f4b0 Mon Sep 17 00:00:00 2001 From: Sean Mac Gillicuddy Date: Fri, 14 Jun 2019 15:45:40 +0100 Subject: [PATCH 4/9] update deployment to be on any tag --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7135f8369..f7477bec1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -82,12 +82,10 @@ deploy: draft: true on: tags: true - condition: $TRAVIS_BRANCH =~ ^release|master #publish on play store - provider: script skip_cleanup: true script: ./gradlew publishKiwixRelease on: - tags: true - condition: $TRAVIS_BRANCH =~ ^release|master \ No newline at end of file + tags: true \ No newline at end of file From d4363ae95155ccc067b2dc902d863868ff6014f6 Mon Sep 17 00:00:00 2001 From: Sean Mac Gillicuddy Date: Fri, 14 Jun 2019 16:32:37 +0100 Subject: [PATCH 5/9] disable body of github release, broken on travis --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f7477bec1..13f81e42b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,8 +66,8 @@ after_failure: - 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) +#before_deploy: +# - export APP_CHANGELOG=$(cat app/src/kiwix/play/release-notes/en-US/default.txt) deploy: @@ -78,7 +78,7 @@ deploy: file_glob: true skip_cleanup: true overwrite: true - body: "$APP_CHANGELOG" +# body: "$APP_CHANGELOG" broken because travis can't escape newlines draft: true on: tags: true From d2726c80b9888b942ba5b1be4d618fb2b94f074e Mon Sep 17 00:00:00 2001 From: Sean Mac Gillicuddy Date: Fri, 14 Jun 2019 16:44:33 +0100 Subject: [PATCH 6/9] set play publisher to be enabled because branchname is unreliable on travis --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 034ff35d5..93dc4de0f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -445,7 +445,7 @@ android { } play { - enabled = branchName == "master" || branchName == "release" + enabled = true serviceAccountCredentials = file("../google.json") track = "alpha" resolutionStrategy = "fail" @@ -465,4 +465,4 @@ testdroid { fullRunConfig { instrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" } -} \ No newline at end of file +} From 4924eea71c388ce13d7681e3d1cbc25b2732387b Mon Sep 17 00:00:00 2001 From: Sean Mac Gillicuddy Date: Mon, 17 Jun 2019 09:44:35 +0100 Subject: [PATCH 7/9] -build release variant so apks can be uploaded to github releases - playstore does not accept universal apks for abi splits that have a total mapping for the available code, deactivate --- .travis.yml | 3 ++- app/build.gradle | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 13f81e42b..22e9e202f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,8 +66,9 @@ after_failure: - lynx --dump ${LOG_DIR}org.kiwix.kiwixmobile.tests.BasicTest.html; - echo " LOGCAT "; echo "========"; cat logcat.log; pkill -KILL -f adb -#before_deploy: +before_deploy: # - export APP_CHANGELOG=$(cat app/src/kiwix/play/release-notes/en-US/default.txt) + - ./gradlew assembleKiwixRelease deploy: diff --git a/app/build.gradle b/app/build.gradle index 93dc4de0f..1956088c7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -431,7 +431,7 @@ android { enable true reset() include "x86", "x86_64", 'armeabi-v7a', "arm64-v8a" - universalApk true + universalApk false } } applicationVariants.all { variant -> From f35c2e44f4f24a74c8800077ebd6a8a75e5eeef3 Mon Sep 17 00:00:00 2001 From: Sean Mac Gillicuddy Date: Mon, 17 Jun 2019 11:39:42 +0100 Subject: [PATCH 8/9] -attempt draft release - remove branchname as tags do not build on a branch --- app/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 1956088c7..8a96ab719 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -210,7 +210,7 @@ android { // See https://github.com/linkedin/dexmaker/issues/65 for why we need the following line. testInstrumentationRunnerArguments.notClass = 'com.android.dex.DexIndexOverflowException' vectorDrawables.useSupportLibrary = true - archivesBaseName = "${branchName.replace('/', '-')}-$buildNumber" + archivesBaseName = "$buildNumber" } aaptOptions { @@ -448,6 +448,7 @@ play { enabled = true serviceAccountCredentials = file("../google.json") track = "alpha" + releaseStatus = "draft" resolutionStrategy = "fail" } From d10c2e3b606793a5385a1aee2c8c826424702b4c Mon Sep 17 00:00:00 2001 From: Sean Mac Gillicuddy Date: Mon, 17 Jun 2019 12:25:41 +0100 Subject: [PATCH 9/9] - increase numbering for abi splits to resolve error on play store --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 8a96ab719..c110629db 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -425,7 +425,7 @@ android { experimental = true } - def abiCodes = ['arm64-v8a': 1, 'x86': 2, 'x86_64': 3, 'armeabi-v7a': 4] + def abiCodes = ['arm64-v8a': 5, 'x86': 2, 'x86_64': 3, 'armeabi-v7a': 4] splits { abi { enable true