157 lines
5.4 KiB
Kotlin
157 lines
5.4 KiB
Kotlin
import java.io.FileInputStream
|
|
import java.util.Properties
|
|
|
|
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
id("org.jetbrains.kotlin.plugin.compose")
|
|
id("org.jetbrains.kotlin.plugin.serialization")
|
|
id("com.google.dagger.hilt.android")
|
|
id("com.google.devtools.ksp")
|
|
}
|
|
|
|
val keystorePropertiesFile = rootProject.file("keystore.properties")
|
|
val keystoreProperties = Properties()
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
|
}
|
|
|
|
android {
|
|
namespace = "ai.hesychia.chat"
|
|
compileSdk = 35
|
|
|
|
defaultConfig {
|
|
applicationId = "ai.hesychia.chat"
|
|
minSdk = 23
|
|
targetSdk = 35
|
|
versionCode = 1
|
|
versionName = "0.1.0"
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
buildConfigField("String", "REVENUECAT_GOOGLE_API_KEY", "\"\"")
|
|
buildConfigField("String", "REVENUECAT_OFFERING_ID", "\"\"")
|
|
}
|
|
|
|
signingConfigs {
|
|
create("release") {
|
|
if (keystorePropertiesFile.exists()) {
|
|
keyAlias = keystoreProperties["keyAlias"] as String
|
|
keyPassword = keystoreProperties["keyPassword"] as String
|
|
storeFile = file(keystoreProperties["storeFile"] as String)
|
|
storePassword = keystoreProperties["storePassword"] as String
|
|
}
|
|
}
|
|
}
|
|
|
|
flavorDimensions += "env"
|
|
productFlavors {
|
|
create("prod") {
|
|
dimension = "env"
|
|
isDefault = true
|
|
buildConfigField(
|
|
"String",
|
|
"REST_API_BASE_URL",
|
|
"\"https://backend.hesychia.ai/api/\"",
|
|
)
|
|
buildConfigField(
|
|
"String",
|
|
"WS_API_BASE_URL",
|
|
"\"wss://backend.hesychia.ai/ws/chat_again/\"",
|
|
)
|
|
}
|
|
create("beta") {
|
|
dimension = "env"
|
|
applicationIdSuffix = ".beta"
|
|
versionNameSuffix = "-beta"
|
|
buildConfigField(
|
|
"String",
|
|
"REST_API_BASE_URL",
|
|
"\"https://beta.backend.hesychia.ai/api/\"",
|
|
)
|
|
buildConfigField(
|
|
"String",
|
|
"WS_API_BASE_URL",
|
|
"\"wss://beta.backend.hesychia.ai/ws/chat_again/\"",
|
|
)
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
applicationIdSuffix = ".debug"
|
|
versionNameSuffix = "-debug"
|
|
}
|
|
release {
|
|
isMinifyEnabled = false
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro",
|
|
)
|
|
if (keystorePropertiesFile.exists()) {
|
|
signingConfig = signingConfigs.getByName("release")
|
|
}
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
buildFeatures {
|
|
compose = true
|
|
buildConfig = true
|
|
}
|
|
packaging {
|
|
resources {
|
|
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
val composeBom = platform("androidx.compose:compose-bom:2024.12.01")
|
|
implementation(composeBom)
|
|
androidTestImplementation(composeBom)
|
|
|
|
implementation("androidx.core:core-ktx:1.15.0")
|
|
implementation("androidx.activity:activity-compose:1.9.3")
|
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
|
|
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.7")
|
|
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.7")
|
|
implementation("androidx.navigation:navigation-compose:2.8.5")
|
|
implementation("androidx.datastore:datastore-preferences:1.1.1")
|
|
implementation("androidx.browser:browser:1.8.0")
|
|
implementation("io.coil-kt:coil-compose:2.7.0")
|
|
implementation("androidx.security:security-crypto:1.1.0-alpha06")
|
|
|
|
implementation("androidx.compose.ui:ui")
|
|
implementation("androidx.compose.ui:ui-tooling-preview")
|
|
implementation("androidx.compose.material3:material3")
|
|
implementation("androidx.compose.material:material-icons-extended")
|
|
debugImplementation("androidx.compose.ui:ui-tooling")
|
|
|
|
implementation("com.google.dagger:hilt-android:2.53.1")
|
|
ksp("com.google.dagger:hilt-compiler:2.53.1")
|
|
implementation("androidx.hilt:hilt-navigation-compose:1.2.0")
|
|
|
|
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
|
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
|
|
implementation("com.squareup.retrofit2:retrofit:2.11.0")
|
|
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
|
|
|
|
implementation("com.android.billingclient:billing-ktx:7.1.1")
|
|
// RevenueCat — wire keys via BuildConfig / local.properties later (Workstream E)
|
|
implementation("com.revenuecat.purchases:purchases:8.12.2")
|
|
|
|
testImplementation("junit:junit:4.13.2")
|
|
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0")
|
|
testImplementation("com.google.truth:truth:1.4.4")
|
|
androidTestImplementation("androidx.test.ext:junit:1.2.1")
|
|
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
|
|
}
|