Merge pull request #5658 from arkon/cleanup

Misc. cleanup
This commit is contained in:
arkon 2021-02-06 18:34:45 -05:00 committed by GitHub
commit 457c02c605
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 32 additions and 77 deletions

View File

@ -102,16 +102,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/dev/app/src/main/java/eu/kanade/tachiyomi/source). Referencing the actual implementation will help with understanding extensions' call flow. 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/dev/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 #### 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/). [`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/).

View File

@ -1,7 +0,0 @@
plugins {
id("kotlin")
}
dependencies {
compileOnly(Deps.kotlin.stdlib)
}

View File

@ -13,6 +13,5 @@ dependencies {
compileOnly 'com.google.code.gson:gson:2.8.2' compileOnly 'com.google.code.gson:gson:2.8.2'
compileOnly 'com.github.salomonbrys.kotson:kotson:2.5.0' compileOnly 'com.github.salomonbrys.kotson:kotson:2.5.0'
implementation project(":annotations") implementation project(":core")
compileOnly project(':duktape-stub') }
}

View File

@ -56,11 +56,7 @@ repositories {
mavenCentral() mavenCentral()
} }
dependencies {
implementation project(":core")
}
apply from: "$rootDir/common-dependencies.gradle" apply from: "$rootDir/common-dependencies.gradle"
preBuild.dependsOn(lintKotlin) preBuild.dependsOn(lintKotlin)
lintKotlin.dependsOn(formatKotlin) lintKotlin.dependsOn(formatKotlin)

View File

@ -1,5 +1,6 @@
plugins { plugins {
id("com.android.library") id("com.android.library")
kotlin("android")
} }
android { android {
@ -12,6 +13,7 @@ android {
sourceSets { sourceSets {
named("main") { named("main") {
manifest.srcFile("AndroidManifest.xml") manifest.srcFile("AndroidManifest.xml")
java.setSrcDirs(listOf("src"))
res.setSrcDirs(listOf("res")) res.setSrcDirs(listOf("res"))
} }
} }
@ -21,4 +23,17 @@ android {
enabled = false enabled = false
} }
} }
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
dependencies {
compileOnly(Deps.kotlin.stdlib)
} }

Binary file not shown.

View File

@ -1,6 +1,6 @@
#Thu Dec 10 21:03:32 EST 2020 #Sat Feb 06 17:57:54 EST 2021
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip

2
gradlew vendored
View File

