build.gradle 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. plugins {
  2. id 'com.android.application'
  3. id 'org.jetbrains.kotlin.android'
  4. }
  5. def getVersionCode = { ->
  6. try {
  7. def stdout = new ByteArrayOutputStream()
  8. exec {
  9. commandLine 'git', 'rev-list', '--first-parent', '--count', 'master'
  10. standardOutput = stdout
  11. }
  12. return Integer.parseInt(stdout.toString().trim())
  13. }
  14. catch (ignored) {
  15. return -1;
  16. }
  17. }
  18. def getVersionName = { ->
  19. try {
  20. def stdout = new ByteArrayOutputStream()
  21. exec {
  22. commandLine 'git', 'describe', '--always', '--tags', '--dirty'
  23. standardOutput = stdout
  24. }
  25. return stdout.toString().trim()
  26. }
  27. catch (ignored) {
  28. return null;
  29. }
  30. }
  31. // Signing config, mainly intended for debug builds
  32. def keystorePropertiesFile = rootProject.file("keystore.properties");
  33. def keystoreProperties = new Properties()
  34. keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
  35. android {
  36. compileSdk 34
  37. defaultConfig {
  38. applicationId "im.angry.openeuicc"
  39. minSdk 30
  40. targetSdk 31
  41. versionCode getVersionCode()
  42. versionName getVersionName()
  43. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  44. }
  45. signingConfigs {
  46. config {
  47. storeFile file(keystoreProperties['storeFile'])
  48. storePassword keystoreProperties['storePassword']
  49. keyAlias keystoreProperties['keyAlias']
  50. keyPassword keystoreProperties['keyPassword']
  51. }
  52. }
  53. buildTypes {
  54. release {
  55. minifyEnabled false
  56. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  57. signingConfig signingConfigs.config
  58. }
  59. debug {
  60. signingConfig signingConfigs.config
  61. }
  62. }
  63. compileOptions {
  64. sourceCompatibility JavaVersion.VERSION_1_8
  65. targetCompatibility JavaVersion.VERSION_1_8
  66. }
  67. kotlinOptions {
  68. jvmTarget = '1.8'
  69. }
  70. namespace 'im.angry.openeuicc'
  71. }
  72. dependencies {
  73. compileOnly project(':libs:hidden-apis-stub')
  74. implementation project(':libs:hidden-apis-shim')
  75. implementation project(":libs:lpad-sm-dp-plus-connector")
  76. implementation project(":libs:lpac-jni")
  77. implementation 'androidx.core:core-ktx:1.12.0'
  78. implementation 'androidx.appcompat:appcompat:1.6.1'
  79. implementation 'com.google.android.material:material:1.10.0'
  80. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  81. implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
  82. implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
  83. implementation "androidx.cardview:cardview:1.0.0"
  84. implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
  85. testImplementation 'junit:junit:4.13.2'
  86. androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  87. androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  88. }