scanner: support libs.versions.toml

This commit is contained in:
linsui 2024-09-15 02:03:26 +08:00
parent 528760acc8
commit eff0ef48f4
17 changed files with 723 additions and 35 deletions

View file

@ -0,0 +1,118 @@
import java.io.FileInputStream
import java.util.Properties
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.google.services)
alias(libs.plugins.firebase.crashlytics)
alias(libs.plugins.ksp)
}
android {
namespace = "com.lolo.io.onelist"
val versionPropsFile = file("../version.properties")
var versionCodeCI: Int? = null
if (versionPropsFile.canRead()) {
val versionProps = Properties()
versionProps.load(FileInputStream(versionPropsFile))
val v = versionProps["VERSION_CODE"]
versionCodeCI = (versionProps["VERSION_CODE"] as String).toInt()
}
defaultConfig {
multiDexEnabled = true
applicationId = "com.lolo.io.onelist"
compileSdk = 34
minSdk = 23
targetSdk = 34
versionCode = versionCodeCI ?: 19
versionName = "1.4.2"
vectorDrawables.useSupportLibrary = true
}
androidResources {
generateLocaleConfig = true
}
buildFeatures {
viewBinding = true
buildConfig = true
}
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}
buildTypes {
getByName("debug") {
applicationIdSuffix = ".debug"
versionNameSuffix = "-DEBUG"
resValue("string", "app_name", "1ListDev")
}
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
resValue("string", "app_name", "1List")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
dependencies {
// android
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.preference.ktx)
implementation(libs.androidx.lifecycle.extensions)
implementation(libs.androidx.legacy.support.v4)
implementation(libs.androidx.appcompat)
// android - design
implementation(libs.constraint.layout)
implementation(libs.androidx.recyclerview)
implementation(libs.flexbox)
implementation(libs.material)
implementation(libs.androidx.swiperefreshlayout)
// kotlin
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlin.stdlib.jdk7)
// firebase
implementation(libs.firebase.crashlytics)
// koin di
implementation(libs.koin.android)
implementation(libs.koin.androidx.navigation)
// room
implementation(libs.androidx.room.runtime)
implementation(libs.androidx.room.ktx)
ksp(libs.androidx.room.compiler)
// json
implementation(libs.gson)
// other libs
implementation(libs.whatsnew)
implementation(libs.storage)
implementation(libs.advrecyclerview)
}

View file

@ -0,0 +1,11 @@
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.google.services) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.ksp) apply false
}
tasks.register("clean", Delete::class) {
delete(rootProject.layout.buildDirectory)
}

View file

@ -0,0 +1,58 @@
[versions]
advrecyclerview = "1.0.0"
appcompat = "1.6.1"
constraint-layout = "2.0.4"
crashlytics = "18.6.2"
firebase-crashlytics-gradle-plugin = "2.9.9"
flexbox = "3.0.0"
gson = "2.5.6"
kotlin = "1.9.20"
kotlin-coroutines = "1.6.4"
legacy-support-v4 = "1.0.0"
lifecycle-extensions = "2.2.0"
material = "1.11.0"
preference-ktx = "1.2.1"
recyclerview = "1.3.2"
splashscreen ="1.0.1"
koin ="3.5.0"
room="2.6.1"
storage = "1.5.5"
swiperefreshlayout = "1.1.0"
whatsnew = "0.1.7"
ksp-plugin="1.9.20-1.0.14"
# plugins versions
android-application-plugin="8.3.0"
kotlin-android-plugin="1.9.22"
google-services-plugin = "4.4.1"
[libraries]
advrecyclerview = { module = "com.h6ah4i.android.widget.advrecyclerview:advrecyclerview", version.ref = "advrecyclerview" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "splashscreen" }
androidx-legacy-support-v4 = { module = "androidx.legacy:legacy-support-v4", version.ref = "legacy-support-v4" }
androidx-lifecycle-extensions = { module = "androidx.lifecycle:lifecycle-extensions", version.ref = "lifecycle-extensions" }
androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "preference-ktx" }
androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "recyclerview" }
androidx-room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
androidx-room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
androidx-room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "swiperefreshlayout" }
constraint-layout = { module = "com.android.support.constraint:constraint-layout", version.ref = "constraint-layout" }
firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics", version.ref = "crashlytics" }
flexbox = { module = "com.google.android.flexbox:flexbox", version.ref = "flexbox" }
gson = { module = "org.immutables:gson", version.ref = "gson" }
koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" }
koin-androidx-navigation = { module = "io.insert-koin:koin-androidx-navigation", version.ref = "koin" }
kotlin-stdlib-jdk7 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk7", version.ref = "kotlin" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlin-coroutines" }
material = { module = "com.google.android.material:material", version.ref = "material" }
storage = { module = "com.anggrayudi:storage", version.ref = "storage" }
whatsnew = { module = "io.github.tonnyl:whatsnew", version.ref = "whatsnew" }
[plugins]
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp-plugin" }
android-application = { id = "com.android.application", version.ref = "android-application-plugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-android-plugin" }
google-services = { id = "com.google.gms.google-services", version.ref = "google-services-plugin" }
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebase-crashlytics-gradle-plugin" }

View file

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View file

@ -0,0 +1,9 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
include 'app'