From 10ba7dfbe5f60e2c97d59b871443cfa32e6f1e0b Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Wed, 25 Aug 2021 14:47:59 +0430 Subject: [PATCH] [skip ci] add intellij configuration generator for themes (#8833) --- .run/BakkinGenerator.run.xml | 17 ++++++ .run/ComiCakeGenerator.run.xml | 17 ++++++ .run/EroMuseGenerator.run.xml | 17 ++++++ .run/FMReaderGenerator.run.xml | 17 ++++++ .run/FoolSlideGenerator.run.xml | 17 ++++++ .run/GattsuGenerator.run.xml | 17 ++++++ .run/GenkanGenerator.run.xml | 17 ++++++ .run/GenkanOriginalGenerator.run.xml | 17 ++++++ .run/GigaViewerGenerator.run.xml | 17 ++++++ .run/GuyaGenerator.run.xml | 17 ++++++ .run/LusciousGenerator.run.xml | 17 ++++++ .run/MMRCMSGenerator.run.xml | 17 ++++++ .run/MadaraGenerator.run.xml | 17 ++++++ .run/MangAdventureGenerator.run.xml | 17 ++++++ .run/MangaBoxGenerator.run.xml | 17 ++++++ .run/MangaCatalogGenerator.run.xml | 17 ++++++ .run/MangaMainacGenerator.run.xml | 17 ++++++ .run/MangaSarGenerator.run.xml | 17 ++++++ .run/NepNepGenerator.run.xml | 17 ++++++ .run/NyaHentaiGenerator.run.xml | 17 ++++++ .run/PaprikaAltGenerator.run.xml | 17 ++++++ .run/PaprikaGenerator.run.xml | 17 ++++++ .run/PizzaReaderGenerator.run.xml | 17 ++++++ .run/ReaderFrontGenerator.run.xml | 17 ++++++ .run/WPComicsGenerator.run.xml | 17 ++++++ .run/WPMangaReaderGenerator.run.xml | 17 ++++++ .run/WPMangaStreamGenerator.run.xml | 17 ++++++ .run/WebtoonsGenerator.run.xml | 17 ++++++ .run/WebtoonsTranslateGenerator.run.xml | 17 ++++++ .run/WeebreaderGenerator.run.xml | 17 ++++++ .run/ZMangaGenerator.run.xml | 17 ++++++ .run/ZbuluGenerator.run.xml | 17 ++++++ .../IntelijConfigurationGeneratorMain.kt | 58 +++++++++++++++++++ 33 files changed, 602 insertions(+) create mode 100644 .run/BakkinGenerator.run.xml create mode 100644 .run/ComiCakeGenerator.run.xml create mode 100644 .run/EroMuseGenerator.run.xml create mode 100644 .run/FMReaderGenerator.run.xml create mode 100644 .run/FoolSlideGenerator.run.xml create mode 100644 .run/GattsuGenerator.run.xml create mode 100644 .run/GenkanGenerator.run.xml create mode 100644 .run/GenkanOriginalGenerator.run.xml create mode 100644 .run/GigaViewerGenerator.run.xml create mode 100644 .run/GuyaGenerator.run.xml create mode 100644 .run/LusciousGenerator.run.xml create mode 100644 .run/MMRCMSGenerator.run.xml create mode 100644 .run/MadaraGenerator.run.xml create mode 100644 .run/MangAdventureGenerator.run.xml create mode 100644 .run/MangaBoxGenerator.run.xml create mode 100644 .run/MangaCatalogGenerator.run.xml create mode 100644 .run/MangaMainacGenerator.run.xml create mode 100644 .run/MangaSarGenerator.run.xml create mode 100644 .run/NepNepGenerator.run.xml create mode 100644 .run/NyaHentaiGenerator.run.xml create mode 100644 .run/PaprikaAltGenerator.run.xml create mode 100644 .run/PaprikaGenerator.run.xml create mode 100644 .run/PizzaReaderGenerator.run.xml create mode 100644 .run/ReaderFrontGenerator.run.xml create mode 100644 .run/WPComicsGenerator.run.xml create mode 100644 .run/WPMangaReaderGenerator.run.xml create mode 100644 .run/WPMangaStreamGenerator.run.xml create mode 100644 .run/WebtoonsGenerator.run.xml create mode 100644 .run/WebtoonsTranslateGenerator.run.xml create mode 100644 .run/WeebreaderGenerator.run.xml create mode 100644 .run/ZMangaGenerator.run.xml create mode 100644 .run/ZbuluGenerator.run.xml create mode 100644 multisrc/src/main/java/generator/IntelijConfigurationGeneratorMain.kt diff --git a/.run/BakkinGenerator.run.xml b/.run/BakkinGenerator.run.xml new file mode 100644 index 000000000..c8e88d1b2 --- /dev/null +++ b/.run/BakkinGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/ComiCakeGenerator.run.xml b/.run/ComiCakeGenerator.run.xml new file mode 100644 index 000000000..6199f212b --- /dev/null +++ b/.run/ComiCakeGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/EroMuseGenerator.run.xml b/.run/EroMuseGenerator.run.xml new file mode 100644 index 000000000..df89ae9d0 --- /dev/null +++ b/.run/EroMuseGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/FMReaderGenerator.run.xml b/.run/FMReaderGenerator.run.xml new file mode 100644 index 000000000..85ab8d6f4 --- /dev/null +++ b/.run/FMReaderGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/FoolSlideGenerator.run.xml b/.run/FoolSlideGenerator.run.xml new file mode 100644 index 000000000..9c1f7deb2 --- /dev/null +++ b/.run/FoolSlideGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/GattsuGenerator.run.xml b/.run/GattsuGenerator.run.xml new file mode 100644 index 000000000..eedd47afc --- /dev/null +++ b/.run/GattsuGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/GenkanGenerator.run.xml b/.run/GenkanGenerator.run.xml new file mode 100644 index 000000000..4d8d4b802 --- /dev/null +++ b/.run/GenkanGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/GenkanOriginalGenerator.run.xml b/.run/GenkanOriginalGenerator.run.xml new file mode 100644 index 000000000..c05913779 --- /dev/null +++ b/.run/GenkanOriginalGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/GigaViewerGenerator.run.xml b/.run/GigaViewerGenerator.run.xml new file mode 100644 index 000000000..18e110714 --- /dev/null +++ b/.run/GigaViewerGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/GuyaGenerator.run.xml b/.run/GuyaGenerator.run.xml new file mode 100644 index 000000000..0e0fc6fab --- /dev/null +++ b/.run/GuyaGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/LusciousGenerator.run.xml b/.run/LusciousGenerator.run.xml new file mode 100644 index 000000000..ffe9f241e --- /dev/null +++ b/.run/LusciousGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/MMRCMSGenerator.run.xml b/.run/MMRCMSGenerator.run.xml new file mode 100644 index 000000000..09973bf6e --- /dev/null +++ b/.run/MMRCMSGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/MadaraGenerator.run.xml b/.run/MadaraGenerator.run.xml new file mode 100644 index 000000000..784f76523 --- /dev/null +++ b/.run/MadaraGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/MangAdventureGenerator.run.xml b/.run/MangAdventureGenerator.run.xml new file mode 100644 index 000000000..c4f8e0a86 --- /dev/null +++ b/.run/MangAdventureGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/MangaBoxGenerator.run.xml b/.run/MangaBoxGenerator.run.xml new file mode 100644 index 000000000..c2a20df3f --- /dev/null +++ b/.run/MangaBoxGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/MangaCatalogGenerator.run.xml b/.run/MangaCatalogGenerator.run.xml new file mode 100644 index 000000000..7b4c284e9 --- /dev/null +++ b/.run/MangaCatalogGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/MangaMainacGenerator.run.xml b/.run/MangaMainacGenerator.run.xml new file mode 100644 index 000000000..b9b20da67 --- /dev/null +++ b/.run/MangaMainacGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/MangaSarGenerator.run.xml b/.run/MangaSarGenerator.run.xml new file mode 100644 index 000000000..97f343d2a --- /dev/null +++ b/.run/MangaSarGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/NepNepGenerator.run.xml b/.run/NepNepGenerator.run.xml new file mode 100644 index 000000000..eec50bbaf --- /dev/null +++ b/.run/NepNepGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/NyaHentaiGenerator.run.xml b/.run/NyaHentaiGenerator.run.xml new file mode 100644 index 000000000..2fa18896f --- /dev/null +++ b/.run/NyaHentaiGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/PaprikaAltGenerator.run.xml b/.run/PaprikaAltGenerator.run.xml new file mode 100644 index 000000000..ff6422798 --- /dev/null +++ b/.run/PaprikaAltGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/PaprikaGenerator.run.xml b/.run/PaprikaGenerator.run.xml new file mode 100644 index 000000000..ca03466f1 --- /dev/null +++ b/.run/PaprikaGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/PizzaReaderGenerator.run.xml b/.run/PizzaReaderGenerator.run.xml new file mode 100644 index 000000000..9ae507923 --- /dev/null +++ b/.run/PizzaReaderGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/ReaderFrontGenerator.run.xml b/.run/ReaderFrontGenerator.run.xml new file mode 100644 index 000000000..1913aa55f --- /dev/null +++ b/.run/ReaderFrontGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/WPComicsGenerator.run.xml b/.run/WPComicsGenerator.run.xml new file mode 100644 index 000000000..18d231f03 --- /dev/null +++ b/.run/WPComicsGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/WPMangaReaderGenerator.run.xml b/.run/WPMangaReaderGenerator.run.xml new file mode 100644 index 000000000..5aab1ea24 --- /dev/null +++ b/.run/WPMangaReaderGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/WPMangaStreamGenerator.run.xml b/.run/WPMangaStreamGenerator.run.xml new file mode 100644 index 000000000..a81ef9aac --- /dev/null +++ b/.run/WPMangaStreamGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/WebtoonsGenerator.run.xml b/.run/WebtoonsGenerator.run.xml new file mode 100644 index 000000000..46410fa96 --- /dev/null +++ b/.run/WebtoonsGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/WebtoonsTranslateGenerator.run.xml b/.run/WebtoonsTranslateGenerator.run.xml new file mode 100644 index 000000000..892c49a1f --- /dev/null +++ b/.run/WebtoonsTranslateGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/WeebreaderGenerator.run.xml b/.run/WeebreaderGenerator.run.xml new file mode 100644 index 000000000..0c80a0550 --- /dev/null +++ b/.run/WeebreaderGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/ZMangaGenerator.run.xml b/.run/ZMangaGenerator.run.xml new file mode 100644 index 000000000..71a971890 --- /dev/null +++ b/.run/ZMangaGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/.run/ZbuluGenerator.run.xml b/.run/ZbuluGenerator.run.xml new file mode 100644 index 000000000..f46e0eb28 --- /dev/null +++ b/.run/ZbuluGenerator.run.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/multisrc/src/main/java/generator/IntelijConfigurationGeneratorMain.kt b/multisrc/src/main/java/generator/IntelijConfigurationGeneratorMain.kt new file mode 100644 index 000000000..4cdf35f4b --- /dev/null +++ b/multisrc/src/main/java/generator/IntelijConfigurationGeneratorMain.kt @@ -0,0 +1,58 @@ +package generator + +import java.io.File + +/** + * Finds all themes and creates an Intellij Idea run configuration for their generators + * Should be run after creation/deletion of each theme + */ +fun main(args: Array) { + val userDir = System.getProperty("user.dir")!! + val sourcesDirPath = "$userDir/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc" + val sourcesDir = File(sourcesDirPath) + + // cleanup from past runs + File("$userDir/.run").apply { + if(exists()) + deleteRecursively() + mkdirs() + } + + // find all theme packages + sourcesDir.list()!! + .filter { File(sourcesDir, it).isDirectory } + .forEach { themeSource -> + // Find all XxxGenerator.kt files + File("$sourcesDirPath/$themeSource").list()!! + .filter { it.endsWith("Generator.kt") } + .map { it.substringBefore(".kt") } + .forEach { generatorClass -> + val file = File("$userDir/.run/$generatorClass.run.xml") + val intellijConfStr = """ + + + + + + """.trimIndent() + file.writeText(intellijConfStr) + + // Find Java class and extract method lists + Class.forName("eu/kanade/tachiyomi/multisrc/$themeSource/$generatorClass".replace("/", ".").substringBefore(".kt")) + .methods + .find { it.name == "main" } + } + } +}