Skip to content

Commit 2f5a799

Browse files
Merge pull request #1 from henryhuang1219/develope
Add: Dokka
2 parents f4e3820 + 7638426 commit 2f5a799

File tree

556 files changed

+89647
-242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

556 files changed

+89647
-242
lines changed

.github/workflows/ci_android.yml

Lines changed: 94 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,147 @@
1-
name: CI Android
1+
name: ci-android
22

33
# Controls when the action will run.
44
on:
55

6-
# Triggers the workflow on push or pull request events but only for the master branch
6+
# Triggers the workflow on push & pull request events but only for the master branch.
77
push:
88
branches: [ master ]
99
pull_request:
1010
branches: [ master ]
11-
12-
# Allows you to run this workflow manually from the Actions tab
11+
12+
# Allows you to run this workflow manually from the Actions tab.
1313
workflow_dispatch:
14-
15-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel.
1617
jobs:
17-
gradle_vaildation:
18-
name: Validate Gradle Wrapper
19-
20-
# The type of runner that the job will run on
18+
19+
gradle_validation:
20+
21+
name: validate-gradle-wrapper
22+
23+
# The type of runner that the job will run on.
2124
runs-on: ubuntu-latest
22-
25+
2326
steps:
24-
25-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26-
- name: Checkout
27-
uses: actions/checkout@v2
28-
29-
- name: Validate Gradle Wrapper
27+
28+
# Checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it.
29+
- name: checkout
30+
uses: actions/checkout@v3
31+
32+
# Validates the checksums of Gradle Wrapper JAR files present in the source tree.
33+
- name: validate-gradle-wrapper
3034
uses: gradle/wrapper-validation-action@v1
31-
32-
apk:
33-
name: Generate APK
34-
35+
36+
generate_apk:
37+
38+
name: generate-apk
39+
3540
# The type of runner that the job will run on
3641
runs-on: ubuntu-latest
37-
42+
3843
# Identifies "gradle_validation" jobs that must complete successfully before this job will run.
39-
needs: gradle_vaildation
40-
44+
needs: gradle_validation
45+
4146
steps:
42-
43-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
44-
- name: Checkout
45-
uses: actions/checkout@v2
46-
47-
- name: Assemble Debug APK
47+
48+
# Checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it.
49+
- name: checkout
50+
uses: actions/checkout@v3
51+
52+
- name: generate-google-services-json
53+
env:
54+
FIREBASE_PROJECT_INFO: ${{ secrets.FIREBASE_PROJECT_INFO }}
55+
run: echo "$FIREBASE_PROJECT_INFO" | base64 --decode >> app/google-services.json
56+
57+
- name: assemble-debug-apk
4858
run: ./gradlew assembleDebug --full-stacktrace
49-
50-
- name: Upload Debug APK
51-
uses: actions/upload-artifact@v2
59+
60+
# Allowing you to share data between jobs and store data.
61+
- name: upload-debug-apk
62+
uses: actions/upload-artifact@v3
5263
with:
5364
name: app-debug
5465
path: app/build/outputs/apk/debug/app-debug.apk
55-
56-
- name: Assemble Android Test APK
66+
67+
- name: assemble-android-test-apk
5768
run: ./gradlew assembleDebugAndroidTest --full-stacktrace
58-
59-
- name: Upload Android Test APK
60-
uses: actions/upload-artifact@v2
69+
70+
# Allowing you to share data between jobs and store data.
71+
- name: upload-android-test-apk
72+
uses: actions/upload-artifact@v3
6173
with:
6274
name: app-debug-androidTest
6375
path: app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk
64-
76+
6577
unit_tests:
66-
name: Unit Tests
67-
78+
79+
name: unit-tests
80+
6881
# The type of runner that the job will run on
6982
runs-on: ubuntu-latest
70-
83+
7184
# Identifies "gradle_validation" jobs that must complete successfully before this job will run.
72-
needs: gradle_vaildation
73-
85+
needs: gradle_validation
86+
7487
# Steps represent a sequence of tasks that will be executed as part of the job
7588
steps:
76-
77-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
78-
- name: Checkout
79-
uses: actions/checkout@v2
80-
81-
- name: Run Unit Tests
89+
90+
# Checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it.
91+
- name: checkout
92+
uses: actions/checkout@v3
93+
94+
- name: generate-google-services-json
95+
env:
96+
FIREBASE_PROJECT_INFO: ${{ secrets.FIREBASE_PROJECT_INFO }}
97+
run: echo "$FIREBASE_PROJECT_INFO" | base64 --decode >> app/google-services.json && cd app && ls
98+
99+
- name: run-unit-tests
82100
run: ./gradlew test --full-stacktrace
83-
101+
84102
Instrumented_unit_tests:
85-
name: Instrumented Unit Tests With Firebase Test Lab
86-
103+
104+
name: instrumented-unit-tests-with-firebase-test-lab
105+
87106
# The type of runner that the job will run on
88107
runs-on: ubuntu-latest
89108

