Skip to content

Commit

Permalink
Merge pull request #309 from joeloewi7178/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
joeloewi7178 authored Dec 22, 2023
2 parents 158de8d + 8bddd9c commit 803947c
Show file tree
Hide file tree
Showing 350 changed files with 7,105 additions and 21,138 deletions.
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

0 comments on commit 803947c

Please sign in to comment.