Skip to content

Commit

Permalink
Merge pull request #112 from VictorKabata/develop
Browse files Browse the repository at this point in the history
Set up firebase app distribution for android app
  • Loading branch information
VictorKabata committed Jan 15, 2024
2 parents 8f8a068 + 91ca86e commit 507c2aa
Show file tree
Hide file tree
Showing 143 changed files with 1,321 additions and 820 deletions.
7 changes: 5 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[*.{kt,kts}]
disabled_rules = import-ordering, experimental:argument-list-wrapping,indent
insert_final_newline = true
disabled_rules = import-ordering, experimental:argument-list-wrapping, indent
insert_final_newline = true
# ij_kotlin_allow_trailing_comma = false
# ij_kotlin_allow_trailing_comma_on_call_site = false
# indent_size = unset
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

## Checklist
<!-- Mark the completed items with [x] and provide any additional comments when necessary. -->
- [ ] I have tested the changes on both Android and iOS platforms.
- [ ] I have tested the changes on both Android, iOS and Desktop platforms.
- [ ] I have written unit tests for the new code ___(if applicable)___.
- [ ] I have updated the project's documentation ___(if necessary)___.
- [ ] I have checked for any potential code duplications and removed them.
- [ ] I have run the Kotlin/Compose Multiplatform Gradle tasks and verified that they complete successfully.
- [ ] I have run the Kotlin/Compose Multiplatform Gradle tasks and verified that they were completed successfully.
- [ ] I have considered the impact of these changes on the existing codebase.

## Additional Notes
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ jobs:
steps:

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v1
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'adopt'
java-version: '17'

- name: Make gradle executable
run: chmod +x ./gradlew
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/deployAndroidDebug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy Android Debug
on:
workflow_dispatch:
inputs:
versionCode:
description: Version Code (eg. 123)
required: true
versionName:
description: Version Name (eg 1.2.3)
required: true

env:
VERSION_CODE: ${{ github.event.inputs.versionCode }}
VERSION_NAME: ${{ github.event.inputs.versionName }}

jobs:
setup:
name: ⚙️Setup Environment
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: "17"

build:
name: 🔨 Build
needs:
- setup
runs-on: ubuntu-latest
steps:
- name: Make gradle executable
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build --stacktrace

deploy:
name: 🚀 Deploy to Firebase App Distribution
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Make gradle executable
run: chmod +x ./gradlew

- name: Build Debug APK
run: ./gradlew assembleDebug --stacktrace

- name: Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1.7.0
with:
appId: ${{secrets.FIREBASE_APP_ID}}
serviceCredentialsFileContent: ${{secrets.CREDENTIAL_FILE_CONTENT}}
groups: production
file: appAndroid/build/outputs/apk/debug/appAndroid-debug.apk
53 changes: 0 additions & 53 deletions .github/workflows/deployDebug.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ local.properties
#Cocopods
appiOS/Pods/
appiOS/Podfile.lock
*.podspec
*.xcuserstate
19 changes: 14 additions & 5 deletions appAndroid/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,20 @@ android {
compileSdk = 34

defaultConfig {
applicationId = "com.vickikbt.notflix"
applicationId = "com.vickbt.notflix"

minSdk = 24
targetSdk = compileSdk
versionCode = 1
versionName = "1.0.0"
versionCode = if (System.getenv("VERSION_CODE").isNullOrEmpty()) {
1
} else {
System.getenv("VERSION_CODE").toInt()
}
versionName = if (System.getenv("VERSION_NAME").isNullOrEmpty()) {
"1.0.0"
} else {
System.getenv("VERSION_NAME")?.toString()
}

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -45,15 +53,16 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = "1.5.3"
kotlinCompilerExtensionVersion = "1.5.7"
}
namespace = "com.vickikbt.notflix"
namespace = "com.vickbt.notflix"
}

