build.gradle 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.compdfkit.flutter.example"
  23. compileSdk flutter.compileSdkVersion
  24. ndkVersion flutter.ndkVersion
  25. signingConfigs {
  26. release {
  27. if (project.hasProperty("Keystore.properties")) {
  28. String filePath = project.property("Keystore.properties")
  29. File propsFile = new File(filePath)
  30. if (propsFile.exists()) {
  31. Properties props = new Properties()
  32. props.load(propsFile.newDataInputStream())
  33. storeFile file(props['storeFile'])
  34. storePassword props['keystore.password']
  35. keyAlias props['keyAlias']
  36. keyPassword props['keyAlias.password']
  37. }
  38. }
  39. }
  40. }
  41. compileOptions {
  42. sourceCompatibility JavaVersion.VERSION_1_8
  43. targetCompatibility JavaVersion.VERSION_1_8
  44. }
  45. kotlinOptions {
  46. jvmTarget = '1.8'
  47. }
  48. defaultConfig {
  49. applicationId "com.compdfkit.flutter.example"
  50. // You can update the following values to match your application needs.
  51. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
  52. minSdkVersion rootProject.ext.android.MINSDK
  53. targetSdkVersion flutter.targetSdkVersion
  54. versionCode rootProject.ext.android.VERSIONCODE
  55. versionName flutterVersionName
  56. }
  57. buildTypes {
  58. release {
  59. minifyEnabled true
  60. signingConfig signingConfigs.release
  61. proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
  62. }
  63. }
  64. }
  65. flutter {
  66. source '../..'
  67. }
  68. dependencies {
  69. api fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
  70. implementation 'com.google.android.material:material:1.12.0'
  71. implementation 'androidx.appcompat:appcompat:1.7.0'
  72. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  73. }