import java.text.SimpleDateFormat import java.util.Date import java.util.Locale 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.9.1" 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 = gitBuildNumber } proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) } } buildTypes.onEach { it.buildConfigField("String", "DEFAULT_READ_TIME_STAMP", "\"$defaultReadTimestamp\"") } 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}" } } lint { lintConfig = file("$rootDir/lint-config.xml") } } dependencies { implementation("androidx.core:core-ktx:1.12.0") implementation("androidx.activity:activity-compose:1.8.2") // Compose implementation("androidx.compose.ui:ui:1.5.4") implementation("androidx.compose.ui:ui-util:1.5.4") implementation("androidx.compose.ui:ui-graphics:1.5.4") implementation("androidx.compose.ui:ui-tooling-preview:1.5.4") implementation("androidx.compose.material:material:1.5.4") implementation("androidx.compose.material3:material3:1.1.2") debugImplementation("androidx.compose.ui:ui-tooling:1.5.4") implementation("androidx.constraintlayout:constraintlayout-compose:1.0.1") // Navigation implementation("androidx.navigation:navigation-compose:2.7.6") // Accompanist implementation("com.google.accompanist:accompanist-placeholder:0.32.0") // Splash Screen support prior to Android 12 implementation("androidx.core:core-splashscreen:1.0.1") // Google service implementation("com.google.android.gms:play-services-auth:20.7.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:32.7.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") // Hilt: Dependency injection implementation("androidx.hilt:hilt-navigation-compose:1.1.0") implementation("com.google.dagger:hilt-android:2.50") ksp("com.google.dagger:hilt-android-compiler:2.50") ksp("com.google.dagger:hilt-compiler:2.50") // 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") // Image implementation("io.coil-kt:coil-compose:2.5.0") } java { toolchain { languageVersion.set(JavaLanguageVersion.of(17)) } } kotlin { jvmToolchain(17) } room { schemaDirectory("$projectDir/schemas") } val defaultReadTimestamp: String get() { val formatter = SimpleDateFormat("dd/MM/yyyy HH:mm:ss", Locale.FRANCE) return formatter.format(Date()).toString() } val gitBuildNumber: Int get() { val stdout = org.apache.commons.io.output.ByteArrayOutputStream() rootProject.exec { commandLine("git", "rev-list", "--count", "HEAD") standardOutput = stdout } return stdout.toString().trim().toInt() }