Skip to content

Commit

Permalink
feat(multisrc): Make specific multisrc generation easier for gradle C…
Browse files Browse the repository at this point in the history
…LI bros
  • Loading branch information
Claudemirovsky committed Sep 21, 2023
1 parent 5aee7f6 commit 86ede2f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion multisrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,23 @@ tasks {
register<JavaExec>("generateExtensions") {
classpath = configurations.compileOnly.get() +
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")

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

errorOutput = System.out // for GitHub workflow commands
Expand Down

0 comments on commit 86ede2f

Please sign in to comment.