flutter app untuk unitstock
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

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