Skip to content

Commit

Permalink
Merge pull request #195 from nimblehq/release/3.7.0
Browse files Browse the repository at this point in the history
[Release] 3.7.0
  • Loading branch information
toby-thanathip authored May 5, 2022
2 parents 5b33e49 + 39a3ee5 commit d4b37c0
Show file tree
Hide file tree
Showing 217 changed files with 413 additions and 238 deletions.
8 changes: 3 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Team Lead
* @Tuubz

# Team Members
* @AVI5HEK @chornerman @doannimble @hoangnguyen92dn @kaungkhantsoe @luongvo @lydiasama @manh-t @minhnimble @ryan-conway @sleepylee @Wadeewee
# Team
# @Tuubz is the Team Lead and the others are team members
* @AVI5HEK @chornerman @doannimble @hoangnguyen92dn @kaungkhantsoe @luongvo @lydiasama @manh-t @minhnimble @ryan-conway @sleepylee @Tuubz @Wadeewee

# Engineering Leads
CODEOWNERS @nimblehq/engineering-leads
13 changes: 2 additions & 11 deletions .github/workflows/review_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,12 @@ jobs:
working-directory: ./CoroutineTemplate
run: ./gradlew detekt

- name: Run Detekt on RxJavaTemplate
working-directory: ./RxJavaTemplate
run: ./gradlew detekt

- name: Run Android Lint on RxJavaTemplate
working-directory: ./RxJavaTemplate
run: ./gradlew lint

- name: Run Android Lint on CoroutineTemplate
working-directory: ./CoroutineTemplate
run: ./gradlew lint

# TODO: Update to support test coverage reports from Jacoco for CoroutineTemplate
- name: Run unit tests and Jacoco on RxJavaTemplate
working-directory: ./RxJavaTemplate
- name: Run unit tests and Jacoco on CoroutineTemplate
working-directory: ./CoroutineTemplate
run: ./gradlew jacocoTestReport

- name: Set up Ruby
Expand Down
22 changes: 5 additions & 17 deletions .github/workflows/run_detekt_and_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,18 @@ jobs:
working-directory: ./CoroutineTemplate
run: ./gradlew detekt

- name: Run Detekt on RxJavaTemplate
working-directory: ./RxJavaTemplate
run: ./gradlew detekt

- name: Archive Detekt reports on CoroutineTemplate
uses: actions/upload-artifact@v2
with:
name: DetektReportsCoroutine
path: CoroutineTemplate/build/reports/detekt/

- name: Archive Detekt reports on RxJavaTemplate
uses: actions/upload-artifact@v2
with:
name: DetektReportsRxJava
path: RxJavaTemplate/build/reports/detekt/

- name: Run unit tests and Jacoco on RxJavaTemplate
working-directory: ./RxJavaTemplate
- name: Run unit tests and Jacoco on CoroutineTemplate
working-directory: ./CoroutineTemplate
run: ./gradlew jacocoTestReport

- name: Archive code coverage reports on RxJavaTemplate
- name: Archive code coverage reports on CoroutineTemplate
uses: actions/upload-artifact@v2
with:
name: CodeCoverageReportsRxJava
path: |
RxJavaTemplate/app/build/reports/jacoco/jacocoTestReport/
RxJavaTemplate/data/build/reports/jacoco/jacocoTestReport/
name: CodeCoverageReportsCoroutine
path: CoroutineTemplate/app/build/reports/jacoco/jacocoTestReport/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.idea
.gradle
/CoroutineTemplate/local.properties
/RxJavaTemplate/local.properties
/RxJavaTemplate[DEPRECATED]/local.properties
.DS_Store
build/
/captures
Expand Down
8 changes: 8 additions & 0 deletions CoroutineTemplate/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,11 @@ secret/

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# Code coverage
jacoco.exec

# Google services
google-services.json
# Keystore
config/release.keystore
42 changes: 34 additions & 8 deletions CoroutineTemplate/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,51 @@
# Android Templates: Coroutine

- Our optimized Android templates used in our android projects

### Setup
## Setup

- Clone the project
- Checkout our main development branch `kotlin`
- Run the project with Android Studio

### Linter and static code analysis
## Linter and static code analysis

