build.gradle.kts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import com.android.build.gradle.BaseExtension
  2. import com.android.build.gradle.BasePlugin
  3. import org.gradle.api.tasks.testing.logging.TestLogEvent
  4. import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
  5. buildscript {
  6. dependencies {
  7. classpath(libs.android.shortcut.gradle)
  8. classpath(libs.google.services.gradle)
  9. classpath(libs.aboutLibraries.gradle)
  10. classpath(libs.sqldelight.gradle)
  11. }
  12. }
  13. plugins {
  14. alias(kotlinx.plugins.serialization) apply false
  15. }
  16. subprojects {
  17. tasks.withType<KotlinJvmCompile> {
  18. kotlinOptions {
  19. jvmTarget = JavaVersion.VERSION_17.toString()
  20. }
  21. }
  22. tasks.withType<Test> {
  23. useJUnitPlatform()
  24. testLogging {
  25. events(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
  26. }
  27. }
  28. plugins.withType<BasePlugin> {
  29. plugins.apply("tachiyomi.lint")
  30. configure<BaseExtension> {
  31. compileSdkVersion(AndroidConfig.compileSdk)
  32. defaultConfig {
  33. minSdk = AndroidConfig.minSdk
  34. targetSdk = AndroidConfig.targetSdk
  35. ndk {
  36. version = AndroidConfig.ndk
  37. }
  38. }
  39. compileOptions {
  40. sourceCompatibility = JavaVersion.VERSION_17
  41. targetCompatibility = JavaVersion.VERSION_17
  42. isCoreLibraryDesugaringEnabled = true
  43. }
  44. dependencies {
  45. add("coreLibraryDesugaring", libs.desugar)
  46. }
  47. }
  48. }
  49. }
  50. tasks.register<Delete>("clean") {
  51. delete(rootProject.layout.buildDirectory)
  52. }