build.gradle 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 flutterRoot = localProperties.getProperty('flutter.sdk')
  9. if (flutterRoot == null) {
  10. throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
  11. }
  12. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  13. if (flutterVersionCode == null) {
  14. flutterVersionCode = '1'
  15. }
  16. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  17. if (flutterVersionName == null) {
  18. flutterVersionName = '1.0'
  19. }
  20. apply plugin: 'com.android.application'
  21. apply plugin: 'kotlin-android'
  22. apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
  23. android {
  24. compileSdkVersion 31
  25. signingConfigs {
  26. release {
  27. storeFile file("../sign/release.jks")
  28. keyAlias "alias_release"
  29. keyPassword "123456"
  30. storePassword "123456"
  31. }
  32. // debug {
  33. // storeFile file("../sign/debug.jks")
  34. // keyAlias "alias_debug"
  35. // keyPassword "123456"
  36. // storePassword "123456"
  37. // }
  38. }
  39. // signingConfig signingConfigs.release
  40. sourceSets {
  41. main.java.srcDirs += 'src/main/kotlin'
  42. }
  43. lintOptions {
  44. disable 'InvalidPackage'
  45. }
  46. defaultConfig {
  47. // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  48. applicationId "yoqi.me.flutternote"
  49. minSdkVersion 16
  50. targetSdkVersion 31
  51. versionCode flutterVersionCode.toInteger()
  52. versionName flutterVersionName
  53. // testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  54. ndk {
  55. abiFilters 'armeabi-v7a','arm64-v8a' //, 'x86', 'x86_64'
  56. }
  57. }
  58. buildTypes {
  59. release {
  60. // TODO: Add your own signing config for the release build.
  61. // Signing with the debug keys for now, so `flutter run --release` works.
  62. signingConfig signingConfigs.debug
  63. }
  64. }
  65. }
  66. flutter {
  67. source '../..'
  68. }
  69. dependencies {
  70. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  71. // testImplementation 'junit:junit:4.12'
  72. // androidTestImplementation 'com.android.support.test:runner:1.0.2'
  73. // androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
  74. }