Separate out generator logic from the multisrc boilerplate itself

This commit is contained in:
arkon 2021-03-09 18:02:17 -05:00
parent 8e977fec59
commit 580754e668
19 changed files with 120 additions and 97 deletions

View File

@ -41,7 +41,7 @@ jobs:
env:
CI_MULTISRC: "true"
with:
arguments: :multisrc:multisrcGenerators
arguments: :multisrc:generateExtensions
wrapper-cache-enabled: true
dependencies-cache-enabled: true
configuration-cache-enabled: true

View File

@ -51,7 +51,7 @@ jobs:
with:
build-root-directory: master
wrapper-directory: master
arguments: :multisrc:multisrcGenerators
arguments: :multisrc:generateExtensions
wrapper-cache-enabled: true
dependencies-cache-enabled: true
configuration-cache-enabled: true

View File

@ -21,7 +21,7 @@ repositories {
apply("$rootDir/common-dependencies.gradle")
tasks {
val multisrcGenerators by registering {
val generateExtensions by registering {
doLast {
val isWindows = System.getProperty("os.name").toString().toLowerCase().contains("win")
val classPath = (configurations.debugCompileOnly.get().asFileTree.toList() +
@ -32,8 +32,7 @@ tasks {
.joinToString(if (isWindows) ";" else ":")
val javaPath = "${System.getProperty("java.home")}/bin/java"
val mainClass =
"eu.kanade.tachiyomi.multisrc.GeneratorMainKt" // Main class we want to execute
val mainClass = "generator.GeneratorMainKt" // Main class we want to execute
val javaCommand = if (isWindows) {
"\"$javaPath\" -classpath $classPath $mainClass".replace("/", "\\")

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.multisrc.comicake
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.SingleLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceGenerator
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class ComiCakeGenerator : ThemeSourceGenerator {

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.multisrc.eromuse
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.SingleLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceGenerator
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class EroMuseGenerator : ThemeSourceGenerator {
@ -12,7 +12,13 @@ class EroMuseGenerator : ThemeSourceGenerator {
override val baseVersionCode: Int = 1
override val sources = listOf(
SingleLang("8Muses", "https://comics.8muses.com", "en", className = "EightMuses", isNsfw = true),
SingleLang(
"8Muses",
"https://comics.8muses.com",
"en",
className = "EightMuses",
isNsfw = true
),
SingleLang("Erofus", "https://www.erofus.com", "en", isNsfw = true)
)

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.multisrc.fmreader
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.MultiLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.SingleLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceGenerator
import generator.ThemeSourceData.MultiLang
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class FMReaderGenerator : ThemeSourceGenerator {
@ -16,17 +16,42 @@ class FMReaderGenerator : ThemeSourceGenerator {
* most likely the fix is to override popularMangaNextPageSelector() */
override val sources = listOf(
SingleLang("18LHPlus", "https://18lhplus.com", "en", className = "EighteenLHPlus"),
SingleLang(
"18LHPlus",
"https://18lhplus.com",
"en",
className = "EighteenLHPlus"
),
SingleLang("Epik Manga", "https://www.epikmanga.com", "tr"),
SingleLang("HanaScan (RawQQ)", "https://hanascan.com", "ja", className = "HanaScanRawQQ"),
SingleLang(
"HanaScan (RawQQ)",
"https://hanascan.com",
"ja",
className = "HanaScanRawQQ"
),
SingleLang("HeroScan", "https://heroscan.com", "en"),
SingleLang("KissLove", "https://kissaway.net", "ja"),
SingleLang("LHTranslation", "https://lhtranslation.net", "en", overrideVersionCode = 1),
SingleLang(
"LHTranslation",
"https://lhtranslation.net",
"en",
overrideVersionCode = 1
),
SingleLang("Manga-TR", "https://manga-tr.com", "tr", className = "MangaTR"),
SingleLang("ManhuaScan", "https://manhuascan.com", "en"),
SingleLang("Manhwa18", "https://manhwa18.com", "en"),
MultiLang("Manhwa18.net", "https://manhwa18.net", listOf("en", "ko"), className = "Manhwa18NetFactory"),
SingleLang("ManhwaSmut", "https://manhwasmut.com", "en", overrideVersionCode = 1),
MultiLang(
"Manhwa18.net",
"https://manhwa18.net",
listOf("en", "ko"),
className = "Manhwa18NetFactory"
),
SingleLang(
"ManhwaSmut",
"https://manhwasmut.com",
"en",
overrideVersionCode = 1
),
SingleLang("RawLH", "https://lovehug.net", "ja"),
SingleLang("Say Truyen", "https://saytruyen.com", "vi"),
)

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.multisrc.foolslide
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.SingleLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.MultiLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceGenerator
import generator.ThemeSourceData.MultiLang
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class FoolSlideGenerator : ThemeSourceGenerator {

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.multisrc.genkan
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.SingleLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.MultiLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceGenerator
import generator.ThemeSourceData.MultiLang
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class GenkanGenerator : ThemeSourceGenerator {

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.multisrc.genkan
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.SingleLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceGenerator
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class GenkanOriginalGenerator : ThemeSourceGenerator {

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.multisrc.madara
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.SingleLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.MultiLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceGenerator
import generator.ThemeSourceData.MultiLang
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class MadaraGenerator : ThemeSourceGenerator {

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.multisrc.mangabox
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.SingleLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceGenerator
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class MangaBoxGenerator : ThemeSourceGenerator {

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.multisrc.mangadventure
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.SingleLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceGenerator
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
/** [MangAdventure] source generator. */
class MangAdventureGenerator : ThemeSourceGenerator {

View File

@ -1,10 +1,7 @@
package eu.kanade.tachiyomi.multisrc.paprika
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.SingleLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceGenerator
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class PaprikaAltGenerator : ThemeSourceGenerator {

View File

@ -1,10 +1,7 @@
package eu.kanade.tachiyomi.multisrc.paprika
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.SingleLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceGenerator
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class PaprikaGenerator : ThemeSourceGenerator {

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.multisrc.wpcomics
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.SingleLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.MultiLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceGenerator
import generator.ThemeSourceData.MultiLang
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class WPComicsGenerator : ThemeSourceGenerator {

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.multisrc.wpmangareader
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.SingleLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceGenerator
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class WPMangaReaderGenerator : ThemeSourceGenerator {
@ -19,7 +19,6 @@ class WPMangaReaderGenerator : ThemeSourceGenerator {
SingleLang("Sekaikomik", "https://www.sekaikomik.com", "id", true),
SingleLang("TurkToon", "https://turktoon.com", "tr"),
SingleLang("Gecenin Lordu", "https://geceninlordu.com/", "tr", overrideVersionCode = 1),
)
companion object {

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.multisrc.wpmangastream
import eu.kanade.tachiyomi.multisrc.ThemeSourceData.SingleLang
import eu.kanade.tachiyomi.multisrc.ThemeSourceGenerator
import generator.ThemeSourceData.SingleLang
import generator.ThemeSourceGenerator
class WPMangaStreamGenerator : ThemeSourceGenerator {

View File

@ -1,4 +1,4 @@
package eu.kanade.tachiyomi.multisrc
package generator
import java.io.File

View File

@ -1,4 +1,4 @@
package eu.kanade.tachiyomi.multisrc
package generator
import java.io.File
import java.nio.file.Files