feat: refs #8022 kotlin versionCatalog

This commit is contained in:
Sergio De la torre 2024-11-20 08:04:35 +01:00
parent 622bb221ab
commit 2bfa6c8373
5 changed files with 273 additions and 209 deletions

View File

@ -1,172 +0,0 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.devtools.ksp'
android {
namespace = "es.verdnatura"
compileSdk 34
defaultConfig {
applicationId "es.verdnatura"
minSdkVersion 26
targetSdkVersion 33 // se deja con target si no Play Protect la bloquea
versionCode 351
versionName = "24.40"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
/*debuggable false
shrinkResources true
minifyEnabled true*/
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
//package de la app general = "package_name": "es.verdnatura"
//package de la app beta = "package_name": "es.verdnatura.sfusion"
applicationVariants.all { variant ->
variant.outputs.all { output ->
def flavorName = variant.productFlavors[0].name
def apkName
if (flavorName == "beta") {
apkName = "vn-pickingBeta.apk"
} else if (flavorName == "general") {
apkName = "vn-picking.apk"
} else {
apkName = "vn-picking.apk"
}
output.outputFileName = apkName
}
}
}
flavorDimensions += "version"
productFlavors {
create("beta") {
applicationIdSuffix = ".sfusion"
}
create("general") {
//versionNameSuffix = "General"
}
}
buildFeatures {
viewBinding = true
}
/*kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
}
kotlin {
jvmToolchain(8)
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
}
*/
dataBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.firebase:firebase-crashlytics-ktx:19.0.3'
implementation 'com.google.firebase:firebase-analytics-ktx:22.0.2'
implementation 'com.google.android.gms:play-services-location:21.3.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7'
implementation 'androidx.navigation:navigation-ui-ktx:2.7.7'
implementation 'androidx.core:core-ktx:1.13.1'
kapt "androidx.room:room-compiler:2.6.1"
implementation 'androidx.room:room-ktx:2.6.1'
debugImplementation fileTree(dir: 'libs/debug', include: ['*.jar'])
releaseImplementation fileTree(dir: 'libs/release', include: ['*.jar'])
//canvas
implementation 'com.simplify:ink:1.0.0'
// Kotlin and Android
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
//tests
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
implementation 'com.google.android.material:material:1.12.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation "com.airbnb.android:lottie:$lottieVersion"
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
//Fragments
implementation("androidx.fragment:fragment-ktx:1.8.2")
// Architecture components
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.8.4"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
//Koin new resolve
implementation "io.insert-koin:koin-core:$koin"
implementation "io.insert-koin:koin-android:$koin"
implementation "io.insert-koin:koin-androidx-scope:$koin"
implementation "io.insert-koin:koin-androidx-viewmodel:$koin"
// Image libraries
implementation "io.coil-kt:coil:$coil"
implementation "com.github.bumptech.glide:glide:$glide"
implementation "com.github.bumptech.glide:okhttp3-integration:$glide"
//kapt "com.github.bumptech.glide:compiler:$glide"
ksp("com.github.bumptech.glide:ksp:$glide")
// Add the Firebase Crashlytics SDK.
implementation 'com.google.firebase:firebase-analytics:22.0.2'
//search
implementation 'com.github.mirrajabi:search-dialog:1.1'
//logs
implementation 'com.jakewharton.timber:timber:4.7.1'
//pickerImage
implementation 'com.github.esafirm:android-image-picker:3.0.0-beta5'
//preferences
implementation("androidx.datastore:datastore-preferences:1.1.1")
implementation 'androidx.datastore:datastore-core:1.1.1'
//qr
implementation('com.journeyapps:zxing-android-embedded:4.3.0') { transitive = false }
implementation 'com.google.zxing:core:3.3.0'
// Compose
/* implementation(platform("androidx.compose:compose-bom:2024.02.01"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material:material")
implementation("androidx.compose.runtime:runtime")
implementation("androidx.activity:activity-compose:1.8.2")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")*/
}

143
app/build.gradle.kts Normal file
View File

