Skip to content
Merged

Dev #17

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Upload artifact
uses: actions/upload-artifact@v2
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: android-app
path: app/build/outputs/apk/debug/app-debug.apk
path: app/build/outputs/apk/*/*/*.apk
39 changes: 31 additions & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,51 @@ android {
defaultConfig {
applicationId = "me.floow.app"
minSdk = 28
targetSdk = 34
targetSdk = 35
versionCode = 1
versionName = "1.0"


testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}

val secretsFile = project.rootProject.file("secrets.properties")
val secretsProperties = Properties()
secretsProperties.load(secretsFile.inputStream())
// val secretsFile = project.rootProject.file("secrets.properties")
// val secretsProperties = Properties()
// secretsProperties.load(secretsFile.inputStream())

val googleClientId = secretsProperties.getProperty("googleClientId") ?: ""
// val googleClientId = secretsProperties.getProperty("googleClientId") ?: ""
buildConfigField(
type = "String",
name = "GOOGLE_CLIENT_ID",
value = googleClientId
value = "BUILD_TYPE" // mock
)
}

flavorDimensions += "data"

productFlavors {
create("production") {
dimension = "data"

buildConfigField(
name = "USE_MOCK_DATA",
value = "false",
type = "boolean"
)
}

create("mock") {
dimension = "data"
applicationIdSuffix = ".mock"
buildConfigField(
name = "USE_MOCK_DATA",
value = "true",
type = "boolean"
)
}
}

buildTypes {
release {
isMinifyEnabled = true
Expand Down Expand Up @@ -106,4 +129,4 @@ dependencies {
androidTestImplementation(libs.ui.test.junit4)
debugImplementation(libs.ui.tooling)
debugImplementation(libs.ui.test.manifest)
}
}
21 changes: 20 additions & 1 deletion app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,26 @@
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:291755427997:android:a5bdc8e67ad57b441a2c74",
"android_client_info": {
"package_name": "me.floow.app.mock"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDtGUu5IMFTc5-PW5Ta2LkPmlCrolVUOdo"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
}
16 changes: 8 additions & 8 deletions app/src/main/java/me/floow/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import me.floow.chatssearch.di.usersearchModule
import kotlinx.coroutines.CoroutineName
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import me.floow.app.BuildConfig.*
import me.floow.app.di.apiModule
import me.floow.app.di.appModule
import me.floow.app.di.authModule
Expand Down Expand Up @@ -49,15 +50,14 @@ class MainActivity : ComponentActivity() {
startKoin {
androidContext(this@MainActivity)

val mockDependencies = false // TODO: make build flavors with and without mocks

if (!mockDependencies) {
@Suppress("KotlinConstantConditions")
if (USE_MOCK_DATA) {
modules(
appModule,
apiModule,
authModule,
mockAuthModule,
databaseModule,
dataModule,
mockDataModule,
domainModule,
mockModule,
loginModule,
Expand All @@ -69,9 +69,9 @@ class MainActivity : ComponentActivity() {
modules(
appModule,
apiModule,
mockAuthModule,
authModule,
databaseModule,
mockDataModule,
dataModule,
domainModule,
mockModule,
loginModule,
Expand Down Expand Up @@ -123,4 +123,4 @@ class MainActivity : ComponentActivity() {

super.attachBaseContext(newBase?.createConfigurationContext(newConfiguration))
}
}
}
3 changes: 3 additions & 0 deletions app/src/mock/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">Flow (Mock)</string>
</resources>
2 changes: 1 addition & 1 deletion feature/profile/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ dependencies {

androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.espresso.core)
}
}
1 change: 1 addition & 0 deletions feature/shared/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ kotlin.code.style=official
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=true