201 lines
No EOL
6 KiB
Kotlin
201 lines
No EOL
6 KiB
Kotlin
import java.nio.charset.Charset
|
|
|
|
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
id("com.google.dagger.hilt.android")
|
|
id("com.google.gms.google-services")
|
|
id("com.google.firebase.crashlytics")
|
|
id("androidx.room")
|
|
id("com.google.devtools.ksp")
|
|
}
|
|
|
|
android {
|
|
namespace = "com.pixelized.rplexicon"
|
|
compileSdk = 34
|
|
|
|
signingConfigs {
|
|
getByName("debug") {
|
|
storeFile = file("../debug.keystore")
|
|
storePassword = "123456"
|
|
keyAlias = "debug"
|
|
keyPassword = "123456"
|
|
}
|
|
create("pixelized") {
|
|
storeFile =
|
|
(project.properties["PIXELIZED_RELEASE_STORE_FILE"] as? String)?.let { file(it) }
|
|
storePassword = project.properties["PIXELIZED_RELEASE_STORE_PASSWORD"] as? String
|
|
keyAlias = project.properties["PIXELIZED_RELEASE_KEY_ALIAS"] as? String
|
|
keyPassword = project.properties["PIXELIZED_RELEASE_KEY_PASSWORD"] as? String
|
|
}
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId = "com.pixelized.rplexicon"
|
|
minSdk = 26
|
|
targetSdk = 34
|
|
versionName = "0.13.5"
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
vectorDrawables {
|
|
useSupportLibrary = true
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
applicationIdSuffix = ".dev"
|
|
isDebuggable = true
|
|
isMinifyEnabled = false
|
|
signingConfig = signingConfigs.getByName("debug")
|
|
defaultConfig {
|
|
versionCode = 1
|
|
}
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
|
|
)
|
|
}
|
|
release {
|
|
isDebuggable = false
|
|
isMinifyEnabled = true
|
|
signingConfig = signingConfigs.getByName("pixelized")
|
|
defaultConfig {
|
|
versionCode = getGitBuildNumber()
|
|
}
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
|
|
)
|
|
}
|
|
}
|
|
|
|
defaultConfig {
|
|
buildConfigField("String", "TIME_FORMAT", "\"$timeFormat\"")
|
|
buildConfigField("Long", "TIMESTAMP", "${System.currentTimeMillis()}L")
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
buildConfig = true
|
|
}
|
|
|
|
composeOptions {
|
|
kotlinCompilerExtensionVersion = "1.5.11"
|
|
}
|
|
|
|
packaging {
|
|
resources {
|
|
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
|
}
|
|
}
|
|
|
|
lint {
|
|
lintConfig = file("$rootDir/lint-config.xml")
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation("androidx.core:core-ktx:1.13.1")
|
|
implementation("androidx.activity:activity-compose:1.9.2")
|
|
|
|
// Compose
|
|
implementation("androidx.compose.ui:ui:1.7.0")
|
|
implementation("androidx.compose.ui:ui-util:1.7.0")
|
|
implementation("androidx.compose.ui:ui-graphics:1.7.0")
|
|
implementation("androidx.compose.ui:ui-tooling-preview:1.7.0")
|
|
implementation("androidx.compose.material:material:1.7.0")
|
|
implementation("androidx.compose.material3:material3:1.3.0")
|
|
debugImplementation("androidx.compose.ui:ui-tooling:1.7.0")
|
|
|
|
implementation("androidx.constraintlayout:constraintlayout-compose:1.0.1")
|
|
|
|
// Navigation
|
|
implementation("androidx.navigation:navigation-compose:2.8.0")
|
|
|
|
// Accompanist
|
|
implementation("com.google.accompanist:accompanist-placeholder:0.34.0")
|
|
|
|
// Splash Screen support prior to Android 12
|
|
implementation("androidx.core:core-splashscreen:1.0.1")
|
|
|
|
// Google Auth
|
|
implementation("androidx.credentials:credentials:1.2.2")
|
|
implementation("androidx.credentials:credentials-play-services-auth:1.2.2")
|
|
implementation("com.google.android.libraries.identity.googleid:googleid:1.1.1")
|
|
|
|
// Google service
|
|
implementation("com.google.android.gms:play-services-auth:21.2.0")
|
|
implementation(
|
|
dependencyNotation = "com.google.api-client:google-api-client-android:1.23.0",
|
|
dependencyConfiguration = { exclude("org.apache.httpcomponents") },
|
|
)
|
|
implementation(
|
|
dependencyNotation = "com.google.apis:google-api-services-sheets:v4-rev20220927-2.0.0",
|
|
dependencyConfiguration = { exclude("org.apache.httpcomponents") },
|
|
)
|
|
|
|
// Import the BoM for the Firebase platform
|
|
implementation(platform("com.google.firebase:firebase-bom:33.2.0"))
|
|
implementation("com.google.firebase:firebase-crashlytics-ktx")
|
|
implementation("com.google.firebase:firebase-analytics-ktx")
|
|
implementation("com.google.firebase:firebase-auth-ktx")
|
|
implementation("com.google.firebase:firebase-database-ktx")
|
|
implementation("com.google.firebase:firebase-config-ktx")
|
|
|
|
// Hilt: Dependency injection
|
|
implementation("androidx.hilt:hilt-navigation-compose:1.2.0")
|
|
implementation("com.google.dagger:hilt-android:2.51.1")
|
|
ksp("com.google.dagger:hilt-android-compiler:2.51.1")
|
|
ksp("com.google.dagger:hilt-compiler:2.51.1")
|
|
|
|
// Room
|
|
implementation("androidx.room:room-runtime:2.6.1")
|
|
implementation("androidx.room:room-ktx:2.6.1")
|
|
ksp("androidx.room:room-compiler:2.6.1")
|
|
|
|
// DataStore
|
|
implementation("androidx.datastore:datastore-preferences:1.1.1")
|
|
|
|
// Image
|
|
implementation("io.coil-kt:coil-compose:2.6.0")
|
|
}
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion.set(JavaLanguageVersion.of(17))
|
|
}
|
|
}
|
|
|
|
kotlin {
|
|
jvmToolchain(17)
|
|
}
|
|
|
|
room {
|
|
schemaDirectory("$projectDir/schemas")
|
|
}
|
|
|
|
private val timeFormat: String
|
|
get() = "dd/MM/yyyy HH:mm:ss"
|
|
|
|
private fun getGitBuildNumber(
|
|
charset: Charset = Charset.defaultCharset(),
|
|
): Int {
|
|
return try {
|
|
val stdout = org.apache.commons.io.output.ByteArrayOutputStream()
|
|
rootProject.exec {
|
|
commandLine("git", "rev-list", "--count", "HEAD")
|
|
standardOutput = stdout
|
|
}
|
|
stdout.toString(charset).trim().toInt()
|
|
} catch (e: Exception) {
|
|
0
|
|
}
|
|
} |