Use Version Catalog & clean up Gradle files (#6728)

This commit is contained in:
Andreas 2022-03-04 15:58:31 +01:00 committed by GitHub
parent d53bb4c337
commit f312936629
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 290 additions and 160 deletions

View file

@ -1,8 +1,4 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.ByteArrayOutputStream
import java.text.SimpleDateFormat
import java.util.Date
import java.util.TimeZone
plugins { plugins {
id("com.android.application") id("com.android.application")
@ -13,7 +9,7 @@ plugins {
} }
if (gradle.startParameter.taskRequests.toString().contains("Standard")) { if (gradle.startParameter.taskRequests.toString().contains("Standard")) {
apply(plugin = "com.google.gms.google-services") apply<com.google.gms.googleservices.GoogleServicesPlugin>()
} }
shortcutHelper.setFilePath("./shortcuts.xml") shortcutHelper.setFilePath("./shortcuts.xml")
@ -137,153 +133,122 @@ android {
} }
dependencies { dependencies {
implementation(kotlin("reflect", version = BuildPluginsVersion.KOTLIN)) implementation(kotlinx.reflect)
val coroutinesVersion = "1.6.0" implementation(kotlinx.bundles.coroutines)
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
// Source models and interfaces from Tachiyomi 1.x // Source models and interfaces from Tachiyomi 1.x
implementation("org.tachiyomi:source-api:1.1") implementation(libs.tachiyomi.api)
// AndroidX libraries // AndroidX libraries
implementation("androidx.annotation:annotation:1.4.0-alpha02") implementation(androidx.annotation)
implementation("androidx.appcompat:appcompat:1.4.1") implementation(androidx.appcompat)
implementation("androidx.biometric:biometric-ktx:1.2.0-alpha04") implementation(androidx.biometricktx)
implementation("androidx.browser:browser:1.4.0") implementation(androidx.browser)
implementation("androidx.constraintlayout:constraintlayout:2.1.3") implementation(androidx.constraintlayout)
implementation("androidx.coordinatorlayout:coordinatorlayout:1.2.0") implementation(androidx.coordinatorlayout)
implementation("androidx.core:core-ktx:1.8.0-alpha04") implementation(androidx.corektx)
implementation("androidx.core:core-splashscreen:1.0.0-alpha02") implementation(androidx.splashscreen)
implementation("androidx.recyclerview:recyclerview:1.3.0-alpha01") implementation(androidx.recyclerview)
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01") implementation(androidx.swiperefreshlayout)
implementation("androidx.viewpager:viewpager:1.1.0-alpha01") implementation(androidx.viewpager)
val lifecycleVersion = "2.5.0-alpha02" implementation(androidx.bundles.lifecycle)
implementation("androidx.lifecycle:lifecycle-common:$lifecycleVersion")
implementation("androidx.lifecycle:lifecycle-process:$lifecycleVersion")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion")
// Job scheduling // Job scheduling
implementation("androidx.work:work-runtime-ktx:2.6.0") implementation(androidx.work.runtime)
// RX // RX
implementation("io.reactivex:rxandroid:1.2.1") implementation(libs.bundles.reactivex)
implementation("io.reactivex:rxjava:1.3.8") implementation(libs.flowreactivenetwork)
implementation("com.jakewharton.rxrelay:rxrelay:1.2.0")
implementation("ru.beryukhov:flowreactivenetwork:1.0.4")
// Network client // Network client
val okhttpVersion = "4.9.1" implementation(libs.bundles.okhttp)
implementation("com.squareup.okhttp3:okhttp:$okhttpVersion") implementation(libs.okio)
implementation("com.squareup.okhttp3:logging-interceptor:$okhttpVersion")
implementation("com.squareup.okhttp3:okhttp-dnsoverhttps:$okhttpVersion")
implementation("com.squareup.okio:okio:3.0.0")
// TLS 1.3 support for Android < 10 // TLS 1.3 support for Android < 10
implementation("org.conscrypt:conscrypt-android:2.5.2") implementation(libs.conscrypt.android)
// Data serialization (JSON, protobuf) // Data serialization (JSON, protobuf)
val kotlinSerializationVersion = "1.3.2" implementation(kotlinx.bundles.serialization)
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinSerializationVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:$kotlinSerializationVersion")
// JavaScript engine // JavaScript engine
implementation("app.cash.quickjs:quickjs-android:0.9.2") implementation(libs.bundles.js.engine)
// TODO: remove Duktape once all extensions are using QuickJS
implementation("com.squareup.duktape:duktape-android:1.4.0")
// HTML parser // HTML parser
implementation("org.jsoup:jsoup:1.14.3") implementation(libs.jsoup)
// Disk // Disk
implementation("com.jakewharton:disklrucache:2.0.2") implementation(libs.disklrucache)
implementation("com.github.tachiyomiorg:unifile:17bec43") implementation(libs.unifile)
implementation("com.github.junrar:junrar:7.4.0") implementation(libs.junrar)
// Database // Database
implementation("androidx.sqlite:sqlite-ktx:2.2.0") implementation(libs.bundles.sqlite)
implementation("com.github.inorichi.storio:storio-common:8be19de@aar") implementation("com.github.inorichi.storio:storio-common:8be19de@aar")
implementation("com.github.inorichi.storio:storio-sqlite:8be19de@aar") implementation("com.github.inorichi.storio:storio-sqlite:8be19de@aar")
implementation("com.github.requery:sqlite-android:3.36.0")
// Preferences // Preferences
implementation("androidx.preference:preference-ktx:1.2.0") implementation(libs.preferencektx)
implementation("com.fredporciuncula:flow-preferences:1.6.0") implementation(libs.flowpreferences)
// Model View Presenter // Model View Presenter
val nucleusVersion = "3.0.0" implementation(libs.bundles.nucleus)
implementation("info.android15.nucleus:nucleus:$nucleusVersion")
implementation("info.android15.nucleus:nucleus-support-v7:$nucleusVersion")
// Dependency injection // Dependency injection
implementation("com.github.inorichi.injekt:injekt-core:65b0440") implementation(libs.injekt.core)
// Image loading // Image loading
val coilVersion = "1.4.0" implementation(libs.bundles.coil)
implementation("io.coil-kt:coil:$coilVersion")
implementation("io.coil-kt:coil-gif:$coilVersion")
implementation("com.github.tachiyomiorg:subsampling-scale-image-view:846abe0") { implementation(libs.subsamplingscaleimageview) {
exclude(module = "image-decoder") exclude(module = "image-decoder")
} }
implementation("com.github.tachiyomiorg:image-decoder:7481a4a") implementation(libs.image.decoder)
// Sort // Sort
implementation("com.github.gpanther:java-nat-sort:natural-comparator-1.1") implementation(libs.natural.comparator)
// UI libraries // UI libraries
implementation("com.google.android.material:material:1.6.0-alpha03") implementation(libs.material)
implementation("com.github.dmytrodanylyk.android-process-button:library:1.0.4") implementation(libs.androidprocessbutton)
implementation("com.github.arkon.FlexibleAdapter:flexible-adapter:c8013533") implementation(libs.flexible.adapter.core)
implementation("com.github.arkon.FlexibleAdapter:flexible-adapter-ui:c8013533") implementation(libs.flexible.adapter.ui)
implementation("com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.1.0") implementation(libs.viewstatepageradapter)
implementation("com.github.chrisbanes:PhotoView:2.3.0") implementation(libs.photoview)
implementation("com.github.tachiyomiorg:DirectionalViewPager:1.0.0") { implementation(libs.directionalviewpager) {
exclude(group = "androidx.viewpager", module = "viewpager") exclude(group = "androidx.viewpager", module = "viewpager")
} }
implementation("dev.chrisbanes.insetter:insetter:0.6.1") implementation(libs.insetter)
// Conductor // Conductor
val conductorVersion = "3.1.2" implementation(libs.bundles.conductor)
implementation("com.bluelinelabs:conductor:$conductorVersion")
implementation("com.bluelinelabs:conductor-viewpager:$conductorVersion")
implementation("com.github.tachiyomiorg:conductor-support-preference:$conductorVersion")
// FlowBinding // FlowBinding
val flowbindingVersion = "1.2.0" implementation(libs.bundles.flowbinding)
implementation("io.github.reactivecircus.flowbinding:flowbinding-android:$flowbindingVersion")
implementation("io.github.reactivecircus.flowbinding:flowbinding-appcompat:$flowbindingVersion")
implementation("io.github.reactivecircus.flowbinding:flowbinding-recyclerview:$flowbindingVersion")
implementation("io.github.reactivecircus.flowbinding:flowbinding-swiperefreshlayout:$flowbindingVersion")
implementation("io.github.reactivecircus.flowbinding:flowbinding-viewpager:$flowbindingVersion")
// Logging // Logging
implementation("com.squareup.logcat:logcat:0.1") implementation(libs.logcat)
// Crash reports/analytics // Crash reports/analytics
implementation("ch.acra:acra-http:5.8.4") implementation(libs.acra.http)
"standardImplementation"("com.google.firebase:firebase-analytics-ktx:20.0.2") "standardImplementation"(libs.firebase.analytics)
// Licenses // Licenses
implementation("com.mikepenz:aboutlibraries-core:${BuildPluginsVersion.ABOUTLIB_PLUGIN}") implementation(libs.aboutlibraries.core)
// Shizuku // Shizuku
val shizukuVersion = "12.1.0" implementation(libs.bundles.shizuku)
implementation("dev.rikka.shizuku:api:$shizukuVersion")
implementation("dev.rikka.shizuku:provider:$shizukuVersion")
// Tests // Tests
testImplementation("junit:junit:4.13.2") testImplementation(libs.junit)
testImplementation("org.assertj:assertj-core:3.16.1") testImplementation(libs.assertj.core)
testImplementation("org.mockito:mockito-core:1.10.19") testImplementation(libs.mockito.core)
val robolectricVersion = "3.1.4" testImplementation(libs.bundles.robolectric)
testImplementation("org.robolectric:robolectric:$robolectricVersion")
testImplementation("org.robolectric:shadows-play-services:$robolectricVersion")
// For detecting memory leaks; see https://square.github.io/leakcanary/ // For detecting memory leaks; see https://square.github.io/leakcanary/
// debugImplementation("com.squareup.leakcanary:leakcanary-android:2.7") // debugImplementation(libs.leakcanary.android)
} }
tasks { tasks {
@ -313,40 +278,8 @@ tasks {
} }
} }
buildscript { buildscript {
repositories {
mavenCentral()
}
dependencies { dependencies {
classpath(kotlin("gradle-plugin", version = BuildPluginsVersion.KOTLIN)) classpath(kotlinx.gradle)
} }
} }
// Git is needed in your system PATH for these commands to work.
// If it's not installed, you can return a random value as a workaround
fun getCommitCount(): String {
return runCommand("git rev-list --count HEAD")
// return "1"
}
fun getGitSha(): String {
return runCommand("git rev-parse --short HEAD")
// return "1"
}
fun getBuildTime(): String {
val df = SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'")
df.timeZone = TimeZone.getTimeZone("UTC")
return df.format(Date())
}
fun runCommand(command: String): String {
val byteOut = ByteArrayOutputStream()
project.exec {
commandLine = command.split(" ")
standardOutput = byteOut
}
return String(byteOut.toByteArray()).trim()
}

