|
| 1 | +plugins { |
| 2 | + id "com.android.application" |
| 3 | + // START: FlutterFire Configuration |
| 4 | + id 'com.google.gms.google-services' |
| 5 | + // END: FlutterFire Configuration |
| 6 | + id "kotlin-android" |
| 7 | + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. |
| 8 | + id "dev.flutter.flutter-gradle-plugin" |
| 9 | +} |
| 10 | + |
1 | 11 | def localProperties = new Properties() |
2 | | -def localPropertiesFile = rootProject.file('local.properties') |
| 12 | +def localPropertiesFile = rootProject.file("local.properties") |
3 | 13 | if (localPropertiesFile.exists()) { |
4 | | - localPropertiesFile.withReader('UTF-8') { reader -> |
| 14 | + localPropertiesFile.withReader("UTF-8") { reader -> |
5 | 15 | localProperties.load(reader) |
6 | 16 | } |
7 | 17 | } |
8 | 18 |
|
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') |
| 19 | +def flutterVersionCode = localProperties.getProperty("flutter.versionCode") |
15 | 20 | if (flutterVersionCode == null) { |
16 | | - flutterVersionCode = '1' |
| 21 | + flutterVersionCode = "1" |
17 | 22 | } |
18 | 23 |
|
19 | | -def flutterVersionName = localProperties.getProperty('flutter.versionName') |
| 24 | +def flutterVersionName = localProperties.getProperty("flutter.versionName") |
20 | 25 | if (flutterVersionName == null) { |
21 | | - flutterVersionName = '1.0' |
| 26 | + flutterVersionName = "1.0" |
22 | 27 | } |
23 | 28 |
|
24 | | -apply plugin: 'com.android.application' |
25 | | -// START: FlutterFire Configuration |
26 | | -apply plugin: 'com.google.gms.google-services' |
27 | | -// END: FlutterFire Configuration |
28 | | -apply plugin: 'kotlin-android' |
29 | | -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" |
30 | | - |
31 | 29 | android { |
32 | | - namespace "com.example" |
33 | | - compileSdkVersion flutter.compileSdkVersion |
34 | | - ndkVersion flutter.ndkVersion |
| 30 | + namespace = "com.example" |
| 31 | + compileSdk = flutter.compileSdkVersion |
| 32 | + ndkVersion = flutter.ndkVersion |
35 | 33 |
|
36 | 34 | compileOptions { |
37 | | - sourceCompatibility JavaVersion.VERSION_1_8 |
38 | | - targetCompatibility JavaVersion.VERSION_1_8 |
39 | | - } |
40 | | - |
41 | | - kotlinOptions { |
42 | | - jvmTarget = '1.8' |
43 | | - } |
44 | | - |
45 | | - sourceSets { |
46 | | - main.java.srcDirs += 'src/main/kotlin' |
| 35 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 36 | + targetCompatibility = JavaVersion.VERSION_1_8 |
47 | 37 | } |
48 | 38 |
|
49 | 39 | defaultConfig { |
50 | 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). |
51 | | - applicationId "com.example" |
| 41 | + applicationId = "com.example" |
52 | 42 | // You can update the following values to match your application needs. |
53 | 43 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. |
54 | | - minSdkVersion 19 |
55 | | - targetSdkVersion flutter.targetSdkVersion |
56 | | - multiDexEnabled true |
57 | | - versionCode flutterVersionCode.toInteger() |
58 | | - versionName flutterVersionName |
| 44 | + minSdk = 23 |
| 45 | + targetSdk = flutter.targetSdkVersion |
| 46 | + versionCode = flutterVersionCode.toInteger() |
| 47 | + versionName = flutterVersionName |
59 | 48 | } |
60 | 49 |
|
61 | 50 | buildTypes { |
62 | 51 | release { |
63 | 52 | // TODO: Add your own signing config for the release build. |
64 | 53 | // Signing with the debug keys for now, so `flutter run --release` works. |
65 | | - signingConfig signingConfigs.debug |
| 54 | + signingConfig = signingConfigs.debug |
66 | 55 | } |
67 | 56 | } |
68 | 57 | } |
69 | 58 |
|
70 | 59 | flutter { |
71 | | - source '../..' |
72 | | -} |
73 | | - |
74 | | -dependencies { |
75 | | - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" |
76 | | - implementation 'com.android.support:multidex:1.0.3' |
| 60 | + source = "../.." |
77 | 61 | } |
0 commit comments