@ -130,7 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"` APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"` JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath # We build the pattern for arguments to be converted via cygpath

21
gradlew.bat vendored
View File

@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init if "%ERRORLEVEL%" == "0" goto execute
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=% set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init if exist "%JAVA_EXE%" goto execute
echo. echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@ -64,21 +64,6 @@ echo location of your Java installation.
goto fail goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute :execute
@rem Setup the command line @rem Setup the command line
@ -86,7 +71,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell

View File

@ -1,16 +0,0 @@
plugins {
java
}
sourceSets {
main {
java {
srcDirs(listOf("src"))
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

View File

@ -20,8 +20,6 @@ repositories {
// dependencies // dependencies
apply("$rootDir/common-dependencies.gradle") apply("$rootDir/common-dependencies.gradle")
tasks.register("runAllGenerators") { tasks.register("runAllGenerators") {
doLast { doLast {
val isWindows = System.getProperty("os.name").toString().toLowerCase().contains("win") val isWindows = System.getProperty("os.name").toString().toLowerCase().contains("win")
@ -31,7 +29,7 @@ tasks.register("runAllGenerators") {
"$projectDir/build/intermediates/aar_main_jar/debug/classes.jar" // jar made from this module "$projectDir/build/intermediates/aar_main_jar/debug/classes.jar" // jar made from this module
)) ))
.joinToString(if (isWindows) ";" else ":") .joinToString(if (isWindows) ";" else ":")
val javaPath = System.getProperty("java.home") + "/bin/java" // path of java val javaPath = "${System.getProperty("java.home")}/bin/java"
val mainClass = "eu.kanade.tachiyomi.multisrc.GeneratorMainKt" // Main class we want to execute val mainClass = "eu.kanade.tachiyomi.multisrc.GeneratorMainKt" // Main class we want to execute
@ -43,7 +41,7 @@ tasks.register("runAllGenerators") {
val javaProcess = Runtime.getRuntime().exec(javaCommand) val javaProcess = Runtime.getRuntime().exec(javaCommand)
val exitCode = javaProcess.waitFor() val exitCode = javaProcess.waitFor()
if (exitCode != 0){ if (exitCode != 0){
throw Exception("Running java failed with exit code: $exitCode") throw Exception("Java process failed with exit code: $exitCode")
} }
} }
} }

View File

@ -1,2 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest package="eu.kanade.tachiyomi.lib.themesources" />
package="eu.kanade.tachiyomi.lib.themesources" />

View File

@ -1,12 +1,8 @@
include(":annotations")
include(":core") include(":core")
include(":lib-ratelimit") include(":lib-ratelimit")
project(":lib-ratelimit").projectDir = File("lib/ratelimit") project(":lib-ratelimit").projectDir = File("lib/ratelimit")
include(":duktape-stub")
project(":duktape-stub").projectDir = File("lib/duktape-stub")
include(":lib-dataimage") include(":lib-dataimage")
project(":lib-dataimage").projectDir = File("lib/dataimage") project(":lib-dataimage").projectDir = File("lib/dataimage")

View File

@ -63,7 +63,7 @@ private class ManhuaES : WPComics("Manhua ES", "https://manhuaes.com", "en", Sim
val showMoreFake = info.select(".detail-content .content-readmore").text() val showMoreFake = info.select(".detail-content .content-readmore").text()
val showMore = info.select(".detail-content .morelink").text() val showMore = info.select(".detail-content .morelink").text()
val rawDesc = info.select("div.detail-content").text() val rawDesc = info.select("div.detail-content").text()
if (showMoreFake == null || showMoreFake == "") { if (showMoreFake == null || showMoreFake == "") {
description = rawDesc.substringAfter(h3).substringAfter(strong).substringBefore(showMore) description = rawDesc.substringAfter(h3).substringAfter(strong).substringBefore(showMore)
} else { } else {

View File

@ -10,11 +10,11 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.source.online.HttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import java.util.Calendar
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import rx.Observable import rx.Observable
import java.util.Calendar
@Nsfw @Nsfw
class Latisbooks : HttpSource() { class Latisbooks : HttpSource() {

View File

@ -225,5 +225,4 @@ class Scantrad : ParsedHttpSource() {
override fun imageUrlParse(document: Document) = throw UnsupportedOperationException("Not used") override fun imageUrlParse(document: Document) = throw UnsupportedOperationException("Not used")
override fun getFilterList() = FilterList() override fun getFilterList() = FilterList()
} }

View File

@ -106,12 +106,14 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
val fullListButton = document.select(".comic-navbar .toon-nav a").last() val fullListButton = document.select(".comic-navbar .toon-nav a").last()
val list: List<SManga> = if (firstChapterButton?.text()?.contains("첫회보기") val list: List<SManga> = if (firstChapterButton?.text()?.contains("첫회보기")
?: false) { // Check this page is detail page ?: false
) { // Check this page is detail page
val details = mangaDetailsParse(document) val details = mangaDetailsParse(document)
details.url = urlPath details.url = urlPath
listOf(details) listOf(details)
} else if (fullListButton?.text()?.contains("전체목록") } else if (fullListButton?.text()?.contains("전체목록")
?: false) { // Check this page is chapter page ?: false
) { // Check this page is chapter page
val url = fullListButton.attr("abs:href") val url = fullListButton.attr("abs:href")
val details = mangaDetailsParse(client.newCall(GET(url)).execute()) val details = mangaDetailsParse(client.newCall(GET(url)).execute())
details.url = getUrlPath(url) details.url = getUrlPath(url)

View File

@ -11,6 +11,5 @@ ext {
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"
dependencies { dependencies {
compileOnly project(':duktape-stub')
implementation 'com.luhuiguo:chinese-utils:1.0' implementation 'com.luhuiguo:chinese-utils:1.0'
} }