Move Duktape stub to extensions-lib (#9954)
* Move Duktape stub to extensions-lib * Formatting fixes * Address build errors
This commit is contained in:
parent
7e29955d00
commit
39b7fe8c4e
|
@ -101,16 +101,6 @@ The extension's version name is generated automatically by concatenating `libVer
|
|||
|
||||
Extensions rely on [extensions-lib](https://github.com/tachiyomiorg/extensions-lib), which provides some interfaces and stubs from the [app](https://github.com/tachiyomiorg/tachiyomi) for compilation purposes. The actual implementations can be found [here](https://github.com/tachiyomiorg/tachiyomi/tree/master/app/src/main/java/eu/kanade/tachiyomi/source). Referencing the actual implementation will help with understanding extensions' call flow.
|
||||
|
||||
#### Duktape stub
|
||||
|
||||
[`duktape-stub`](https://github.com/tachiyomiorg/tachiyomi-extensions/tree/master/lib/duktape-stub) provides stubs for using Duktape functionality without pulling in the full library. Functionality is bundled into the main Tachiyomi app.
|
||||
|
||||
```gradle
|
||||
dependencies {
|
||||
compileOnly project(':duktape-stub')
|
||||
}
|
||||
```
|
||||
|
||||
#### Rate limiting library
|
||||
|
||||
[`lib-ratelimit`](https://github.com/tachiyomiorg/tachiyomi-extensions/tree/master/lib/ratelimit) is a library for adding rate limiting functionality as an [OkHttp interceptor](https://square.github.io/okhttp/interceptors/).
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// used both in common.gradle and themesources library
|
||||
dependencies {
|
||||
// Lib 1.2, but using specific commit so we don't need to bump up the version
|
||||
compileOnly "com.github.tachiyomiorg:extensions-lib:cfa9530"
|
||||
compileOnly "com.github.tachiyomiorg:extensions-lib:58b2d3a"
|
||||
|
||||
// These are provided by the app itself
|
||||
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||
|
@ -14,6 +14,4 @@ dependencies {
|
|||
compileOnly 'com.github.salomonbrys.kotson:kotson:2.5.0'
|
||||
compileOnly 'org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.2.0'
|
||||
compileOnly 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.0'
|
||||
|
||||
compileOnly project(':duktape-stub')
|
||||
}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
plugins {
|
||||
java
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDirs(listOf("src"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package com.squareup.duktape;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class Duktape implements Closeable {
|
||||
|
||||
public static Duktape create() {
|
||||
throw new RuntimeException("Stub!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void close() throws IOException {
|
||||
throw new RuntimeException("Stub!");
|
||||
}
|
||||
|
||||
public synchronized Object evaluate(String script) {
|
||||
throw new RuntimeException("Stub!");
|
||||
}
|
||||
|
||||
public synchronized <T> void set(String name, Class<T> type, T object) {
|
||||
throw new RuntimeException("Stub!");
|
||||
}
|
||||
|
||||
}
|
|
@ -42,7 +42,7 @@ class FoolSlideCustomizable : FoolSlide("FoolSlide Customizable", "", "other") {
|
|||
companion object {
|
||||
private const val DEFAULT_BASEURL = "https://127.0.0.1"
|
||||
private const val BASE_URL_PREF_TITLE = "Example URL: https://domain.com/path_to/directory/"
|
||||
private const val BASE_URL_PREF = "overrideBaseUrl_v${BuildConfig.VERSION_NAME}"
|
||||
private val BASE_URL_PREF = "overrideBaseUrl_v${BuildConfig.VERSION_NAME}"
|
||||
private const val BASE_URL_PREF_SUMMARY = "Connect to a designated FoolSlide server"
|
||||
private const val RESTART_TACHIYOMI = "Restart Tachiyomi to apply new setting."
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ class NeoxScanlator :
|
|||
private const val REFERER = "https://google.com/"
|
||||
|
||||
private const val DEFAULT_BASE_URL = "https://neoxscans.net"
|
||||
private const val BASE_URL_PREF_KEY = "base_url_${BuildConfig.VERSION_NAME}"
|
||||
private val BASE_URL_PREF_KEY = "base_url_${BuildConfig.VERSION_NAME}"
|
||||
private const val BASE_URL_PREF_TITLE = "URL da fonte"
|
||||
private const val BASE_URL_PREF_SUMMARY = "Para uso temporário. Quando você atualizar a " +
|
||||
"extensão, esta configuração será apagada."
|
||||
|
|
|
@ -65,7 +65,7 @@ class NeoXXXScans :
|
|||
|
||||
companion object {
|
||||
private const val DEFAULT_BASE_URL = "https://xxx.neoxscans.net"
|
||||
private const val BASE_URL_PREF_KEY = "base_url_${BuildConfig.VERSION_NAME}"
|
||||
private val BASE_URL_PREF_KEY = "base_url_${BuildConfig.VERSION_NAME}"
|
||||
private const val BASE_URL_PREF_TITLE = "URL da fonte"
|
||||
private const val BASE_URL_PREF_SUMMARY = "Para uso temporário. Quando você atualizar a " +
|
||||
"extensão, esta configuração será apagada."
|
||||
|
|
|
@ -3,9 +3,6 @@ include(":core")
|
|||
include(":lib-ratelimit")
|
||||
project(":lib-ratelimit").projectDir = File("lib/ratelimit")
|
||||
|
||||
include(":duktape-stub")
|
||||
project(":duktape-stub").projectDir = File("lib/duktape-stub")
|
||||
|
||||
include(":lib-dataimage")
|
||||
project(":lib-dataimage").projectDir = File("lib/dataimage")
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package eu.kanade.tachiyomi.extension.all.tappytoon
|
||||
|
||||
import android.util.Log
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.source.model.Filter
|
||||
import eu.kanade.tachiyomi.source.model.FilterList
|
||||
|
|
|
@ -201,7 +201,7 @@ class JMana : ConfigurableSource, ParsedHttpSource() {
|
|||
const val DETAIL_DESCRIPTION = "설명 : "
|
||||
const val DEFAULT_BASEURL = "https://jmana1.net"
|
||||
private const val BASE_URL_PREF_TITLE = "Override BaseUrl"
|
||||
private const val BASE_URL_PREF = "overrideBaseUrl_v${BuildConfig.VERSION_NAME}"
|
||||
private val BASE_URL_PREF = "overrideBaseUrl_v${BuildConfig.VERSION_NAME}"
|
||||
private const val BASE_URL_PREF_SUMMARY = "For temporary uses. Update extension will erase this setting."
|
||||
private const val RESTART_TACHIYOMI = "Restart Tachiyomi to apply new setting."
|
||||
}
|
||||
|
|
|
@ -375,7 +375,7 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
|
|||
private const val RESTART_TACHIYOMI = "Restart Tachiyomi to apply new setting."
|
||||
|
||||
private const val BASE_URL_PREF_TITLE = "Override BaseUrl"
|
||||
private const val BASE_URL_PREF = "overrideBaseUrl_v${BuildConfig.VERSION_NAME}"
|
||||
private val BASE_URL_PREF = "overrideBaseUrl_v${BuildConfig.VERSION_NAME}"
|
||||
private const val BASE_URL_PREF_SUMMARY = "For temporary uses. Update extension will erase this setting."
|
||||
|
||||
// Setting: Experimental Latest Fetcher
|
||||
|
|
|
@ -23,7 +23,6 @@ import okhttp3.Request
|
|||
import okhttp3.Response
|
||||
import rx.Observable
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.util.ArrayList
|
||||
|
||||
class Desu : HttpSource() {
|
||||
override val name = "Desu"
|
||||
|
|
Loading…
Reference in New Issue