1. Check Style:
- Lint:

```
$ ./gradlew checkStyle
$ ./gradlew lint
```

Report is located at: `./app/build/reports/checkstyle/`
Report is located at: `./app/build/reports/lint/`

2. Detekt
- Detekt

```
$ ./gradlew detekt
```

Report is located at: `./build/reports/detekt.html`
Report is located at: `./build/reports/detekt`

## Testing

- Run unit testing:

```
$ ./gradlew app:testStagingDebugUnitTest
$ ./gradlew data:testDebugUnitTest
$ ./gradlew domain:test
```

- Run unit testing with coverage:

```
$ ./gradlew jacocoTestReport
```

Report is located at: `./app/build/reports/jacoco/`

## Build and deploy

For `release` builds, we need to provide release keystore and signing properties:

- Put the `release.keystore` file at root `config` folder.
- Put keystore signing properties in [signing.properties](https://github.com/nimblehq/android-templates/blob/develop/CoroutineTemplate/signing.properties).
25 changes: 22 additions & 3 deletions CoroutineTemplate/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,28 @@ plugins {

id("dagger.hilt.android.plugin")
id("androidx.navigation.safeargs.kotlin")

id("plugins.jacoco-report")
}

val keystoreProperties = rootDir.loadGradleProperties("signing.properties")

android {
signingConfigs {
create("config") {
create(BuildType.RELEASE) {
// Remember to edit signing.properties to have the correct info for release build.
storeFile = file("../keystore_production")
storeFile = file("../config/release.keystore")
storePassword = keystoreProperties.getProperty("KEYSTORE_PASSWORD") as String
keyPassword = keystoreProperties.getProperty("KEY_PASSWORD") as String
keyAlias = keystoreProperties.getProperty("KEY_ALIAS") as String
}

getByName(BuildType.DEBUG) {
storeFile = file("../config/debug.keystore")
storePassword = "oQ4mL1jY2uX7wD8q"
keyAlias = "debug-key-alias"
keyPassword = "oQ4mL1jY2uX7wD8q"
}
}

compileSdk = Versions.ANDROID_COMPILE_SDK_VERSION
Expand All @@ -37,13 +46,23 @@ android {
isDebuggable = false
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
signingConfig = signingConfigs["config"]
signingConfig = signingConfigs[BuildType.RELEASE]
buildConfigField("String", "BASE_API_URL", "\"https://jsonplaceholder.typicode.com/\"")
}

getByName(BuildType.DEBUG) {
// For quickly testing build with proguard, enable this
isMinifyEnabled = false
signingConfig = signingConfigs[BuildType.DEBUG]
buildConfigField("String", "BASE_API_URL", "\"https://jsonplaceholder.typicode.com/\"")
/**
* From AGP 4.2.0, Jacoco generates the report incorrectly, and the report is missing
* some code coverage from module. On the new version of Gradle, they introduce a new
* flag [testCoverageEnabled], we must enable this flag if using Jacoco to capture
* coverage and creates a report in the build directory.
* Reference: https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/dsl/BuildType#istestcoverageenabled
*/
isTestCoverageEnabled = true
}
}

Expand Down
82 changes: 0 additions & 82 deletions CoroutineTemplate/app/config/checkstyle.xml

This file was deleted.

84 changes: 0 additions & 84 deletions CoroutineTemplate/app/config/xsl/checkstyle-custom.xsl

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package co.nimblehq.coroutine.di.modules

import co.nimblehq.coroutine.data.repository.UserRepositoryImpl
import co.nimblehq.coroutine.data.service.ApiService
import co.nimblehq.coroutine.domain.repository.UserRepository
import co.nimblehq.coroutine.data.repositoryimpl.UserRepositoryImpl
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
Expand Down
6 changes: 6 additions & 0 deletions CoroutineTemplate/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
detekt {
toolVersion = Versions.DETEKT_VERSION

source = files(
"app/src/main/java",
"data/src/main/java",
"domain/src/main/java",
"buildSrc/src/main/java"
)
parallel = false
config = files("detekt-config.yml")
buildUponDefaultConfig = false
Expand Down
Loading

0 comments on commit d4b37c0

Please sign in to comment.