Expose coroutines dependencies to all extensions by default (#13757)

This commit is contained in:
arkon 2022-10-08 09:44:48 -04:00 committed by GitHub
parent 7579ca391f
commit 40b6e31505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 26 deletions

View File

@ -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

View File

@ -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"]

View File

@ -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)

View File

@ -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"