-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added firebase crashlytics support and migrated gradle groovy to kotl…
…in dsl (#53)
- Loading branch information
Showing
11 changed files
with
224 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ keystore.properties | |
Keystore.p12 | ||
app/release | ||
news-feed-play-config.json | ||
google-services.json |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
@file:Suppress("UnstableApiUsage") | ||
|
||
import java.util.Properties | ||
|
||
plugins { | ||
alias(libs.plugins.android.application) | ||
alias(libs.plugins.kotlin.android) | ||
alias(libs.plugins.ksp) | ||
alias(libs.plugins.kotlin.parcelize) | ||
alias(libs.plugins.androidx.baselineprofile) | ||
alias(libs.plugins.detekt) | ||
if (File("app/google-services.json").exists() && File("app/src/debug/google-services.json").exists()) { | ||
alias(libs.plugins.google.services) | ||
alias(libs.plugins.firebase.crashlytics) | ||
} | ||
} | ||
|
||
val debugAppSuffix = ".debug" | ||
|
||
val localPropertiesFile = rootProject.file("local.properties") | ||
val localProperties = Properties() | ||
var newsFeedApiKey = if (localPropertiesFile.exists()) { | ||
localProperties.load(localPropertiesFile.inputStream()) | ||
localProperties.getProperty("NEWS_FEED_API_KEY") ?: "\"${System.getenv("NEWS_FEED_API_KEY")}\"" | ||
} else { | ||
"\"${System.getenv("NEWS_FEED_API_KEY")}\"" | ||
} | ||
|
||
val keystorePropertiesFile = rootProject.file("keystore.properties") | ||
val keystoreProperties = Properties() | ||
if (keystorePropertiesFile.exists()) { | ||
keystoreProperties.load(keystorePropertiesFile.inputStream()) | ||
} | ||
|
||
android { | ||
experimentalProperties["android.experimental.art-profile-r8-rewriting"] = true | ||
experimentalProperties["android.experimental.r8.dex-startup-optimization"] = true | ||
signingConfigs { | ||
create("release") { | ||
storeFile = file("../Keystore.p12") | ||
storePassword = keystoreProperties["storePassword"] as? String | ||
keyAlias = keystoreProperties["keyAlias"] as? String | ||
keyPassword = keystoreProperties["keyPassword"] as? String | ||
} | ||
} | ||
compileSdk = 34 | ||
|
||
defaultConfig { | ||
applicationId = "com.rob729.newsfeed" | ||
minSdk = 24 | ||
targetSdk = 34 | ||
versionCode = 1 | ||
versionName = "1.0.0" | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
vectorDrawables.useSupportLibrary = true | ||
|
||
buildConfigField("String", "NEWS_FEED_API_KEY", newsFeedApiKey) | ||
|
||
ksp { | ||
arg("room.schemaLocation", "$projectDir/schemas") | ||
} | ||
} | ||
|
||
buildTypes { | ||
getByName("debug") { | ||
applicationIdSuffix = debugAppSuffix | ||
} | ||
getByName("release") { | ||
isShrinkResources = true | ||
isMinifyEnabled = true | ||
isDebuggable = false | ||
|
||
signingConfig = signingConfigs.getByName("release") | ||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") | ||
} | ||
create("benchmark") { | ||
initWith(getByName("release")) | ||
signingConfig = signingConfigs.getByName("debug") | ||
proguardFiles("benchmark-rules.pro") | ||
matchingFallbacks += listOf("release") | ||
} | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "17" | ||
} | ||
buildFeatures { | ||
compose = true | ||
buildConfig = true | ||
} | ||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.5.7" | ||
} | ||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
} | ||
namespace = "com.rob729.newsfeed" | ||
} | ||
|
||
baselineProfile { | ||
dexLayoutOptimization = true | ||
baselineProfileRulesRewrite = true | ||
baselineProfileOutputDir = "../../src/main/baselineProfiles" | ||
} | ||
|
||
dependencies { | ||
|
||
implementation(libs.androidx.core.ktx) | ||
implementation(platform(libs.compose.bom)) | ||
implementation(libs.compose.ui) | ||
implementation(libs.androidx.compose.ui.tooling.preview) | ||
implementation(libs.androidx.lifecycle.runtime.ktx) | ||
implementation(libs.androidx.activity.compose) | ||
testImplementation(libs.junit) | ||
|
||
androidTestImplementation(libs.androidx.junit) | ||
androidTestImplementation(libs.androidx.espresso.core) | ||
"baselineProfile"(project(":baselineprofile")) | ||
debugImplementation(libs.androidx.compose.ui.tooling) | ||
debugImplementation(libs.androidx.compose.ui.test.manifest) | ||
implementation(libs.androidx.navigation.compose) | ||
implementation(libs.androidx.compose.material.icons.extended) | ||
implementation(libs.androidx.compose.material3) | ||
implementation(libs.androidx.lifecycle.viewmodel.compose) | ||
implementation(libs.androidx.constraintlayout.compose) | ||
|
||
implementation(libs.androidx.work.runtime.ktx) | ||
implementation(libs.androidx.browser) | ||
implementation(libs.androidx.profileinstaller) | ||
implementation(libs.androidx.startup.runtime) | ||
implementation(libs.androidx.datastore.preferences) | ||
implementation(libs.androidx.runtime.tracing) | ||
|
||
implementation(libs.coil) | ||
implementation(libs.coil.compose) | ||
|
||
implementation(libs.moshi.kotlin) | ||
ksp(libs.moshi.codegen) | ||
|
||
implementation(libs.orbit.viewmodel) | ||
implementation(libs.orbit.compose) | ||
|
||
implementation(libs.retrofit) | ||
implementation(libs.converter.moshi) | ||
implementation(libs.logging.interceptor) | ||
|
||
implementation(libs.kotlinx.datetime) | ||
|
||
implementation(libs.androidx.room.runtime) | ||
ksp(libs.androidx.room.compiler) | ||
implementation(libs.androidx.room.ktx) | ||
|
||
implementation(libs.koin.android) | ||
implementation(libs.koin.androidx.compose) | ||
|
||
debugImplementation(libs.pluto) | ||
releaseImplementation(libs.pluto.no.op) | ||
|
||
debugImplementation(libs.bundle.core) | ||
releaseImplementation(libs.bundle.core.no.op) | ||
|
||
if (File("${project.projectDir}/google-services.json").exists() && File("${project.projectDir}/src/debug/google-services.json").exists()) { | ||
implementation(platform(libs.firebase.bom)) | ||
implementation(libs.firebase.analytics) | ||
implementation(libs.firebase.crashlytics) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.