Move Duktape stub to extensions-lib ()

* Move Duktape stub to extensions-lib

* Formatting fixes

* Address build errors
This commit is contained in:
arkon 2021-11-28 13:00:39 -05:00 committed by GitHub
parent 7e29955d00
commit 39b7fe8c4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 12 additions and 71 deletions
CONTRIBUTING.mdcommon-dependencies.gradle
lib/duktape-stub
build.gradle.kts
src/com/squareup/duktape
multisrc/overrides
foolslide/foolslidecustomizable/src
madara
neoxscanlator/src
neoxxxscans/src
settings.gradle.kts
src
all
mangapark/src/eu/kanade/tachiyomi/extension/all/mangapark
tappytoon/src/eu/kanade/tachiyomi/extension/all/tappytoon
ar/mangalink/src/eu/kanade/tachiyomi/extension/ar/mangalink
es/tumangaonline/src/eu/kanade/tachiyomi/extension/es/tumangaonline
ko
jmana/src/eu/kanade/tachiyomi/extension/ko/jmana
newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki
ru/desu/src/eu/kanade/tachiyomi/extension/ru/desu

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

@ -39,7 +39,7 @@ open class MangaPark(
override val name: String = "MangaPark v3"
override val baseUrl: String = "https://v35.mangapark.net" //temporary url change to keep the ext working after update return to https://mangapark.net or https://v36.mangapark.net at later date
override val baseUrl: String = "https://v35.mangapark.net" // temporary url change to keep the ext working after update return to https://mangapark.net or https://v36.mangapark.net at later date
override val supportsLatest = true

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

@ -146,7 +146,7 @@ class MangaLink : ConfigurableSource, ParsedHttpSource() {
Type("غير معروف", "6"),
)
//Preferences
// Preferences
override fun setupPreferenceScreen(screen: PreferenceScreen) {
val domainPref = ListPreference(screen.context).apply {

@ -569,7 +569,7 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() {
private const val IMAGE_CDN_RATELIMIT_PREF_SUMMARY = "Este valor afecta la cantidad de solicitudes de red para descargar imágenes. Reducir este valor puede disminuir errores al cargar imagenes, pero la velocidad de descarga será más lenta. Se requiere reiniciar Tachiyomi. \nValor actual: %s"
private const val IMAGE_CDN_RATELIMIT_PREF_DEFAULT_VALUE = "10"
private val ENTRIES_ARRAY = listOf(1,2,3,5,6,7,8,9,10,15,20,30,40,50,100).map { i -> i.toString() }.toTypedArray()
private val ENTRIES_ARRAY = listOf(1, 2, 3, 5, 6, 7, 8, 9, 10, 15, 20, 30, 40, 50, 100).map { i -> i.toString() }.toTypedArray()
const val PREFIX_LIBRARY = "library"
const val PREFIX_ID_SEARCH = "id:"

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