Advertisement
Guest User

build gradle file

a guest
Sep 16th, 2019
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  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.  
  10. def flutterRoot = localProperties.getProperty('flutter.sdk')
  11. if (flutterRoot == null) {
  12. throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
  13. }
  14.  
  15. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  16. if (flutterVersionCode == null) {
  17. flutterVersionCode = '1'
  18. }
  19.  
  20. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  21. if (flutterVersionName == null) {
  22. flutterVersionName = '1.0'
  23. }
  24.  
  25. apply plugin: 'com.android.application'
  26. apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
  27.  
  28. def keystoreProperties = new Properties()
  29. def keystorePropertiesFile = rootProject.file('key.properties')
  30. if (keystorePropertiesFile.exists()) {
  31. keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
  32. }
  33.  
  34. android {
  35. compileSdkVersion 28
  36.  
  37. lintOptions {
  38. disable 'InvalidPackage'
  39. }
  40.  
  41. defaultConfig {
  42. // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  43. applicationId "########"
  44. minSdkVersion 21
  45. targetSdkVersion 28
  46. versionCode flutterVersionCode.toInteger()
  47. versionName flutterVersionName
  48. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  49. }
  50.  
  51. signingConfigs {
  52. release {
  53. keyAlias keystoreProperties['keyAlias']
  54. keyPassword keystoreProperties['keyPassword']
  55. storeFile file(keystoreProperties['storeFile'])
  56. storePassword keystoreProperties['storePassword']
  57. }
  58. }
  59. buildTypes {
  60. release {
  61. signingConfig signingConfigs.release
  62. }
  63. }
  64. }
  65.  
  66. flutter {
  67. source '../..'
  68. }
  69.  
  70. dependencies {
  71. testImplementation 'junit:junit:4.12'
  72. androidTestImplementation 'androidx.test:runner:1.1.1'
  73. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  74. // implementation 'com.google.firebase:firebase-analytics:17.2.0'
  75. }
  76. apply plugin: 'com.google.gms.google-services'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement