Expose coroutines dependencies to all extensions by default (#13757)
This commit is contained in:
parent
7579ca391f
commit
40b6e31505
|
@ -213,22 +213,15 @@ dependencies {
|
||||||
|
|
||||||
#### Additional 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).
|
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.
|
||||||
For example, an extension that needs coroutines, it could add the following:
|
|
||||||
|
|
||||||
```gradle
|
|
||||||
dependencies {
|
|
||||||
compileOnly(libs.bundles.coroutines)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
> Note that several dependencies are already exposed to all extensions via Gradle version catalog.
|
> 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
|
> 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
|
### Extension main class
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,5 @@ rxandroid = { module = "io.reactivex:rxandroid", version = "1.2.1" }
|
||||||
rxjava = { module = "io.reactivex:rxjava", version = "1.3.8" }
|
rxjava = { module = "io.reactivex:rxjava", version = "1.3.8" }
|
||||||
|
|
||||||
[bundles]
|
[bundles]
|
||||||
common = ["kotlin-stdlib", "injekt-core", "rxjava", "kotlin-protobuf", "kotlin-json", "jsoup", "okhttp", "tachiyomi-lib", "quickjs"]
|
common = ["kotlin-stdlib", "coroutines-core", "coroutines-android", "injekt-core", "rxjava", "kotlin-protobuf", "kotlin-json", "jsoup", "okhttp", "tachiyomi-lib", "quickjs"]
|
||||||
coroutines = ["coroutines-core", "coroutines-android"]
|
|
||||||
reactivex = ["rxandroid"]
|
reactivex = ["rxandroid"]
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
include(":core")
|
include(":core")
|
||||||
|
|
||||||
include(":lib-dataimage")
|
listOf("dataimage", "unpacker", "cryptoaes").forEach {
|
||||||
project(":lib-dataimage").projectDir = File("lib/dataimage")
|
include(":lib-$it")
|
||||||
|
project(":lib-$it").projectDir = File("lib/$it")
|
||||||
include(":lib-unpacker")
|
}
|
||||||
project(":lib-unpacker").projectDir = File("lib/unpacker")
|
|
||||||
|
|
||||||
include(":lib-cryptoaes")
|
|
||||||
project(":lib-cryptoaes").projectDir = File("lib/cryptoaes")
|
|
||||||
|
|
||||||
if (System.getenv("CI") == null || System.getenv("CI_MODULE_GEN") == "true") {
|
if (System.getenv("CI") == null || System.getenv("CI_MODULE_GEN") == "true") {
|
||||||
// Local development (full project build)
|
// Local development (full project build)
|
||||||
|
|
|
@ -6,11 +6,7 @@ ext {
|
||||||
extName = 'ManHuaGui'
|
extName = 'ManHuaGui'
|
||||||
pkgNameSuffix = 'zh.manhuagui'
|
pkgNameSuffix = 'zh.manhuagui'
|
||||||
extClass = '.Manhuagui'
|
extClass = '.Manhuagui'
|
||||||
extVersionCode = 15
|
extVersionCode = 16
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compileOnly libs.bundles.coroutines
|
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
Loading…
Reference in New Issue