Skip to content

Commit

Permalink
Merge pull request #210 from code4romania/develop
Browse files Browse the repository at this point in the history
September 2020 updates
  • Loading branch information
aniri authored Sep 25, 2020
2 parents efb6bce + 80e2817 commit d9fd50e
Show file tree
Hide file tree
Showing 50 changed files with 1,263 additions and 189 deletions.
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# they will be requested for review when someone
# opens a pull request.
* @aniri @AlexandraDarabanQ

# More details on creating a codeowners file:
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
3 changes: 2 additions & 1 deletion .github/CONTRIBUTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ To send us a suggestion, just [open an issue](https://github.com/code4romania/mo

:computer: We'd love for you to get your hands dirty and code for the project.

If you are unsure where to begin contributing to the project, you can start by looking through these issues:
If you are unsure where to begin contributing to the project, you can start by looking through these issues:
[How to contribute](WORKFLOW.MD)
* [Good first issues](https://github.com/code4romania/mon-vot-android-kotlin/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
* [Help wanted](https://github.com/code4romania/mon-vot-android-kotlin/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)

Expand Down
14 changes: 14 additions & 0 deletions .github/WORKFLOW.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ Whether you're trying to give back to the open source community or collaborating

In an attempt to collate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

## TL;DR

Steps (details below):
1. Create issue if it doesn't exist
2. Pull the latest `upstream/develop` into your fork
3. Create feature branch in your fork
4. Code it up
5. Commit the changes (can put multiple commits since you'll be basing the PR off the branch)
6. Push the changes to `origin/develop` (your fork)
7. Create PR on Code4Romania repo basing `develop` <- `your fork/your feature branch`
8. Enjoy success

Detailed instructions below.

## Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or just head straight to the command line:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: SonarCloud

on:
push:
branches:
- master
- develop

jobs:
sonar:
name: SonarCloud Scan
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Analyze with SonarCloud
run: ./gradlew clean assembleDebug sonar -Dsonar.login=$SONAR_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
10 changes: 9 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The app also has a web version, available for every citizen who wants to report

This project is built by amazing volunteers and you can be one of them! Here's a list of ways in [which you can contribute to this project](.github/CONTRIBUTING.MD).

__IMPORTANT:__ Please follow the Code4Romania [WORKFLOW](.github/WORKFLOW.MD)

## Built With

* Android Studio 3.6
Expand All @@ -32,7 +34,13 @@ Uses [Fastlane](https://fastlane.tools/) for automating builds & releases.

Uses the MVVM architectural pattern.

Swagger docs for the API are available [here](http://mv-mobile-test.azurewebsites.net/swagger/index.html).
Relies on Firebase's RemoteConfig for remote settings.

The app is localized, meaning it's easier for any interested party to fork the project and use it in other countries, simply localizing the messages. Please see the [steps for app localization](https://github.com/code4romania/mon-vot-android-kotlin/wiki/Steps-for-app-localisation) in the wiki.

More info on redeploying and reusing the app can be found in the wiki: [Redeploy steps](https://github.com/code4romania/mon-vot-android-kotlin/wiki/Steps-for-redeploying---reusing-the-app) & [Google Play Deploy Steps](https://github.com/code4romania/mon-vot-android-kotlin/wiki/Google-Play-Deploy-Steps)

Swagger docs for the API are available [here](https://app-vmon-api-dev.azurewebsites.net/swagger/index.html).

## Repos and projects

Expand Down
111 changes: 59 additions & 52 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
// TODO: Uncomment this to enable FirebaseAnalytics and Crashlytics
//apply plugin: 'io.fabric'
apply plugin: 'org.sonarqube'
// TODO: Uncomment this to enable Firebase Crashlytics
// apply plugin: 'com.google.firebase.crashlytics'

static def getKey(String env, String key) {
Properties props = new Properties()
Expand All @@ -17,6 +18,7 @@ androidExtensions {

android {
compileSdkVersion 29
buildToolsVersion = '29.0.3'

defaultConfig {
applicationId "ro.code4.monitorizarevot"
Expand All @@ -26,7 +28,6 @@ android {
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"


javaCompileOptions {
annotationProcessorOptions {
arguments = [
Expand All @@ -49,13 +50,13 @@ android {
keyPassword getKey("keystore", "keyPassword")
storePassword getKey("keystore", "storePassword")
}

}

buildTypes {
applicationVariants.all { variant ->
variant.buildConfigField "String", "API_URL", "\"" + getKey(variant.buildType.name, "apiUrl") + "\""
variant.buildConfigField "String", "GUIDE_URL", "\"" + getKey(variant.buildType.name, "guideUrl") + "\""
variant.buildConfigField "String", "SAFETY_URL", "\"" + getKey(variant.buildType.name, "safetyUrl") + "\""
variant.buildConfigField "String", "ORGANISATION_WEB_URL", "\"" + getKey(variant.buildType.name, "organisationWebUrl") + "\""
variant.buildConfigField "String", "SERVICE_CENTER_PHONE_NUMBER", "\"" + getKey(variant.buildType.name, "serviceCenterPhoneNumber") + "\""
variant.buildConfigField "String", "PREFERRED_LOCALE", "\"" + getKey(variant.buildType.name, "preferredLocale") + "\""
Expand All @@ -69,14 +70,14 @@ android {

debug {
minifyEnabled false
manifestPlaceholders = [enableCrashReporting:"false"]
manifestPlaceholders = [enableCrashReporting: "false"]
}

release {
minifyEnabled false
signingConfig signingConfigs.fastlane
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
manifestPlaceholders = [enableCrashReporting:"true"]
manifestPlaceholders = [enableCrashReporting: "true"]
}
}

Expand All @@ -90,79 +91,85 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildToolsVersion = '29.0.2'

kotlinOptions {
jvmTarget = "1.8"
}
}

ext {
retrofitLibraryVersion = '2.5.0'
retrofitVersion = '2.9.0'
navigationVersion = "2.2.2"
koinVersion = '2.0.1'
roomVersion = '2.2.0'
firebaseVersion = '17.2.1'
crashlyticsVersion = '2.10.1'
parcelerVersion = "1.1.13"
roomVersion = '2.2.5'
firebaseAnalyticsVersion = '17.4.3'
firebaseCrashlyticsVersion = '17.1.0'
firebaseMessagingVersion = "20.2.0"
firebaseConfigVersion = "19.1.4"
adapterDelegatesVersion = "4.2.0"
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation "androidx.preference:preference-ktx:1.1.0"
implementation 'androidx.core:core-ktx:1.1.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation "androidx.preference:preference-ktx:1.1.1"
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.2.0-alpha01'
implementation 'com.google.android.material:material:1.3.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment:2.1.0'
implementation 'androidx.navigation:navigation-ui:2.1.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.1.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.1.0'
implementation 'androidx.annotation:annotation:1.1.0'

implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'

implementation "com.squareup.retrofit2:retrofit:$retrofitLibraryVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitLibraryVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitLibraryVersion"
implementation "com.squareup.retrofit2:converter-scalars:$retrofitLibraryVersion"
implementation 'com.squareup.okhttp3:logging-interceptor:4.1.1'

implementation 'com.sylversky.fontreplacer:fontreplacer:1.0'
implementation 'com.yqritc:recyclerview-flexibledivider:1.4.0'
implementation 'me.relex:circleindicator:2.1.4'
implementation "com.hannesdorfmann:adapterdelegates4:$adapterDelegatesVersion"
implementation "androidx.viewpager2:viewpager2:1.0.0"
// Navigation
implementation "androidx.navigation:navigation-fragment:$navigationVersion"
implementation "androidx.navigation:navigation-ui:$navigationVersion"
implementation "androidx.navigation:navigation-fragment-ktx:$navigationVersion"
implementation "androidx.navigation:navigation-ui-ktx:$navigationVersion"
// Retrofit
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-scalars:$retrofitVersion"
implementation 'com.squareup.okhttp3:logging-interceptor:4.7.2'
// Firebase
implementation "com.google.firebase:firebase-analytics:$firebaseVersion"
implementation 'com.google.firebase:firebase-messaging:20.0.1'
implementation 'com.google.firebase:firebase-config:19.0.3'
implementation "com.crashlytics.sdk.android:crashlytics:$crashlyticsVersion"

//koin injection
implementation "com.google.firebase:firebase-analytics:$firebaseAnalyticsVersion"
implementation "com.google.firebase:firebase-messaging:$firebaseMessagingVersion"
implementation "com.google.firebase:firebase-config:$firebaseConfigVersion"
implementation "com.google.firebase:firebase-crashlytics:$firebaseCrashlyticsVersion"
// Koin injection
implementation "org.koin:koin-android:$koinVersion"
implementation "org.koin:koin-android-viewmodel:$koinVersion"

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

implementation 'org.parceler:parceler-api:1.1.12'
kapt 'org.parceler:parceler:1.1.12'

//Room
// Parceler
implementation "org.parceler:parceler-api:$parcelerVersion"
kapt "org.parceler:parceler:$parcelerVersion"
// Room
implementation "androidx.room:room-runtime:$roomVersion"
kapt "androidx.room:room-compiler:$roomVersion"
implementation "androidx.room:room-ktx:$roomVersion"
implementation "androidx.room:room-rxjava2:$roomVersion"
androidTestImplementation "androidx.room:room-testing:$roomVersion"

implementation 'com.sylversky.fontreplacer:fontreplacer:1.0'
implementation 'com.yqritc:recyclerview-flexibledivider:1.4.0'

implementation 'me.relex:circleindicator:2.1.4'

implementation "com.hannesdorfmann:adapterdelegates4:$adapterDelegatesVersion"

implementation "androidx.viewpager2:viewpager2:1.0.0-rc01"
// Unit tests
testImplementation 'junit:junit:4.13'
// Instrumented tests
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation "androidx.room:room-testing:$roomVersion"
}

sonarqube {
properties {
property 'sonar.projectName', 'Vote Monitor Android'
property 'sonar.projectKey', 'code4romania_vote-monitor-android'
property 'sonar.host.url', 'https://sonarcloud.io'
property 'sonar.organization', 'code4romania'
}
}

// TODO: Uncomment this to enable FirebaseAnalytics and Crashlytics
Expand Down
Loading

0 comments on commit d9fd50e

Please sign in to comment.