build.gradle 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. signingConfig signingConfigs.release
  60. proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
  61. }
  62. }
  63. }
  64. flutter {
  65. source '../..'
  66. }
  67. dependencies {
  68. api fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
  69. implementation 'com.google.android.material:material:1.8.0'
  70. implementation 'androidx.appcompat:appcompat:1.6.1'
  71. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  72. }