Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #309

Merged
merged 70 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
8f0e32b
mod: update dependencies
joeloewi7178 Dec 4, 2023
8767dc2
mod: set executors to libraries
joeloewi7178 Dec 5, 2023
5315b04
mod: remove custom state class, and move it into composable
joeloewi7178 Dec 6, 2023
ca6fff8
mod: complete remove custom state class
joeloewi7178 Dec 6, 2023
9cb220d
mod: rebase
joeloewi7178 Dec 4, 2023
734d79e
mod: set executors to libraries
joeloewi7178 Dec 5, 2023
823acb9
mod: remove custom state class, and move it into composable
joeloewi7178 Dec 6, 2023
789ae99
mod: complete remove custom state class
joeloewi7178 Dec 6, 2023
bd03ae2
Merge remote-tracking branch 'origin/development' into development
joeloewi7178 Dec 7, 2023
d30f67c
mod: use firebase sdk properly
joeloewi7178 Dec 7, 2023
f6bce9b
add: dummy google-services.json file
joeloewi7178 Dec 8, 2023
1a57a3d
mod: permission name per sdk version
joeloewi7178 Dec 13, 2023
cf16590
mod: use custom handler when register broadcast receiver
joeloewi7178 Dec 13, 2023
858a8ad
mod: replace folder name
joeloewi7178 Dec 14, 2023
b7eb239
mod: avoid use context in viewmodel
joeloewi7178 Dec 15, 2023
eb98a75
mod: rebase
joeloewi7178 Dec 4, 2023
792a417
mod: set executors to libraries
joeloewi7178 Dec 5, 2023
3c67c55
mod: remove custom state class, and move it into composable
joeloewi7178 Dec 6, 2023
d34ef91
mod: complete remove custom state class
joeloewi7178 Dec 6, 2023
227af41
mod: complete remove custom state class
joeloewi7178 Dec 17, 2023
2d9cbec
add: fake google-service.json
joeloewi7178 Dec 17, 2023
7ac7b39
mod: set executors to libraries
joeloewi7178 Dec 5, 2023
c5ebddd
mod: remove custom state class, and move it into composable
joeloewi7178 Dec 6, 2023
70621a6
mod: complete remove custom state class
joeloewi7178 Dec 6, 2023
5b8f9a5
mod: use firebase sdk properly
joeloewi7178 Dec 7, 2023
552d89d
add: dummy google-services.json file
joeloewi7178 Dec 8, 2023
f22c6f1
mod: permission name per sdk version
joeloewi7178 Dec 13, 2023
ee33191
mod: use custom handler when register broadcast receiver
joeloewi7178 Dec 13, 2023
863dab3
mod: replace folder name
joeloewi7178 Dec 14, 2023
15e3bec
mod: avoid use context in viewmodel
joeloewi7178 Dec 15, 2023
57b5cd0
Merge remote-tracking branch 'origin/development' into development
joeloewi7178 Dec 17, 2023
78270bf
mod: add window insets properly for wide screens
joeloewi7178 Dec 17, 2023
e88c7a9
mod: utilize notification
joeloewi7178 Dec 18, 2023
74cc9df
add: add string resources
joeloewi7178 Dec 19, 2023
73858c2
mod: replace LCE to ILCE
joeloewi7178 Dec 19, 2023
b7b6f83
del: single dispatcher dependency
joeloewi7178 Dec 20, 2023
5dc1a5a
mod: rebase
joeloewi7178 Dec 4, 2023
b601623
mod: set executors to libraries
joeloewi7178 Dec 5, 2023
ff12fe4
mod: remove custom state class, and move it into composable
joeloewi7178 Dec 6, 2023
751bc1b
mod: complete remove custom state class
joeloewi7178 Dec 6, 2023
83216e7
mod: complete remove custom state class
joeloewi7178 Dec 17, 2023
7fdf3e7
add: fake google-service.json
joeloewi7178 Dec 17, 2023
6740dbc
mod: set executors to libraries
joeloewi7178 Dec 5, 2023
c0fb75f
mod: remove custom state class, and move it into composable
joeloewi7178 Dec 6, 2023
7c375a4
mod: complete remove custom state class
joeloewi7178 Dec 6, 2023
a2da612
mod: use firebase sdk properly
joeloewi7178 Dec 7, 2023
53362ae
add: dummy google-services.json file
joeloewi7178 Dec 8, 2023
65b23d7
mod: permission name per sdk version
joeloewi7178 Dec 13, 2023
905bb68
mod: use custom handler when register broadcast receiver
joeloewi7178 Dec 13, 2023
617bbb2
mod: replace folder name
joeloewi7178 Dec 14, 2023
d42d379
mod: avoid use context in viewmodel
joeloewi7178 Dec 15, 2023
ab8a516
mod: rebase
joeloewi7178 Dec 4, 2023
b93ce34
mod: update dependencies
joeloewi7178 Dec 4, 2023
05d40b6
mod: set executors to libraries
joeloewi7178 Dec 5, 2023
8038cd9
mod: replace folder name
joeloewi7178 Dec 14, 2023
7e4e769
mod: avoid use context in viewmodel
joeloewi7178 Dec 15, 2023
7a82e99
mod: add window insets properly for wide screens
joeloewi7178 Dec 17, 2023
53fc9e0
mod: utilize notification
joeloewi7178 Dec 18, 2023
143960e
add: add string resources
joeloewi7178 Dec 19, 2023
37ffa23
mod: replace LCE to ILCE
joeloewi7178 Dec 19, 2023
9d633c0
del: single dispatcher dependency
joeloewi7178 Dec 20, 2023
1e37613
Merge remote-tracking branch 'origin/development' into development
joeloewi7178 Dec 21, 2023
8c76862
mod: allow connected device when generate baseline profile
joeloewi7178 Dec 21, 2023
b51fc6e
versionCode 42
joeloewi7178 Dec 21, 2023
ed99901
Update on_pull_request.yml
joeloewi7178 Dec 21, 2023
c3f8891
versionCode 42
joeloewi7178 Dec 21, 2023
941f9d3
Merge remote-tracking branch 'origin/development' into development
joeloewi7178 Dec 21, 2023
a188539
Update on_pull_request.yml
joeloewi7178 Dec 21, 2023
36149a4
versionCode 42
joeloewi7178 Dec 22, 2023
8bddd9c
versionCode 42
joeloewi7178 Dec 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 12 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
build:
# The type of runner that the job will run on
runs-on: macos-latest
timeout-minutes: 120

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -30,6 +31,9 @@ jobs:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Grant execute permission for gradlew
run: chmod +x gradlew

