flutter app untuk unitstock
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 

111 rader
3.2 KiB

  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: 'com.google.protobuf'
  22. apply plugin: 'kotlin-android'
  23. apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
  24. protobuf {
  25. protoc {
  26. artifact = 'com.google.protobuf:protoc:3.8.0'
  27. }
  28. plugins {
  29. javalite {
  30. artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.0'
  31. }
  32. grpc {
  33. artifact = 'io.grpc:protoc-gen-grpc-java:1.0.0-pre2'
  34. }
  35. }
  36. generateProtoTasks {
  37. all().each { task ->
  38. task.builtins {
  39. remove java
  40. }
  41. task.plugins {
  42. javalite { }
  43. grpc {
  44. option 'lite'
  45. }
  46. }
  47. }
  48. }
  49. }
  50. def keystoreProperties = new Properties()
  51. def keystorePropertiesFile = rootProject.file('key.properties')
  52. if (keystorePropertiesFile.exists()) {
  53. keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
  54. }
  55. android {
  56. compileSdkVersion 30
  57. sourceSets {
  58. main.java.srcDirs += 'src/main/kotlin'
  59. }
  60. lintOptions {
  61. disable 'InvalidPackage'
  62. }
  63. defaultConfig {
  64. // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  65. applicationId "com.thamringroup.unitstocks"
  66. minSdkVersion 18
  67. targetSdkVersion 30
  68. versionCode flutterVersionCode.toInteger()
  69. versionName flutterVersionName
  70. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  71. multiDexEnabled true
  72. }
  73. signingConfigs {
  74. release {
  75. keyAlias keystoreProperties['keyAlias']
  76. keyPassword keystoreProperties['keyPassword']
  77. storeFile keystoreProperties['storeFile'] ? rootProject.file(keystoreProperties['storeFile']) : null
  78. storePassword keystoreProperties['storePassword']
  79. }
  80. }
  81. buildTypes {
  82. release {
  83. // TODO: Add your own signing config for the release build.
  84. // Signing with the debug keys for now, so `flutter run --release` works.
  85. signingConfig signingConfigs.release
  86. }
  87. }
  88. }
  89. flutter {
  90. source '../..'
  91. }
  92. dependencies {
  93. implementation 'androidx.multidex:multidex:2.0.1'
  94. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  95. testImplementation 'junit:junit:4.12'
  96. androidTestImplementation 'androidx.test:runner:1.1.1'
  97. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  98. }