View file

@ -1,21 +1,22 @@
plugins { buildscript {
id("com.android.application") version BuildPluginsVersion.AGP apply false dependencies {
id("com.android.library") version BuildPluginsVersion.AGP apply false classpath(libs.android.shortcut.gradle)
kotlin("android") version BuildPluginsVersion.KOTLIN apply false classpath(libs.google.services.gradle)
id("org.jmailen.kotlinter") version BuildPluginsVersion.KOTLINTER classpath(libs.aboutlibraries.gradle)
id("com.github.ben-manes.versions") version BuildPluginsVersion.VERSIONS_PLUGIN classpath(kotlinx.serialization.gradle)
}
allprojects {
repositories {
mavenCentral()
google()
maven { setUrl("https://www.jitpack.io") }
} }
} }
plugins {
alias(androidx.plugins.application) apply false
alias(androidx.plugins.library) apply false
alias(kotlinx.plugins.android) apply false
alias(libs.plugins.kotlinter)
alias(libs.plugins.versionsx)
}
subprojects { subprojects {
apply(plugin = "org.jmailen.kotlinter") apply<org.jmailen.gradle.kotlinter.KotlinterPlugin>()
kotlinter { kotlinter {
experimentalRules = true experimentalRules = true
@ -25,15 +26,6 @@ subprojects {
} }
} }
buildscript { tasks.register<Delete>("clean") {
dependencies {
classpath("com.github.zellius:android-shortcut-gradle-plugin:0.1.2")
classpath("com.google.gms:google-services:4.3.10")
classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:${BuildPluginsVersion.ABOUTLIB_PLUGIN}")
classpath(kotlin("serialization", version = BuildPluginsVersion.KOTLIN))
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir) delete(rootProject.buildDir)
} }

View file

@ -0,0 +1,32 @@
import org.gradle.api.Project
import java.io.ByteArrayOutputStream
import java.text.SimpleDateFormat
import java.util.TimeZone
import java.util.Date
// Git is needed in your system PATH for these commands to work.
// If it's not installed, you can return a random value as a workaround
fun Project.getCommitCount(): String {
return runCommand("git rev-list --count HEAD")
// return "1"
}
fun Project.getGitSha(): String {
return runCommand("git rev-parse --short HEAD")
// return "1"
}
fun Project.getBuildTime(): String {
val df = SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'")
df.timeZone = TimeZone.getTimeZone("UTC")
return df.format(Date())
}
fun Project.runCommand(command: String): String {
val byteOut = ByteArrayOutputStream()
project.exec {
commandLine = command.split(" ")
standardOutput = byteOut
}
return String(byteOut.toByteArray()).trim()
}

View file

@ -1,7 +0,0 @@
object BuildPluginsVersion {
const val AGP = "7.1.1"
const val KOTLIN = "1.6.10"
const val KOTLINTER = "3.6.0"
const val VERSIONS_PLUGIN = "0.42.0"
const val ABOUTLIB_PLUGIN = "8.9.4"
}

View file

@ -0,0 +1,29 @@
[versions]
agp_version = "7.1.1"
lifecycle_version = "2.5.0-alpha02"
[libraries]
annotation = "androidx.annotation:annotation:1.4.0-alpha02"
appcompat = "androidx.appcompat:appcompat:1.4.1"
biometricktx = "androidx.biometric:biometric-ktx:1.2.0-alpha04"
browser = "androidx.browser:browser:1.4.0"
constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.3"
coordinatorlayout = "androidx.coordinatorlayout:coordinatorlayout:1.2.0"
corektx = "androidx.core:core-ktx:1.8.0-alpha04"
splashscreen = "androidx.core:core-splashscreen:1.0.0-alpha02"
recyclerview = "androidx.recyclerview:recyclerview:1.3.0-alpha01"
swiperefreshlayout = "androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01"
viewpager = "androidx.viewpager:viewpager:1.1.0-alpha01"
lifecycle-common = { module = "androidx.lifecycle:lifecycle-common", version.ref = "lifecycle_version" }
lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "lifecycle_version" }
lifecycle-runtimektx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle_version" }
work-runtime = "androidx.work:work-runtime-ktx:2.6.0"
[bundles]
lifecycle = ["lifecycle-common","lifecycle-process","lifecycle-runtimektx"]
[plugins]
application = { id = "com.android.application", version.ref="agp_version"}
library = { id = "com.android.library", version.ref="agp_version"}