Expand All @@ -43,31 +47,13 @@ jobs:
fileDir: './'
encodedString: ${{ secrets.SIGNING_KEY }}

- name: Generate baseline profile
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 33
avd-name: baselineProfGenerator
target: google_apis
arch: x86_64
emulator-build: 9322596
script: ./gradlew :benchmark:connectedBenchmarkAndroidTest -P android.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile

- name: Move generated baseline profile to target folder
run: mv -f './benchmark/build/outputs/connected_android_test_additional_output/benchmark/connected/baselineProfGenerator(AVD) - 13/BaselineProfileGenerator_generate-baseline-prof.txt' ./app/src/main/baseline-prof.txt

- name: Check baseline-prof file status
run: stat ./app/src/main/baseline-prof.txt

- name: View some lines of baseline-prof file
run: head ./app/src/main/baseline-prof.txt

- name: Build with Gradle
run: ./gradlew assemble

- name: Build Release AAB
id: buildRelease
run: ./gradlew bundleRelease
- name: Build release variant including baseline profile generation
run: ./gradlew :app:assembleRelease
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
-Pandroid.experimental.androidTest.numManagedDeviceShards=1
-Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1

- name: Upload Android Release to Play Store
uses: r0adkll/upload-google-play@v1
Expand All @@ -78,4 +64,4 @@ jobs:
track: internal
status: completed
inAppUpdatePriority: 5
mappingFile: app/build/outputs/mapping/release/mapping.txt
mappingFile: app/build/outputs/mapping/release/mapping.txt
29 changes: 19 additions & 10 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# This is a basic workflow to help you get started with Actions

name: Build
name: OnPullRequest

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
pull_request:
branches: [ "master" ]
branches: [ master ]