@ -0,0 +1,143 @@
plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-kapt")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
id("com.google.devtools.ksp")
}
android {
namespace = "es.verdnatura"
compileSdk = 35
defaultConfig {
applicationId = "es.verdnatura"
minSdk = 26
targetSdk = 33 // se deja con target si no Play Protect la bloquea
versionCode = 358
versionName = "24.46"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
getByName("release") {
//debuggable = false
//shrinkResources = true
//minifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
}
}
//package de la app general = "package_name": "es.verdnatura"
//package de la app beta = "package_name": "es.verdnatura.sfusion"
applicationVariants.all { variant ->
variant.outputs.all { output ->
val flavorName = variant.productFlavors[0].name
val buildTypeName = variant.buildType.name
val apkName = when (flavorName) {
"beta" -> "vn-pickingBeta-${buildTypeName}.apk"
else -> "vn-picking-${buildTypeName}.apk"
}
output.outputFile.renameTo(File(output.outputFile.parentFile, apkName))
true
}
}
flavorDimensions += "version"
productFlavors {
create("beta") {
applicationIdSuffix = ".sfusion"
}
create("general") {}
}
buildFeatures {
viewBinding = true
//compose = true
/*kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
}
*/
dataBinding = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
/* composeOptions {
kotlinCompilerExtensionVersion = "1.5.15"
}*/
/* kotlin {
jvmToolchain(17)
}
kotlinOptions {
jvmTarget = "17"
}*/
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation(libs.firebase.crashlytics.ktx)
implementation(libs.firebase.analytics.ktx)
implementation(libs.play.services.location)
implementation(libs.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.recyclerview)
implementation(libs.androidx.room.ktx)
kapt(libs.androidx.room.compiler)
implementation(libs.ink)
implementation(libs.kotlin.stdlib.jdk7)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.legacy.support.v4)
implementation(libs.androidx.lifecycle.extensions)
implementation(libs.material)
implementation(libs.retrofit)
implementation(libs.converter.gson)
implementation(libs.converter.scalars)
implementation(libs.lottie)
implementation(libs.androidx.swiperefreshlayout)
implementation(libs.androidx.fragment.ktx)
implementation(libs.androidx.lifecycle.viewmodel.ktx)
implementation(libs.androidx.lifecycle.livedata.ktx)
implementation(libs.androidx.legacy.support.v4)
implementation(libs.koin.core)
implementation(libs.koin.android)
implementation(libs.koin.androidx.scope)
implementation(libs.koin.androidx.viewmodel)
implementation(libs.glide)
implementation(libs.okhttp3.integration)
ksp(libs.glide.ksp)
implementation(libs.firebase.analytics)
implementation(libs.android.image.picker)
implementation(libs.androidx.datastore.preferences)
implementation(libs.androidx.datastore.core)
implementation(libs.zxing.android.embedded) { isTransitive = false }
implementation(libs.core)
// Compose
//implementation(libs.androidx.compose.bom)
/* implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material:material")
implementation("androidx.compose.runtime:runtime")
implementation("androidx.activity:activity-compose:1.8.2")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview") */
}
}

View File

@ -1,37 +0,0 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '2.0.0'
ext {
// UI components
lottieVersion = '3.4.0'
koin = '2.1.6'
// Images
glide = '4.16.0'
coil = '1.4.0'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.4.2'
classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.2'
}
}
plugins {
id 'com.google.devtools.ksp' version '2.0.0-1.0.21' apply false
}
allprojects {
repositories {
google()
mavenCentral()
maven{url 'https://jitpack.io'}
}
}

32
build.gradle.kts Normal file
View File

@ -0,0 +1,32 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath(libs.androidGradlePlugin)
classpath(libs.kotlinGradlePlugin)
classpath(libs.googleServices)
classpath(libs.firebaseCrashlyticsGradle)
}
}
plugins {
alias(libs.plugins.google.devtools.ksp) apply false
/*alias(libs.plugins.jetbrainsCompose) apply false
alias(libs.plugins.compose.compiler) apply false*/
}
allprojects {
repositories {
google()
mavenCentral()
maven {
url = uri("https://jitpack.io")
}
}
}

98
gradle/libs.versions.toml Normal file
View File

