build.gradle 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // SPDX-FileCopyrightText: Adam Evyčędo
  2. //
  3. // SPDX-License-Identifier: GPL-3.0-or-later
  4. import com.android.tools.profgen.ArtProfileKt
  5. import com.android.tools.profgen.ArtProfileSerializer
  6. import com.android.tools.profgen.DexFile
  7. plugins {
  8. id 'com.android.application'
  9. id 'org.jetbrains.kotlin.android'
  10. id "org.jetbrains.kotlin.plugin.parcelize"
  11. id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.22'
  12. }
  13. android {
  14. compileSdk 34
  15. defaultConfig {
  16. applicationId "xyz.apiote.bimba.czwek"
  17. minSdk 21
  18. targetSdk 34
  19. versionCode 24
  20. versionName "3.2.0"
  21. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  22. resourceConfigurations += ["en", "pl", "it"]
  23. }
  24. applicationVariants.configureEach { variant ->
  25. variant.resValue "string", "versionName", variant.versionName
  26. }
  27. buildTypes {
  28. release {
  29. minifyEnabled false
  30. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  31. }
  32. }
  33. compileOptions {
  34. sourceCompatibility = 17
  35. targetCompatibility = 17
  36. coreLibraryDesugaringEnabled true
  37. }
  38. buildFeatures {
  39. viewBinding true
  40. }
  41. namespace 'xyz.apiote.bimba.czwek'
  42. buildToolsVersion = '34.0.0'
  43. }
  44. dependencies {
  45. implementation 'androidx.core:core-ktx:1.12.0'
  46. implementation 'androidx.appcompat:appcompat:1.6.1'
  47. implementation 'com.google.android.material:material:1.11.0'
  48. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  49. implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.7.0'
  50. implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0'
  51. implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7'
  52. implementation 'androidx.navigation:navigation-ui-ktx:2.7.7'
  53. implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  54. implementation 'androidx.core:core-splashscreen:1.0.1'
  55. implementation 'com.google.openlocationcode:openlocationcode:1.0.4'
  56. implementation 'org.osmdroid:osmdroid-android:6.1.18'
  57. implementation 'org.yaml:snakeyaml:2.2'
  58. implementation 'androidx.activity:activity-ktx:1.8.2'
  59. implementation 'com.google.openlocationcode:openlocationcode:1.0.4'
  60. implementation 'com.otaliastudios:zoomlayout:1.9.0'
  61. implementation 'dev.bandb.graphview:graphview:0.8.1'
  62. implementation 'org.jetbrains.kotlinx:kotlinx-serialization-core:1.6.3'
  63. implementation 'com.github.jershell:kbson:0.5.0'
  64. implementation project(path: ':fruchtfleisch')
  65. coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
  66. testImplementation 'junit:junit:4.13.2'
  67. androidTestImplementation 'androidx.test.ext:junit:1.1.5'
  68. androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
  69. }
  70. // NOTE fixes reproducible builds
  71. project.afterEvaluate {
  72. tasks.each { task ->
  73. if (task.name.startsWith("compile") && task.name.endsWith("ReleaseArtProfile")) {
  74. task.doLast {
  75. outputs.files.each { file ->
  76. if (file.name.endsWith(".profm")) {
  77. println("Sorting ${file} ...")
  78. def version = ArtProfileSerializer.valueOf("METADATA_0_0_2")
  79. def profile = ArtProfileKt.ArtProfile(file)
  80. def keys = new ArrayList(profile.profileData.keySet())
  81. def sortedData = new LinkedHashMap()
  82. Collections.sort keys, new DexFile.Companion()
  83. keys.each { key -> sortedData[key] = profile.profileData[key] }
  84. new FileOutputStream(file).with {
  85. write(version.magicBytes$profgen)
  86. write(version.versionBytes$profgen)
  87. version.write$profgen(it, sortedData, "")
  88. }
  89. }
  90. }
  91. }
  92. }
  93. }
  94. }