build.gradle 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. def localProperties = new Properties()
  2. def localPropertiesFile = rootProject.file('local.properties')
  3. if (localPropertiesFile.exists()) {
  4. localPropertiesFile.withReader('UTF-8') { reader ->
  5. localProperties.load(reader)
  6. }
  7. }
  8. def keystoreProperties = new Properties()
  9. def keystorePropertiesFile = rootProject.file('key.properties')
  10. if (keystorePropertiesFile.exists()) {
  11. keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
  12. }
  13. def flutterRoot = localProperties.getProperty('flutter.sdk')
  14. if (flutterRoot == null) {
  15. throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
  16. }
  17. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  18. if (flutterVersionCode == null) {
  19. flutterVersionCode = '1'
  20. }
  21. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  22. if (flutterVersionName == null) {
  23. flutterVersionName = '1.0'
  24. }
  25. apply plugin: 'com.android.application'
  26. apply plugin: 'kotlin-android'
  27. apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
  28. android {
  29. namespace "com.compdfkit.flutter.example"
  30. compileSdkVersion flutter.compileSdkVersion
  31. ndkVersion flutter.ndkVersion
  32. compileOptions {
  33. sourceCompatibility JavaVersion.VERSION_1_8
  34. targetCompatibility JavaVersion.VERSION_1_8
  35. }
  36. signingConfigs {
  37. release {
  38. keyAlias keystoreProperties['keyAlias']
  39. keyPassword keystoreProperties['keyPassword']
  40. storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
  41. storePassword keystoreProperties['storePassword']
  42. }
  43. }
  44. defaultConfig {
  45. applicationId "com.compdfkit.flutter.example"
  46. minSdkVersion 21
  47. targetSdkVersion flutter.targetSdkVersion
  48. versionCode flutterVersionCode.toInteger()
  49. versionName flutterVersionName
  50. }
  51. buildTypes {
  52. release {
  53. minifyEnabled false
  54. shrinkResources false
  55. signingConfig signingConfigs.release
  56. }
  57. }
  58. packagingOptions {
  59. pickFirst 'lib/x86_64/libapp.so'
  60. pickFirst 'lib/armeabi-v7a/libapp.so'
  61. pickFirst 'lib/arm64-v8a/libapp.so'
  62. }
  63. }
  64. flutter {
  65. source '../..'
  66. }
  67. dependencies {
  68. api fileTree(include: ['*.jar'], dir: 'libs')
  69. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  70. api 'com.compdf:compdfkit:1.9.1'
  71. api 'com.compdf:compdfkit-ui:1.9.1'
  72. api 'com.compdf:compdfkit-tools:1.9.1'
  73. }