90109
# Add "id-token" with the intended permissions.
91110
permissions:
92111
contents: 'read'
93112
id-token: 'write'
94-
95-
# Identifies "apk" jobs that must complete successfully before this job will run.
96-
needs: apk
97-
113+
114+
# Identifies "generate_apk" jobs that must complete successfully before this job will run.
115+
needs: generate_apk
116+
98117
steps:
99-
100-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
101-
- name: Checkout
102-
uses: actions/checkout@v2
103-
104-
- name: Download APK
105-
uses: actions/download-artifact@v2
118+
119+
# Checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it.
120+
- name: checkout
121+
uses: actions/checkout@v3
122+
123+
# This downloads artifacts from your build.
124+
- name: download-apk
125+
uses: actions/download-artifact@v3
106126
with:
107127
name: app-debug
108-
109-
- name: Download Android Test APK
110-
uses: actions/download-artifact@v2
128+
129+
# This downloads artifacts from your build.
130+
- name: download-android-test-apk
131+
uses: actions/download-artifact@v3
111132
with:
112133
name: app-debug-androidTest
113134

114-
- name: Set up Auth
135+
# Establishes authentication to Google Cloud.
136+
- name: set-up-auth
115137
uses: google-github-actions/auth@v0
116138
with:
117139
workload_identity_provider: ${{ secrets.GCP_WIP }}
118140
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT}}
119141

120-
- name: Set up Cloud SDK
142+
# Configures the Google Cloud SDK.
143+
- name: set-up-cloud-sdk
121144
uses: google-github-actions/setup-gcloud@v0
122-
123-
- name: Run Instrumented Unit Tests In Firebase Test Lab
145+
146+
- name: run-instrumented-unit-tests-in-firebase-test-lab
124147
run: gcloud firebase test android run --type instrumentation --app app-debug.apk --test app-debug-androidTest.apk --device model=Pixel2,version=30

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ build/
99
.gradle/
1010

1111
# Local configuration file (sdk path, etc, serect keys)
12+
google-services.json
1213
local.properties
1314

1415
# Keystore files
1516
keystore/
1617

18+
# Generate .apk or .aab
19+
release/
20+
1721
# Proguard reports
1822
dead_code.txt
1923
full-r8-config.txt

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ Example of Android packages & frameworks.
66
* MacOS 11.4
77
* Android Studio Arctic Fox | 2020.3.1 Patch 2
88
* Android Gradle Plugin 7.0.2
9-
* Gradle 7.0.2
9+
* Gradle 7.2
1010
* JDK 11.0.13
11+
1112

12-
13-
## Language
14-
* Kotlin
13+
### Language
14+
* Kotlin 1.6.10
1515

1616

1717
## Architecture
1818
* MVVM
1919
* Clean Architecture
2020

2121

22-
## Featuring
22+
## Features
2323
* Multi Module
2424
* Navigation
2525
* Composite Build
@@ -32,6 +32,7 @@ Example of Android packages & frameworks.
3232
* Kotlin Parcelize
3333
* Kotlin AllOpen
3434
* Navigation SafeArgs
35+
* Crashlytics
3536
* Gradle Build
3637
* Lint
3738

@@ -55,4 +56,4 @@ Example of Android packages & frameworks.
5556

