build.gradle 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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:lpac-jni")
  76. implementation 'androidx.core:core-ktx:1.12.0'
  77. implementation 'androidx.appcompat:appcompat:1.6.1'
  78. implementation 'com.google.android.material:material:1.10.0'
  79. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  80. implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
  81. implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
  82. implementation "androidx.cardview:cardview:1.0.0"
  83. implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
  84. testImplementation 'junit:junit:4.13.2'
  85. androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  86. androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  87. }