build.gradle 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 28
  25. sourceSets {
  26. main.java.srcDirs += 'src/main/kotlin'
  27. }
  28. lintOptions {
  29. disable 'InvalidPackage'
  30. }
  31. defaultConfig {
  32. applicationId "com.izouma.wanna_battle"
  33. minSdkVersion 21
  34. targetSdkVersion 28
  35. versionCode flutterVersionCode.toInteger()
  36. versionName flutterVersionName
  37. multiDexEnabled true
  38. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  39. ndk {
  40. abiFilters 'armeabi-v7a'
  41. }
  42. manifestPlaceholders = [
  43. JPUSH_PKGNAME: applicationId,
  44. JPUSH_APPKEY : "868cc9036e14c71e2b698f46",
  45. JPUSH_CHANNEL: "developer-default",
  46. ]
  47. }
  48. signingConfigs {
  49. debug {
  50. storeFile file('debug.jks')
  51. }
  52. release {
  53. storeFile file('zouma.jks')
  54. storePassword "zouma123"
  55. keyAlias "zouma"
  56. keyPassword "zouma123"
  57. }
  58. }
  59. buildTypes {
  60. debug {
  61. signingConfig signingConfigs.debug
  62. }
  63. release {
  64. signingConfig signingConfigs.release
  65. minifyEnabled true
  66. useProguard true
  67. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  68. }
  69. }
  70. compileOptions {
  71. sourceCompatibility JavaVersion.VERSION_1_8
  72. targetCompatibility JavaVersion.VERSION_1_8
  73. }
  74. configurations.all {
  75. resolutionStrategy {
  76. force 'androidx.annotation:annotation:1.0.0'
  77. }
  78. }
  79. }
  80. flutter {
  81. source '../..'
  82. }
  83. dependencies {
  84. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  85. implementation fileTree(include: ['*.jar'], dir: 'libs')
  86. implementation fileTree(include: ['*.aar'], dir: 'libs')
  87. testImplementation 'junit:junit:4.12'
  88. androidTestImplementation 'androidx.test:core:1.1.0'
  89. androidTestImplementation 'androidx.test:runner:1.1.1'
  90. androidTestImplementation 'androidx.test:rules:1.1.1'
  91. androidTestImplementation 'androidx.test.ext:junit:1.1.0'
  92. androidTestImplementation 'androidx.test.ext:truth:1.1.0'
  93. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  94. implementation 'androidx.lifecycle:lifecycle-common:2.0.0'
  95. implementation 'androidx.annotation:annotation:1.0.2'
  96. }