dependencies {
api(project(":shared"))

implementation(libs.androidX.core)
implementation(libs.androidX.activity)

implementation(libs.material)

Expand Down
26 changes: 8 additions & 18 deletions appAndroid/google-services.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
{
"project_info": {
"project_number": "393812441846",
"project_id": "notflix-e6c20",
"storage_bucket": "notflix-e6c20.appspot.com"
"project_number": "107303594937",
"project_id": "notflix-411314",
"storage_bucket": "notflix-411314.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:393812441846:android:88af4c42582e9416204ad7",
"mobilesdk_app_id": "1:107303594937:android:0220df24880eae00cbe468",
"android_client_info": {
"package_name": "com.vickikbt.notflix"
"package_name": "com.vickbt.notflix"
}
},
"oauth_client": [
{
"client_id": "393812441846-59nbigdpat8poe70p4tcncpguehsv8ud.apps.googleusercontent.com",
"client_type": 3
}
],
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDjY2tKIDwy6iNmlUj7z9js0sjtJVdufVc"
"current_key": "AIzaSyDGXoQCnf2wd8lZjey16miNnzylMapGJk8"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "393812441846-59nbigdpat8poe70p4tcncpguehsv8ud.apps.googleusercontent.com",
"client_type": 3
}
]
"other_platform_oauth_client": []
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.vickikbt.notflix
package com.vickbt.notflix

import android.app.Application
import com.vickikbt.shared.di.initKoin
import com.vickikbt.shared.utils.ContextUtils
import org.koin.android.BuildConfig
import com.vickbt.shared.di.initKoin
import com.vickbt.shared.utils.ContextUtils
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.logger.Level
Expand All @@ -16,7 +15,7 @@ class NotflixApplication : Application() {
ContextUtils.setContext(context = this)

initKoin {
androidLogger(level = if (BuildConfig.DEBUG) Level.ERROR else Level.NONE)
androidLogger(level = Level.NONE)
androidContext(androidContext = this@NotflixApplication)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.vickikbt.notflix.ui.activity
package com.vickbt.notflix.ui.activity

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.ExperimentalAnimationApi
import com.vickikbt.shared.ui.screens.main.MainScreen
import moe.tlaster.precompose.lifecycle.PreComposeActivity
import moe.tlaster.precompose.lifecycle.setContent
import com.vickbt.shared.ui.screens.main.MainScreen

@ExperimentalAnimationApi
class MainActivity : PreComposeActivity() {
class MainActivity : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
2 changes: 1 addition & 1 deletion appDesktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ dependencies {

compose.desktop {
application {
mainClass = "com.vickikbt.notflix.NotflixApplicationKt"
mainClass = "NotflixApplicationKt"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.vickbt.notflix

import androidx.compose.ui.window.application
import com.vickbt.notflix.ui.windows.MainWindow
import com.vickikbt.shared.di.initKoin
import com.vickbt.shared.di.initKoin
import org.koin.core.Koin

lateinit var koin: Koin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.ApplicationScope
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.WindowPosition
import androidx.compose.ui.window.rememberWindowState
import com.vickikbt.shared.ui.screens.main.MainScreen
import moe.tlaster.precompose.PreComposeWindow
import com.vickbt.shared.ui.screens.main.MainScreen

@Composable
fun MainWindow(applicationScope: ApplicationScope) {
PreComposeWindow(
Window(
onCloseRequest = { applicationScope.exitApplication() },
title = "Notflix",
state = rememberWindowState(
position = WindowPosition.Aligned(Alignment.Center),
width = 1080.dp, // or Dp.Unspecified,
height = 800.dp, // or Dp.Unspecified,
width = 1080.dp,
height = 800.dp,
)
) {
MainScreen()
Expand Down
18 changes: 18 additions & 0 deletions appiOS/Notflix.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
1CE0FB052A6A8B4F00B26932 /* Frameworks */,
1CE0FB062A6A8B4F00B26932 /* Resources */,
3D4331466293CD88FAB5966F /* [CP] Copy Pods Resources */,
987E1C4A95024182A3B0F904 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -302,6 +303,23 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Notflix/Pods-Notflix-resources.sh\"\n";
showEnvVarsInLog = 0;
};
987E1C4A95024182A3B0F904 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Notflix/Pods-Notflix-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Notflix/Pods-Notflix-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Notflix/Pods-Notflix-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
993BC5CD8E6407198A6CC6F3 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 0 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,3 @@ kotlin.native.cocoapods.generate.wrapper=true
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
kotlin.native.useEmbeddableCompilerJar=true
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
Loading

0 comments on commit 507c2aa

Please sign in to comment.