forked from melod1n/fast-messenger
2a238fa1bf
This commit upgrades the project's build system and refactors the build logic for better maintainability and alignment with modern practices. The Gradle version has been updated from 8.14.2 to 9.3.0, and the Android Gradle Plugin (AGP) has been upgraded to version 9.0.0. This required migrating the build logic to use the new `com.android.build.api.dsl` interfaces instead of the deprecated `com.android.build.gradle` ones. Key changes: - Upgraded Gradle to `9.3.0`. - Upgraded Android Gradle Plugin to `9.0.0`. - Updated various dependencies including Kotlin, Compose BOM, Chucker, and serialization. - Removed the explicit `kotlin-android` plugin application, as it's now handled by AGP. - Migrated build convention plugins to use the new AGP DSL APIs. - Commented out the custom APK naming logic in `app/build.gradle.kts`. - Added new `gradle.properties` flags for build configuration. - Corrected the namespace in `core/model` from `datastore` to `model`.
148 lines
4.4 KiB
Kotlin
148 lines
4.4 KiB
Kotlin
import com.android.build.gradle.internal.api.BaseVariantOutputImpl
|
|
import java.util.Properties
|
|
|
|
plugins {
|
|
alias(libs.plugins.fast.android.application)
|
|
alias(libs.plugins.fast.android.application.compose)
|
|
alias(libs.plugins.kotlin.serialization)
|
|
}
|
|
|
|
android {
|
|
namespace = "dev.meloda.fastvk"
|
|
|
|
defaultConfig {
|
|
applicationId = "dev.meloda.fastvk"
|
|
|
|
versionCode = 10
|
|
versionName = "0.2.2"
|
|
}
|
|
|
|
signingConfigs {
|
|
create("release") {
|
|
val keystoreProperties = Properties()
|
|
val keystorePropertiesFile = file("keystore/keystore.properties")
|
|
|
|
storeFile = file("keystore/keystore.jks")
|
|
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystorePropertiesFile.inputStream().let(keystoreProperties::load)
|
|
storePassword = keystoreProperties.getProperty("storePassword")
|
|
keyAlias = keystoreProperties.getProperty("keyAlias")
|
|
keyPassword = keystoreProperties.getProperty("keyPassword")
|
|
} else {
|
|
storePassword = System.getenv("KEYSTORE_PASSWORD")
|
|
keyAlias = System.getenv("RELEASE_SIGN_KEY_ALIAS")
|
|
keyPassword = System.getenv("RELEASE_SIGN_KEY_PASSWORD")
|
|
}
|
|
}
|
|
|
|
create("debugSigning") {
|
|
initWith(getByName("release"))
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
named("debug") {
|
|
signingConfig = signingConfigs.getByName("debugSigning")
|
|
applicationIdSuffix = ".debug"
|
|
}
|
|
named("release") {
|
|
signingConfig = signingConfigs.getByName("release")
|
|
|
|
isMinifyEnabled = true
|
|
isShrinkResources = true
|
|
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
}
|
|
}
|
|
|
|
// applicationVariants.all {
|
|
// outputs.all {
|
|
// val date = System.currentTimeMillis() / 1000
|
|
// val buildType = buildType.name
|
|
// val appVersion = versionName
|
|
// val appVersionCode = versionCode
|
|
//
|
|
// val newApkName = "app-$buildType-v$appVersion($appVersionCode)-$date.apk"
|
|
// (this as? BaseVariantOutputImpl)?.outputFileName = newApkName
|
|
// }
|
|
// }
|
|
|
|
packaging {
|
|
resources {
|
|
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(projects.feature.auth)
|
|
|
|
implementation(projects.feature.chatmaterials)
|
|
implementation(projects.feature.convos)
|
|
implementation(projects.feature.languagepicker)
|
|
implementation(projects.feature.messageshistory)
|
|
implementation(projects.feature.photoviewer)
|
|
implementation(projects.feature.settings)
|
|
implementation(projects.feature.friends)
|
|
implementation(projects.feature.profile)
|
|
implementation(projects.feature.photoviewer)
|
|
implementation(projects.feature.createchat)
|
|
|
|
implementation(projects.core.common)
|
|
implementation(projects.core.ui)
|
|
implementation(projects.core.data)
|
|
implementation(projects.core.domain)
|
|
implementation(projects.core.model)
|
|
implementation(projects.core.datastore)
|
|
|
|
// Tests zone
|
|
testImplementation(libs.junit)
|
|
// end of Tests zone
|
|
|
|
// Compose-Bom zone
|
|
implementation(platform(libs.compose.bom))
|
|
implementation(libs.bundles.compose)
|
|
// end of Compose-Bom zone
|
|
|
|
implementation(libs.accompanist.permissions)
|
|
|
|
// Coil for Compose
|
|
implementation(libs.coil.compose)
|
|
|
|
// androidTestImplementation(libs.compose.ui.test.junit4)
|
|
debugImplementation(libs.compose.ui.test.manifest)
|
|
debugImplementation(libs.compose.ui.tooling)
|
|
|
|
implementation(libs.koin.android)
|
|
implementation(libs.koin.androidx.compose)
|
|
implementation(libs.koin.androidx.compose.navigation)
|
|
|
|
implementation(libs.coil)
|
|
|
|
implementation(libs.core.ktx)
|
|
|
|
implementation(libs.lifecycle.viewmodel.ktx)
|
|
implementation(libs.lifecycle.runtime.ktx)
|
|
|
|
implementation(libs.preference.ktx)
|
|
implementation(libs.material)
|
|
|
|
implementation(libs.haze)
|
|
implementation(libs.haze.materials)
|
|
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
implementation(libs.kotlinx.coroutines.android)
|
|
|
|
implementation(libs.nanokt)
|
|
implementation(libs.nanokt.android)
|
|
implementation(libs.nanokt.jvm)
|
|
|
|
implementation(libs.androidx.navigation.compose)
|
|
implementation(libs.kotlin.serialization)
|
|
|
|
}
|