Commit fb333563 authored by Dagur Valberg Johannsson's avatar Dagur Valberg Johannsson 🎨
Browse files

Merge branch 'mv-docs' into 'master'

Move build and test docs to docs repo

See merge request !320
parents edfba065 6f5edef9
Pipeline #575971263 passed with stage
in 14 minutes and 17 seconds
......@@ -6,102 +6,18 @@ Censorship resistant on-chain blockchain voting.
This repository is for the android app for casting votes, creating a blockchain identity, viewing election results and authenticating to other apps using your blockchain identity.
<span style="left:1000px">
<a align="center" href="https://gitlab.com/bitcoinunlimited/votepeer-android-app/-/jobs/artifacts/master/raw/app-release.apk?job=assemble_release">
<img src="apk-download-badge.png" width="27%">
</a>
<div style="margin-left: auto; margin-right: auto; width: 80%;">
<a href="https://gitlab.com/bitcoinunlimited/votepeer-android-app/-/jobs/artifacts/master/raw/app-release.apk?job=assemble_release"><img src="apk-download-badge.png" width="33%">
</a>
<a href="https://play.google.com/store/apps/details?id=info.bitcoinunlimited.voting"><img src="https://cdn.rawgit.com/steverichey/google-play-badge-svg/master/img/en_get.svg" width="33%"></a>
</div>
<a align="center" href="https://play.google.com/store/apps/details?id=info.bitcoinunlimited.voting">
<img src="https://cdn.rawgit.com/steverichey/google-play-badge-svg/master/img/en_get.svg" width="27%">
</a>
</span>
## Building from source
### Clone project
`git clone https://gitlab.com/bitcoinunlimited/votepeer-android-app.git`
For a release build, run `./gradlew assembleRelease`.
#### Optionally clone with INTELLIJ/Android studio
File -> Project form version control -> `https://gitlab.com/bitcoinunlimited/votepeer-android-app.git`.
For development build, see section *for developers* below.
### INTELLIJ/Android studio: Project SDK
Make sure Project SDk is added user project:
`File-> Project structure -> Project settings -> Project`
-> Make sure the latest Android SDK is selected under Project SDK
### Setup Android sdk path in local.properties (mac path)
`touch local.properties`
```
local.properties:
```properties
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Fri Apr 24 17:09:51 CEST 2020
sdk.dir=/Users/<user>/Library/Android/sdk
ringsignatures=true
```
File -\> Invalidate cashes and restart
### Setup with firebase
Follow this tutorial to setup a firebase project and retrieve a google-services.json file
<https://firebase.google.com/docs/android/setup>
add google-service.json file to: `app/google-services.json`
## Intellij IDEA
To make Intellij IDEA's built-in formatter produce 100% ktlint-compatible code, run once
`./gradlew ktlintApplyToIDEAProject`
## Android Instrumented testing
```bash
./gradlew connectedAndroidTest
```
Android instrumented tests require the VotePeer android library to be imported locally.
They also require an android device or an emulator.
The library is assumed to be checked out in the parent directory (`../votepeer-library`). This path can be changed in `settings.gradle`.
VotePeer library repository can be found at <https://gitlab.com/bitcoinunlimited/votepeer-library>.
Android developer documentation section on running tests: <https://developer.android.com/studio/test/command-line#RunTestsGradle>
### Android Instrumented test results
These tests currently requires an emulator, or a device to run. Thus they cannot be displayed in CI/CD
<img src="https://i.imgur.com/AQVKjkQ.png">
## Jacoco: Code coverage reporting
##### Coverage reports for the unit tests
```shell
./gradlew jacocoTestDebugUnitTestReport
App => {rootDir}/app/build/jacoco/jacoco.xml //unit tests
Library => ${rootDir}../VotePeerLibrary/votepeer/build/jacoco/jacoco.xml //unit tests
```
##### Coverage reports for the UI tests
`See: https://vsahin.com/2021/06/21/coverage-reports-in-android-and-sonarqube/`
```shell
./gradlew createDebugCoverageReport
App => "${rootDir}/app/build/reports/coverage/debug/report.xml", //ui tests
Library => ${rootDir}../VotePeerLibrary/votepeer/build/reports/coverage/debug/report.xml //ui tests
```
\ No newline at end of file
## For developers
#### [How to build the project](https://docs.voter.cash/android-build/)
#### [Running tests](https://docs.voter.cash/android-test/)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment