From 40b6e315053f7e19f68fe485cba4b95604ca0422 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 8 Oct 2022 09:44:48 -0400 Subject: [PATCH] Expose coroutines dependencies to all extensions by default (#13757) --- CONTRIBUTING.md | 15 ++++----------- gradle/libs.versions.toml | 3 +-- settings.gradle.kts | 12 ++++-------- src/zh/manhuagui/build.gradle | 6 +----- 4 files changed, 10 insertions(+), 26 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9f66b4b47..6ee7fcf43 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -213,22 +213,15 @@ dependencies { #### Additional dependencies -You may find yourself needing additional functionality and wanting to add more dependencies to your `build.gradle` file. Since extensions are run within the main Tachiyomi app, you can make use of [its dependencies](https://github.com/tachiyomiorg/tachiyomi/blob/master/app/build.gradle.kts). - -For example, an extension that needs coroutines, it could add the following: - -```gradle -dependencies { - compileOnly(libs.bundles.coroutines) -} -``` +If you find yourself needing additional functionality, you can add more dependencies to your `build.gradle` file. +Many of [the dependencies](https://github.com/tachiyomiorg/tachiyomi/blob/master/app/build.gradle.kts) from the main Tachiyomi app are exposed to extensions by default. > Note that several dependencies are already exposed to all extensions via Gradle version catalog. > To view which are available view `libs.versions.toml` under the `gradle` folder -Notice that we're using `compileOnly` instead of `implementation`, since the app already contains it. You could use `implementation` instead for a new dependency, or you prefer not to rely on whatever the main app has at the expense of app size. +Notice that we're using `compileOnly` instead of `implementation` if the app already contains it. You could use `implementation` instead for a new dependency, or you prefer not to rely on whatever the main app has at the expense of app size. -Note that using `compileOnly` restricts you to versions that must be compatible with those used in [Tachiyomi v0.10.12+](https://github.com/tachiyomiorg/tachiyomi/blob/v0.10.12/app/build.gradle.kts) for proper backwards compatibility. +Note that using `compileOnly` restricts you to versions that must be compatible with those used in [the latest stable version of Tachiyomi](https://github.com/tachiyomiorg/tachiyomi/releases/latest). ### Extension main class diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ba34145c0..d84641ed3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -26,6 +26,5 @@ rxandroid = { module = "io.reactivex:rxandroid", version = "1.2.1" } rxjava = { module = "io.reactivex:rxjava", version = "1.3.8" } [bundles] -common = ["kotlin-stdlib", "injekt-core", "rxjava", "kotlin-protobuf", "kotlin-json", "jsoup", "okhttp", "tachiyomi-lib", "quickjs"] -coroutines = ["coroutines-core", "coroutines-android"] +common = ["kotlin-stdlib", "coroutines-core", "coroutines-android", "injekt-core", "rxjava", "kotlin-protobuf", "kotlin-json", "jsoup", "okhttp", "tachiyomi-lib", "quickjs"] reactivex = ["rxandroid"] diff --git a/settings.gradle.kts b/settings.gradle.kts index 70961dc94..a1f75eb5b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,13 +1,9 @@ include(":core") -include(":lib-dataimage") -project(":lib-dataimage").projectDir = File("lib/dataimage") - -include(":lib-unpacker") -project(":lib-unpacker").projectDir = File("lib/unpacker") - -include(":lib-cryptoaes") -project(":lib-cryptoaes").projectDir = File("lib/cryptoaes") +listOf("dataimage", "unpacker", "cryptoaes").forEach { + include(":lib-$it") + project(":lib-$it").projectDir = File("lib/$it") +} if (System.getenv("CI") == null || System.getenv("CI_MODULE_GEN") == "true") { // Local development (full project build) diff --git a/src/zh/manhuagui/build.gradle b/src/zh/manhuagui/build.gradle index dbd262553..fe81edcc4 100644 --- a/src/zh/manhuagui/build.gradle +++ b/src/zh/manhuagui/build.gradle @@ -6,11 +6,7 @@ ext { extName = 'ManHuaGui' pkgNameSuffix = 'zh.manhuagui' extClass = '.Manhuagui' - extVersionCode = 15 -} - -dependencies { - compileOnly libs.bundles.coroutines + extVersionCode = 16 } apply from: "$rootDir/common.gradle"