build.gradle 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. import com.google.protobuf.gradle.*
  2. plugins {
  3. id "com.google.protobuf" version "0.9.4"
  4. id "com.android.application"
  5. id "kotlin-android"
  6. id "dev.flutter.flutter-gradle-plugin"
  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 localProperties = new Properties()
  14. def localPropertiesFile = rootProject.file('local.properties')
  15. if (localPropertiesFile.exists()) {
  16. localPropertiesFile.withReader('UTF-8') { reader ->
  17. localProperties.load(reader)
  18. }
  19. }
  20. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  21. if (flutterVersionCode == null) {
  22. flutterVersionCode = '1'
  23. }
  24. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  25. if (flutterVersionName == null) {
  26. flutterVersionName = '1.0'
  27. }
  28. dependencies {
  29. implementation 'com.google.protobuf:protobuf-javalite:3.20.1'
  30. }
  31. protobuf {
  32. protoc {
  33. artifact = 'com.google.protobuf:protoc:3.20.1'
  34. }
  35. generateProtoTasks {
  36. all().configureEach { task ->
  37. task.builtins {
  38. java {
  39. option "lite"
  40. }
  41. }
  42. }
  43. }
  44. }
  45. android {
  46. compileSdkVersion 34
  47. sourceSets {
  48. main.java.srcDirs += 'src/main/kotlin'
  49. main.proto.srcDirs += '../../../libs/hbb_common/protos'
  50. main.proto.includes += "message.proto"
  51. }
  52. compileOptions {
  53. targetCompatibility JavaVersion.VERSION_1_8
  54. sourceCompatibility JavaVersion.VERSION_1_8
  55. }
  56. defaultConfig {
  57. // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  58. applicationId "com.carriez.flutter_hbb"
  59. minSdkVersion 21
  60. targetSdkVersion 33
  61. versionCode flutterVersionCode.toInteger()
  62. versionName flutterVersionName
  63. }
  64. signingConfigs {
  65. release {
  66. keyAlias keystoreProperties['keyAlias']
  67. keyPassword keystoreProperties['keyPassword']
  68. storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
  69. storePassword keystoreProperties['storePassword']
  70. }
  71. }
  72. buildTypes {
  73. release {
  74. // TODO: Add your own signing config for the release build.
  75. // Signing with the debug keys for now, so `flutter run --release` works.
  76. signingConfig signingConfigs.release
  77. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules'
  78. }
  79. }
  80. }
  81. flutter {
  82. source '../..'
  83. }
  84. dependencies {
  85. implementation "androidx.media:media:1.6.0"
  86. implementation 'com.github.getActivity:XXPermissions:18.5'
  87. implementation("org.jetbrains.kotlin:kotlin-stdlib") { version { strictly("1.9.10") } }
  88. implementation 'com.caverock:androidsvg-aar:1.4'
  89. }