env:
ALIAS: ${{ secrets.ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
runs-on: macos-latest
timeout-minutes: 120

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -26,6 +31,9 @@ jobs:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Grant execute permission for gradlew
run: chmod +x gradlew

Expand All @@ -39,9 +47,10 @@ jobs:
fileDir: './'
encodedString: ${{ secrets.SIGNING_KEY }}

- name: Build with Gradle
run: ./gradlew clean build --no-daemon --parallel build
env:
ALIAS: ${{ secrets.ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
- name: Build release variant including baseline profile generation
run: ./gradlew :app:assembleRelease
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
-Pandroid.experimental.androidTest.numManagedDeviceShards=1
-Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ captures/
*.keystore

# Google Services (e.g. APIs or Firebase)
google-services.json
# google-services.json

# Android Patch
gen-external-apklibs
Expand Down
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,3 @@ An android app that can attend HoYoLAB check-in events automatically

- Clean Architecture
- MVVM

# Before Build & Run

This project uses firebase and not contains *google-services.json* file because it's a server key.
There will be errors if you only cloned and run it, so you have to get *google-services.json* from
your own firebase project and put in to cloned project directory.
1 change: 0 additions & 1 deletion app/baseline-profiles-rules.pro

This file was deleted.

43 changes: 19 additions & 24 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
id("croissant.android.application")
id("croissant.android.application.compose")
id("croissant.android.hilt")
alias(libs.plugins.gms.google.services)
alias(libs.plugins.croissant.android.application)
alias(libs.plugins.croissant.android.application.compose)
alias(libs.plugins.croissant.android.hilt)
alias(libs.plugins.croissant.android.application.firebase)
id("kotlin-parcelize")
alias(libs.plugins.firebase.crashlytics)
id("com.google.android.gms.oss-licenses-plugin")
alias(libs.plugins.androidx.baselineprofile)
}

kotlin {
Expand All @@ -20,8 +20,9 @@ android {

defaultConfig {
applicationId = "com.joeloewi.croissant"
versionCode = 41
versionName = "1.2.0"
versionCode = 42
versionName = "1.2.1"
targetSdk = 34

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -50,24 +51,27 @@ android {
)
signingConfig = signingConfigs.getByName("release")
}
val benchmark by creating {
initWith(release)
signingConfig = signingConfigs.getByName("release")
matchingFallbacks += listOf("release")
isDebuggable = false
proguardFiles("baseline-profiles-rules.pro")
}
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
buildFeatures {
buildConfig = true
}
}

baselineProfile {
// Don't build on every iteration of a full assemble.
// Instead enable generation directly for the release build variant.
automaticGenerationDuringBuild = false
}

dependencies {
implementation(project(":data"))
implementation(project(":domain"))
baselineProfile(project(":baselineprofile"))

implementation(libs.androidx.core.ktx)
implementation(libs.android.material)
Expand All @@ -90,7 +94,6 @@ dependencies {

//hilt-extension
implementation(libs.hilt.ext.work)
kapt(libs.hilt.ext.compiler)

//compose
implementation(libs.androidx.compose.foundation)
Expand All @@ -99,6 +102,7 @@ dependencies {
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.runtime.livedata)
implementation(libs.androidx.compose.material.iconsExtended)
implementation(libs.androidx.compose.ui.util)
debugImplementation(libs.androidx.compose.ui.tooling)

//accompanist
Expand Down Expand Up @@ -140,11 +144,6 @@ dependencies {
//in-app review
implementation(libs.android.play.review.ktx)

//firebase
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.analytics.ktx)
implementation(libs.firebase.crashlytics.ktx)

//leakCanary
debugImplementation(libs.leakcanary.android)

Expand All @@ -158,8 +157,4 @@ dependencies {

//open source license activity
implementation(libs.gms.play.services.oss.licenses)
}

hilt {
enableAggregatingTask = true
}
29 changes: 29 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "YourProjectId",
"project_id": "abc",
"storage_bucket": "abc"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "Your:App:Id",
"android_client_info": {
"package_name": "com.joeloewi.croissant"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "APlaceholderAPIKeyWith-ThirtyNineCharsX"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
25 changes: 6 additions & 19 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,7 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

<uses-permission
android:name="android.permission.READ_PHONE_STATE"
tools:node="remove" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
tools:node="remove"
android:maxSdkVersion="32" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="32"
tools:ignore="ScopedStorage"
tools:node="remove" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />

<queries>
<intent>
Expand Down Expand Up @@ -77,6 +65,7 @@
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">

<!-- in android 13, creating notification channel request post_notifications permission -->
<!-- so disable auto initializing -->
<meta-data
Expand All @@ -91,12 +80,6 @@
<meta-data
android:name="com.joeloewi.croissant.initializer.CoilInitializer"
android:value="androidx.startup" />
<meta-data
android:name="com.joeloewi.croissant.initializer.ComposeViewInitializer"
android:value="androidx.startup" />
<meta-data
android:name="com.joeloewi.croissant.initializer.FirebaseAnalyticsInitializer"
android:value="androidx.startup" />
<meta-data
android:name="androidx.work.WorkManagerInitializer"
android:value="androidx.startup"
Expand Down Expand Up @@ -145,6 +128,10 @@
<service
android:name=".service.RemoteViewsFactoryService"
android:permission="android.permission.BIND_REMOTEVIEWS" />
<service
android:name="androidx.work.impl.foreground.SystemForegroundService"
android:foregroundServiceType="dataSync"
tools:node="merge" />

<activity
android:name=".MainActivity"
Expand Down
Loading