5657
## Reports
5758
* [Build Scan](https://scans.gradle.com/s/56hqvvvlvd2ja)
58-
* [Lint](https://htmlpreview.github.io/?https://github.com/henryhuang1219/Android-Demo/blob/master/app/reports/lint-results-debug.html)
59+
* [Lint](https://htmlpreview.github.io/?https://github.com/henryhuang1219/Android-Demo/blob/develope/reports/lint/lint-results-debug.html)

app/build.gradle

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ import me.lazy_assedninja.plugins.*
22

33
plugins {
44
id 'com.android.application'
5+
id 'com.google.gms.google-services'
6+
id 'com.google.firebase.crashlytics'
57
id 'kotlin-android'
68
id 'kotlin-kapt'
79
id 'kotlin-parcelize'
810
id 'kotlin-allopen'
911
id 'androidx.navigation.safeargs'
12+
id 'org.jetbrains.dokka'
1013
}
1114

1215
allOpen {
@@ -77,8 +80,8 @@ android {
7780
lintOptions {
7881
abortOnError false
7982
checkAllWarnings true
80-
disable 'InvalidPackage', 'MediaCapabilities', 'DuplicateStrings', 'LogConditional', 'ConvertToWebp'
81-
htmlOutput file("reports/lint-results-debug.html")
83+
disable 'InvalidPackage', 'MediaCapabilities', 'ConvertToWebp'
84+
htmlOutput file("../reports/lint/lint-results-debug.html")
8285
}
8386

8487
testOptions {
@@ -94,7 +97,7 @@ android {
9497
}
9598

9699
jacoco {
97-
version = "0.8.7"
100+
version = "0.8.8"
98101
}
99102
}
100103

@@ -112,13 +115,19 @@ dependencies {
112115
// Lifecycle
113116
implementation AndroidX.LIFECYCLE_LIVEDATA
114117
implementation AndroidX.LIFECYCLE_VIEWMODEL
118+
implementation AndroidX.LIFECYCLE_RUNTIME
115119
kapt AndroidX.LIFECYCLE_COMPILER
116120
implementation AndroidX.LIFECYCLE_EXTENSIONS
117121

118122
// Navigation
119123
implementation AndroidX.NAVIGATION_FRAGMENT_KTX
120124
implementation AndroidX.NAVIGATION_UI_KTX
121125

126+
// Firebase
127+
implementation platform(Google.FIREBASE)
128+
implementation Google.FIREBASE_CRASHLYTICS
129+
implementation Google.FIREBASE_ANALYTICS
130+
122131
// Dagger
123132
implementation Google.DAGGER
124133
kapt Google.DAGGER_COMPILER
@@ -151,6 +160,7 @@ dependencies {
151160
testImplementation AndroidX.CORE_TESTING
152161
testImplementation ThirdParty.JUNIT
153162
androidTestImplementation AndroidX.CORE_TESTING
163+
debugImplementation AndroidX.TEST_JUNIT
154164
androidTestImplementation AndroidX.TEST_JUNIT
155165
androidTestImplementation AndroidX.TEST_ESPRESSO
156166

app/proguard-rules.pro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@
9797

9898

9999
# To output a full report of all the rules that R8 applies.
100-
-printconfiguration full-r8-config.txt
100+
-printconfiguration ../reports/proguard/full-r8-config.txt
101101

102102
# Exhaustively list classes and class members matched by the various -keep options
103-
-printseeds seeds.txt
103+
-printseeds ../reports/proguard/seeds.txt
104104

105105
# List dead code of the input class files.
106-
-printusage dead_code.txt
106+
-printusage ../reports/proguard/dead_code.txt
107107

108108
# Print the mapping from old names to new names for classes and class members that have been renamed.
109-
-printmapping mapping.txt
109+
-printmapping ../reports/proguard/mapping.txt

app/src/debug/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
package="me.lazy_assedninja.demo">
33

44
<application
5-
android:allowBackup="false"
65
android:icon="@mipmap/icon">
76

87
<activity android:name=".testing.SingleFragmentActivity" />

app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
34
package="me.lazy_assedninja.demo">
45

56
<uses-permission android:name="android.permission.INTERNET" />
67

78
<application
89
android:name="me.lazy_assedninja.demo.application.DemoApplication"
9-
android:allowBackup="false"
10-
android:fullBackupContent="false"
10+
android:dataExtractionRules="@xml/backup_rules"
11+
android:fullBackupContent="@xml/backup_rules"
1112
android:icon="@mipmap/icon"
1213
android:label="@string/app_name"
1314
android:roundIcon="@mipmap/icon_round"
1415
android:supportsRtl="true"
15-
android:theme="@style/Theme.Demo">
16+
android:theme="@style/Theme.Demo"
17+
tools:targetApi="s">
1618

1719
<activity
1820
android:name="me.lazy_assedninja.demo.ui.splash.SplashScreenActivity"

0 commit comments

Comments
 (0)