build.gradle 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. plugins {
  2. id "com.android.application"
  3. id "kotlin-android"
  4. id "dev.flutter.flutter-gradle-plugin"
  5. }
  6. def localProperties = new Properties()
  7. def localPropertiesFile = rootProject.file('local.properties')
  8. if (localPropertiesFile.exists()) {
  9. localPropertiesFile.withReader('UTF-8') { reader ->
  10. localProperties.load(reader)
  11. }
  12. }
  13. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  14. if (flutterVersionCode == null) {
  15. flutterVersionCode = '1'
  16. }
  17. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  18. if (flutterVersionName == null) {
  19. flutterVersionName = '1.0'
  20. }
  21. android {
  22. namespace "com.gnhz.clinic.eitc_erm_app"
  23. compileSdk flutter.compileSdkVersion
  24. ndkVersion "26.1.10909125"
  25. compileOptions {
  26. sourceCompatibility JavaVersion.VERSION_1_8
  27. targetCompatibility JavaVersion.VERSION_1_8
  28. }
  29. kotlinOptions {
  30. jvmTarget = '1.8'
  31. }
  32. sourceSets {
  33. main.java.srcDirs += 'src/main/kotlin'
  34. }
  35. defaultConfig {
  36. applicationId "com.eitchsyh.patient"
  37. // You can update the following values to match your application needs.
  38. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
  39. minSdkVersion flutter.minSdkVersion
  40. targetSdkVersion flutter.targetSdkVersion
  41. versionCode flutterVersionCode.toInteger()
  42. versionName flutterVersionName
  43. multiDexEnabled true
  44. }
  45. signingConfigs {
  46. release {
  47. storeFile file('../key.jks')
  48. storePassword 'guonenghuizhi888'
  49. keyAlias 'jsyg'
  50. keyPassword 'guonenghuizhi888'
  51. }
  52. }
  53. buildTypes {
  54. release {
  55. minifyEnabled true//开启混淆
  56. shrinkResources true//去除无用资源
  57. zipAlignEnabled true//资源对齐
  58. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  59. signingConfig signingConfigs.release
  60. }
  61. }
  62. packagingOptions {
  63. resources {
  64. pickFirsts += ['META-INF/library_release.kotlin_module']
  65. }
  66. }
  67. buildFeatures {
  68. viewBinding true
  69. }
  70. }
  71. flutter {
  72. source '../..'
  73. }
  74. dependencies {
  75. implementation 'com.github.chrisbanes:PhotoView:2.0.0'
  76. implementation 'androidx.appcompat:appcompat:1.4.1'
  77. implementation 'com.google.android.material:material:1.4.0'
  78. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  79. implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
  80. implementation 'org.apache.commons:commons-lang3:3.12.0'
  81. }