@ -0,0 +1,98 @@
[versions]
androidImagePicker = "3.0.0-beta5"
appcompat = "1.7.0"
composeBom = "2024.11.00"
constraintlayout = "2.2.0"
converterGson = "2.0.2"
core = "3.4.1"
coreKtx = "1.13.0"
datastorePreferences = "1.1.1"
firebaseAnalyticsKtx = "22.1.2"
firebaseCrashlyticsKtx = "19.2.1"
fragmentKtx = "1.8.5"
glide = "4.16.0"
ink = "1.0.0"
koin = "2.1.6"
kotlinStdlibJdk7 = "2.0.0"
legacySupportV4 = "1.0.0"
lifecycleExtensions = "2.2.0"
lifecycleViewmodelKtx = "2.8.7"
lottieVersion = "3.4.0"
material = "1.12.0"
navigationFragmentKtx = "2.8.3"
navigationUiKtx = "2.8.3"
playServicesLocation = "21.3.0"
recyclerview = "1.3.2"
retrofit = "2.3.0"
roomCompiler = "2.6.1"
swiperefreshlayout = "1.1.0"
zxingAndroidEmbedded = "4.3.0"
googleDevtoolsKsp = "2.0.20-1.0.25"
#cambiar ide para subir version
androidGradlePlugin = "8.3.2"
kotlin = "2.0.10"
googleServices = "4.4.2"
firebaseCrashlytics = "3.0.2"
[libraries]
#pickerImage
android-image-picker = { module = "com.github.esafirm:android-image-picker", version.ref = "androidImagePicker" }
#android
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "composeBom" }
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
#preferences
androidx-datastore-core = { module = "androidx.datastore:datastore-core", version.ref = "datastorePreferences" }
androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastorePreferences" }
#arquitecture components
androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "fragmentKtx" }
androidx-legacy-support-v4 = { module = "androidx.legacy:legacy-support-v4", version.ref = "legacySupportV4" }
androidx-lifecycle-extensions = { module = "androidx.lifecycle:lifecycle-extensions", version.ref = "lifecycleExtensions" }
androidx-lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "lifecycleViewmodelKtx" }
androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" }
androidx-navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "navigationUiKtx" }
androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "recyclerview" }
#room
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "roomCompiler" }
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "roomCompiler" }
#ui
converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "converterGson" }
converter-scalars = { module = "com.squareup.retrofit2:converter-scalars", version.ref = "retrofit" }
#qr
core = { module = "com.google.zxing:core", version.ref = "core" }
zxing-android-embedded = { module = "com.journeyapps:zxing-android-embedded", version.ref = "zxingAndroidEmbedded" }
#analytics
firebase-analytics = { module = "com.google.firebase:firebase-analytics", version.ref = "firebaseAnalyticsKtx" }
firebase-analytics-ktx = { module = "com.google.firebase:firebase-analytics-ktx", version.ref = "firebaseAnalyticsKtx" }
firebase-crashlytics-ktx = { module = "com.google.firebase:firebase-crashlytics-ktx", version.ref = "firebaseCrashlyticsKtx" }
#canvas and image libraries
glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" }
glide-ksp = { module = "com.github.bumptech.glide:ksp", version.ref = "glide" }
ink = { module = "com.simplify:ink", version.ref = "ink" }
#koin
koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" }
koin-androidx-scope = { module = "io.insert-koin:koin-androidx-scope", version.ref = "koin" }
koin-androidx-viewmodel = { module = "io.insert-koin:koin-androidx-viewmodel", version.ref = "koin" }
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
#ui
kotlin-stdlib-jdk7 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk7", version.ref = "kotlinStdlibJdk7" }
lottie = { module = "com.airbnb.android:lottie", version.ref = "lottieVersion" }
material = { module = "com.google.android.material:material", version.ref = "material" }
navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "navigationFragmentKtx" }
androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "swiperefreshlayout" }
#callBack
okhttp3-integration = { module = "com.github.bumptech.glide:okhttp3-integration", version.ref = "glide" }
play-services-location = { module = "com.google.android.gms:play-services-location", version.ref = "playServicesLocation" }
#searchable
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
#build.gradle.kts.project
androidGradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" }
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
googleServices = { module = "com.google.gms:google-services", version.ref = "googleServices" }
firebaseCrashlyticsGradle = { module = "com.google.firebase:firebase-crashlytics-gradle", version.ref = "firebaseCrashlytics" }
[plugins]
google-devtools-ksp = { id = "com.google.devtools.ksp", version.ref = "googleDevtoolsKsp" }
#jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
#compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }