build.gradle.kts 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. import com.android.build.gradle.internal.tasks.factory.dependsOn
  2. import com.android.build.gradle.tasks.ExtractDeepLinksTask
  3. import com.android.build.gradle.tasks.MergeResources
  4. import de.undercouch.gradle.tasks.download.Download
  5. import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
  6. // SPDX-FileCopyrightText: Adam Evyčędo
  7. //
  8. // SPDX-License-Identifier: GPL-3.0-or-later
  9. plugins {
  10. id("com.android.application")
  11. kotlin("android")
  12. kotlin("plugin.parcelize")
  13. kotlin("plugin.serialization")
  14. id("org.openapi.generator")
  15. id("de.undercouch.download")
  16. }
  17. android {
  18. namespace = "xyz.apiote.bimba.czwek"
  19. // NOTE apksigner with `--alignment-preserved` https://gitlab.com/fdroid/fdroiddata/-/issues/3299#note_1989808414
  20. compileSdk = 35
  21. buildToolsVersion = "35.0.0"
  22. defaultConfig {
  23. applicationId = "xyz.apiote.bimba.czwek"
  24. minSdk = 21
  25. targetSdk = 35
  26. versionCode = 33
  27. versionName = "3.7.1"
  28. testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
  29. resourceConfigurations += listOf("en", "de", "en-rGB", "en-rUS", "et", "fr", "it", "pl")
  30. }
  31. buildTypes {
  32. getByName("release") {
  33. isMinifyEnabled = false
  34. proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
  35. }
  36. }
  37. applicationVariants.configureEach {
  38. resValue("string", "versionName", versionName)
  39. resValue("string", "applicationId", applicationId)
  40. }
  41. compileOptions {
  42. sourceCompatibility = JavaVersion.VERSION_21
  43. targetCompatibility = JavaVersion.VERSION_21
  44. isCoreLibraryDesugaringEnabled = true
  45. }
  46. buildFeatures {
  47. viewBinding = true
  48. }
  49. }
  50. tasks.register<Download>("downloadFile") {
  51. src("https://raw.githubusercontent.com/motis-project/motis/refs/heads/master/openapi.yaml")
  52. dest("${layout.buildDirectory.get()}/motis2.yml")
  53. overwrite(false)
  54. }
  55. tasks.register<Exec>("lintReuse") {
  56. commandLine("reuse", "lint")
  57. }
  58. tasks.named("openApiGenerate").dependsOn("downloadFile")
  59. openApiGenerate {
  60. generatorName.set("kotlin")
  61. inputSpec.set("${layout.buildDirectory.get()}/motis2.yml")
  62. outputDir.set("${layout.buildDirectory.get()}/generated")
  63. apiPackage.set("xyz.apiote.bimba.czwek.api.transitous.api")
  64. invokerPackage.set("xyz.apiote.bimba.czwek.api.transitous.invoker")
  65. modelPackage.set("xyz.apiote.bimba.czwek.api.transitous.model")
  66. }
  67. kotlin.sourceSets["main"].kotlin.srcDir("${layout.buildDirectory.get()}/generated/src/main/kotlin")
  68. tasks.withType<KotlinCompile> {
  69. dependsOn("openApiGenerate")
  70. dependsOn("lintReuse")
  71. }
  72. tasks.withType<MergeResources> {
  73. dependsOn("openApiGenerate")
  74. dependsOn("lintReuse")
  75. }
  76. tasks.withType<ExtractDeepLinksTask> {
  77. dependsOn("openApiGenerate")
  78. dependsOn("lintReuse")
  79. }
  80. dependencies {
  81. implementation("androidx.core:core-ktx:1.15.0")
  82. implementation("androidx.appcompat:appcompat:1.7.0")
  83. implementation("com.google.android.material:material:1.12.0")
  84. implementation("androidx.constraintlayout:constraintlayout:2.2.0")
  85. implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.7")
  86. implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7")
  87. implementation("androidx.navigation:navigation-fragment-ktx:2.8.4")
  88. implementation("androidx.navigation:navigation-ui-ktx:2.8.4")
  89. implementation("androidx.legacy:legacy-support-v4:1.0.0")
  90. implementation("androidx.core:core-splashscreen:1.0.1")
  91. implementation("com.google.openlocationcode:openlocationcode:1.0.4")
  92. implementation("org.osmdroid:osmdroid-android:6.1.20")
  93. implementation("org.yaml:snakeyaml:2.3")
  94. implementation("androidx.activity:activity-ktx:1.9.3")
  95. implementation("com.otaliastudios:zoomlayout:1.9.0")
  96. implementation("dev.bandb.graphview:graphview:0.8.1")
  97. implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.3")
  98. implementation("com.github.jershell:kbson:0.5.0")
  99. implementation("androidx.preference:preference-ktx:1.2.1")
  100. implementation("androidx.work:work-runtime-ktx:2.10.0")
  101. implementation("com.github.doyaaaaaken:kotlin-csv-jvm:1.10.0")
  102. implementation("commons-io:commons-io:2.18.0")
  103. implementation("com.google.guava:guava:33.3.1-android")
  104. implementation(project(":fruchtfleisch"))
  105. implementation("ch.acra:acra-http:5.12.0")
  106. implementation("ch.acra:acra-notification:5.12.0")
  107. implementation("com.squareup.okhttp3:okhttp:4.12.0")
  108. implementation("com.squareup.moshi:moshi-kotlin:1.15.1")
  109. implementation("androidx.activity:activity:1.9.3")
  110. coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.3")
  111. androidTestImplementation("androidx.test.ext:junit:1.2.1")
  112. androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
  113. }