feat(multisrc): Make theme-specific generation easier for gradle CLI bros (#2233)
This commit is contained in:
@ -38,9 +38,23 @@ tasks {
|
|||||||
register<JavaExec>("generateExtensions") {
|
register<JavaExec>("generateExtensions") {
|
||||||
classpath = configurations.compileOnly.get() +
|
classpath = configurations.compileOnly.get() +
|
||||||
configurations.androidApis.get() + // android.jar path
|
configurations.androidApis.get() + // android.jar path
|
||||||
files("$buildDir/intermediates/aar_main_jar/debug/classes.jar") // jar made from this module
|
layout.buildDirectory.files("intermediates/aar_main_jar/debug/classes.jar") // jar made from this module
|
||||||
|
|
||||||
|
// Default generator class, generates extensions for all themes.
|
||||||
mainClass.set("generator.GeneratorMainKt")
|
mainClass.set("generator.GeneratorMainKt")
|
||||||
|
|
||||||
|
// Only generate extensions from a specified theme.
|
||||||
|
if (project.hasProperty("theme")) {
|
||||||
|
val theme = project.property("theme")
|
||||||
|
val themeDir = file("src/main/java/eu/kanade/tachiyomi/multisrc/$theme")
|
||||||
|
if (themeDir.isDirectory) {
|
||||||
|
val className = themeDir.list()!!
|
||||||
|
.first { it.endsWith("Generator.kt") }
|
||||||
|
.removeSuffix(".kt")
|
||||||
|
mainClass.set("eu.kanade.tachiyomi.multisrc.$theme.$className")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
workingDir = workingDir.parentFile // project root
|
workingDir = workingDir.parentFile // project root
|
||||||
|
|
||||||
errorOutput = System.out // for GitHub workflow commands
|
errorOutput = System.out // for GitHub workflow commands
|
||||||
|
Reference in New Issue
Block a user