View file

@ -0,0 +1,23 @@
[versions]
kotlin_version = "1.6.10"
coroutines_version = "1.6.0"
serialization_version = "1.3.2"
[libraries]
reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin_version" }
gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin_version" }
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines_version" }
coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines_version" }
serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization_version" }
serialization-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "serialization_version" }
serialization-gradle = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin_version"}
[bundles]
coroutines = ["coroutines-core", "coroutines-android"]
serialization = ["serialization-json","serialization-protobuf"]
[plugins]
android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin_version"}

111
gradle/libs.versions.toml Normal file
View file

@ -0,0 +1,111 @@
[versions]
aboutlib_version = "8.9.4"
okhttp_version = "4.9.1"
nucleus_version = "3.0.0"
coil_version = "1.4.0"
conductor_version = "3.1.2"
flowbinding_version = "1.2.0"
shizuku_version = "12.1.0"
robolectric_version = "3.1.4"
[libraries]
android-shortcut-gradle = "com.github.zellius:android-shortcut-gradle-plugin:0.1.2"
google-services-gradle = "com.google.gms:google-services:4.3.10"
tachiyomi-api = "org.tachiyomi:source-api:1.1"
rxandroid = "io.reactivex:rxandroid:1.2.1"
rxjava = "io.reactivex:rxjava:1.3.8"
rxrelay = "com.jakewharton.rxrelay:rxrelay:1.2.0"
flowreactivenetwork = "ru.beryukhov:flowreactivenetwork:1.0.4"
okhttp-core = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp_version" }
okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp_version" }
okhttp-dnsoverhttps = { module = "com.squareup.okhttp3:okhttp-dnsoverhttps", version.ref = "okhttp_version" }
okio = "com.squareup.okio:okio:3.0.0"
conscrypt-android = "org.conscrypt:conscrypt-android:2.5.2"
quickjs-android = "app.cash.quickjs:quickjs-android:0.9.2"
# TODO: remove Duktape once all extensions are using QuickJS
duktape-android = "com.squareup.duktape:duktape-android:1.4.0"
jsoup = "org.jsoup:jsoup:1.14.3"
disklrucache = "com.jakewharton:disklrucache:2.0.2"
unifile = "com.github.tachiyomiorg:unifile:17bec43"
junrar = "com.github.junrar:junrar:7.4.0"
sqlitektx = "androidx.sqlite:sqlite-ktx:2.2.0"
sqlite-android = "com.github.requery:sqlite-android:3.36.0"
preferencektx = "androidx.preference:preference-ktx:1.2.0"
flowpreferences = "com.fredporciuncula:flow-preferences:1.6.0"
nucleus-core = { module = "info.android15.nucleus:nucleus", version.ref = "nucleus_version" }
nucleus-supportv7 = { module = "info.android15.nucleus:nucleus-support-v7", version.ref = "nucleus_version" }
injekt-core = "com.github.inorichi.injekt:injekt-core:65b0440"
coil-core = { module = "io.coil-kt:coil", version.ref = "coil_version" }
coil-gif = { module = "io.coil-kt:coil-gif", version.ref = "coil_version" }
subsamplingscaleimageview = "com.github.tachiyomiorg:subsampling-scale-image-view:846abe0"
image-decoder = "com.github.tachiyomiorg:image-decoder:7481a4a"
natural-comparator = "com.github.gpanther:java-nat-sort:natural-comparator-1.1"
material = "com.google.android.material:material:1.6.0-alpha03"
androidprocessbutton = "com.github.dmytrodanylyk.android-process-button:library:1.0.4"
flexible-adapter-core = "com.github.arkon.FlexibleAdapter:flexible-adapter:c8013533"
flexible-adapter-ui = "com.github.arkon.FlexibleAdapter:flexible-adapter-ui:c8013533"
viewstatepageradapter = "com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.1.0"
photoview = "com.github.chrisbanes:PhotoView:2.3.0"
directionalviewpager = "com.github.tachiyomiorg:DirectionalViewPager:1.0.0"
insetter = "dev.chrisbanes.insetter:insetter:0.6.1"
conductor-core = { module = "com.bluelinelabs:conductor", version.ref = "conductor_version" }
conductor-viewpager = { module = "com.bluelinelabs:conductor-viewpager", version.ref = "conductor_version" }
conductor-support-preference = { module = "com.github.tachiyomiorg:conductor-support-preference", version.ref = "conductor_version" }
flowbinding-android = { module = "io.github.reactivecircus.flowbinding:flowbinding-android", version.ref = "flowbinding_version" }
flowbinding-appcompat = { module = "io.github.reactivecircus.flowbinding:flowbinding-appcompat", version.ref = "flowbinding_version" }
flowbinding-recyclerview = { module = "io.github.reactivecircus.flowbinding:flowbinding-recyclerview", version.ref = "flowbinding_version" }
flowbinding-swiperefreshlayout = { module = "io.github.reactivecircus.flowbinding:flowbinding-swiperefreshlayout", version.ref = "flowbinding_version" }
flowbinding-viewpager = { module = "io.github.reactivecircus.flowbinding:flowbinding-viewpager", version.ref = "flowbinding_version" }
logcat = "com.squareup.logcat:logcat:0.1"
acra-http = "ch.acra:acra-http:5.8.4"
firebase-analytics = "com.google.firebase:firebase-analytics-ktx:20.0.2"
aboutlibraries-core = { module = "com.mikepenz:aboutlibraries-core", version.ref = "aboutlib_version" }
aboutlibraries-gradle = { module = "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin", version.ref = "aboutlib_version" }
shizuku-api = { module = "dev.rikka.shizuku:api", version.ref = "shizuku_version" }
shizuku-provider = { module = "dev.rikka.shizuku:provider", version.ref = "shizuku_version" }
junit = "junit:junit:4.13.2"
assertj-core = "org.assertj:assertj-core:3.16.1"
mockito-core = "org.mockito:mockito-core:1.10.19"
robolectric-core = { module = "org.robolectric:robolectric", version.ref = "robolectric_version" }
robolectric-playservices = { module = "org.robolectric:shadows-play-services", version.ref = "robolectric_version" }
leakcanary-android = "com.squareup.leakcanary:leakcanary-android:2.7"
[bundles]
reactivex = ["rxandroid","rxjava","rxrelay"]
okhttp = ["okhttp-core","okhttp-logging","okhttp-dnsoverhttps"]
js-engine = ["quickjs-android", "duktape-android"]
sqlite = ["sqlitektx", "sqlite-android"]
nucleus = ["nucleus-core","nucleus-supportv7"]
coil = ["coil-core","coil-gif",]
flowbinding = ["flowbinding-android","flowbinding-appcompat","flowbinding-recyclerview","flowbinding-swiperefreshlayout","flowbinding-viewpager"]
conductor = ["conductor-core","conductor-viewpager","conductor-support-preference"]
shizuku = ["shizuku-api","shizuku-provider"]
robolectric = ["robolectric-core","robolectric-playservices"]
[plugins]
kotlinter = { id = "org.jmailen.kotlinter", version = "3.6.0"}
versionsx = { id = "com.github.ben-manes.versions", version = "0.42.0"}

View file

@ -1,10 +1,10 @@
enableFeaturePreview("VERSION_CATALOGS")
pluginManagement { pluginManagement {
resolutionStrategy { resolutionStrategy {
eachPlugin { eachPlugin {
if (requested.id.id == "com.android.library") { val regex = "com.android.(library|application)".toRegex()
useModule("com.android.tools.build:gradle:${requested.version}") if (regex matches requested.id.id) {
}
if (requested.id.id == "com.android.application") {
useModule("com.android.tools.build:gradle:${requested.version}") useModule("com.android.tools.build:gradle:${requested.version}")
} }
} }
@ -16,5 +16,22 @@ pluginManagement {
} }
} }
dependencyResolutionManagement {
versionCatalogs {
create("kotlinx") {
from(files("gradle/kotlinx.versions.toml"))
}
create("androidx") {
from(files("gradle/androidx.versions.toml"))
}
}
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
google()
maven(url = "https://www.jitpack.io")
}
}
rootProject.name = "Tachiyomi" rootProject.name = "Tachiyomi"
include(":app") include(":app")