plugins { id("com.android.library") alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.serialization) } android { compileSdk = AndroidConfig.compileSdk namespace = AndroidConfig.multisrcNamespace defaultConfig { minSdk = 29 } kotlinOptions { freeCompilerArgs += "-opt-in=kotlinx.serialization.ExperimentalSerializationApi" } } configurations { compileOnly { isCanBeResolved = true } } dependencies { compileOnly(libs.bundles.common) // Implements all shared-extractors on the extensions generator // Note that this does not mean that generated sources are going to // implement them too; this is just to be able to compile and generate sources. rootProject.subprojects .filter { it.path.startsWith(":lib") } .forEach(::implementation) } tasks { register("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 mainClass.set("generator.GeneratorMainKt") workingDir = workingDir.parentFile // project root errorOutput = System.out // for GitHub workflow commands if (!logger.isInfoEnabled) { standardOutput = org.gradle.internal.io.NullOutputStream.INSTANCE } dependsOn("ktFormat", "ktLint", "assembleDebug") } register("ktLint") { if (project.hasProperty("theme")) { val theme = project.property("theme") source(files("src/main/java/eu/kanade/tachiyomi/multisrc/$theme", "overrides/$theme")) return@register } source(files("src", "overrides")) } register("ktFormat") { if (project.hasProperty("theme")) { val theme = project.property("theme") source(files("src/main/java/eu/kanade/tachiyomi/multisrc/$theme", "overrides/$theme")) return@register } source(files("src", "overrides")) } }