TEXT   125

gradle

Guest on 13th December 2021 12:17:11 PM

  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.  
  9. def flutterRoot = localProperties.getProperty('flutter.sdk')
  10. if (flutterRoot == null) {
  11.     throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
  12. }
  13.  
  14. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  15. if (flutterVersionCode == null) {
  16.     flutterVersionCode = '1'
  17. }
  18.  
  19. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  20. if (flutterVersionName == null) {
  21.     flutterVersionName = '1.0'
  22. }
  23.  
  24. apply plugin: 'com.android.application'
  25. apply plugin: 'kotlin-android'
  26. apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
  27. apply plugin: 'com.google.gms.google-services'
  28. apply plugin: 'com.google.firebase.crashlytics'
  29.  
  30.  
  31.    def keystoreProperties = new Properties()
  32.    def keystorePropertiesFile = rootProject.file('key.properties')
  33.    if (keystorePropertiesFile.exists()) {
  34.        keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
  35.    }
  36.  
  37. android {
  38.     compileSdkVersion 30
  39.  
  40.     sourceSets {
  41.         main.java.srcDirs += 'src/main/kotlin'
  42.     }
  43.  
  44.     defaultConfig {
  45.         // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  46.         applicationId "com.example"
  47.         minSdkVersion 19
  48.         targetSdkVersion 30
  49.         versionCode 15
  50.         versionName '1.2.0'
  51.         multiDexEnabled = true
  52.     }
  53.  
  54. //    signingConfigs {
  55. //       release {
  56. //           keyAlias keystoreProperties['keyAlias']
  57. //           keyPassword keystoreProperties['keyPassword']
  58. //           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
  59. //           storePassword keystoreProperties['storePassword']
  60. //       }
  61. //   }
  62.    
  63.    buildTypes {
  64.        release {
  65. //           signingConfig signingConfigs.release
  66.            signingConfig signingConfigs.debug
  67.        }
  68.    }
  69.  
  70.     dexOptions {
  71.         incremental true
  72.         javaMaxHeapSize "6G"
  73.     }
  74. }
  75.  
  76. flutter {
  77.     source '../..'
  78. }
  79.  
  80. dependencies {
  81.     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  82.  
  83.     implementation platform('com.google.firebase:firebase-bom:29.0.0')
  84.     implementation 'com.google.firebase:firebase-crashlytics'
  85.     implementation 'com.google.firebase:firebase-analytics:'
  86. }

Raw Paste


Login or Register to edit or fork this paste. It's free.