|
| 1 | +plugins { |
| 2 | + id "com.android.application" |
| 3 | + id "kotlin-android" |
| 4 | + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. |
| 5 | + id "dev.flutter.flutter-gradle-plugin" |
| 6 | +} |
| 7 | + |
1 | 8 | def localProperties = new Properties()
|
2 |
| -def localPropertiesFile = rootProject.file('local.properties') |
| 9 | +def localPropertiesFile = rootProject.file("local.properties") |
3 | 10 | if (localPropertiesFile.exists()) {
|
4 |
| - localPropertiesFile.withReader('UTF-8') { reader -> |
| 11 | + localPropertiesFile.withReader("UTF-8") { reader -> |
5 | 12 | localProperties.load(reader)
|
6 | 13 | }
|
7 | 14 | }
|
8 | 15 |
|
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') |
| 16 | +def flutterVersionCode = localProperties.getProperty("flutter.versionCode") |
15 | 17 | if (flutterVersionCode == null) {
|
16 |
| - flutterVersionCode = '9' |
| 18 | + flutterVersionCode = "9" |
17 | 19 | }
|
18 | 20 |
|
19 |
| -def flutterVersionName = localProperties.getProperty('flutter.versionName') |
| 21 | +def flutterVersionName = localProperties.getProperty("flutter.versionName") |
20 | 22 | if (flutterVersionName == null) {
|
21 |
| - flutterVersionName = '9.0.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 |
| - |
28 |
| -def keystoreProperties = new Properties() |
29 |
| -def keystorePropertiesFile = rootProject.file('key.properties') |
30 |
| -if (keystorePropertiesFile.exists()) { |
31 |
| - keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) |
| 23 | + flutterVersionName = "9.0" |
32 | 24 | }
|
33 | 25 |
|
34 | 26 | android {
|
35 |
| - compileSdkVersion rootProject.ext.compileSdkVersion |
36 |
| - |
37 |
| - defaultConfig { |
38 |
| - multiDexEnabled true |
39 |
| - } |
| 27 | + namespace = "dev.jaffaketchup.fmtc.demo" |
| 28 | + compileSdk = flutter.compileSdkVersion |
| 29 | + ndkVersion = flutter.ndkVersion |
40 | 30 |
|
41 | 31 | compileOptions {
|
42 |
| - coreLibraryDesugaringEnabled true |
43 |
| - sourceCompatibility JavaVersion.VERSION_1_8 |
44 |
| - targetCompatibility JavaVersion.VERSION_1_8 |
45 |
| - } |
46 |
| - |
47 |
| - kotlinOptions { |
48 |
| - jvmTarget = '1.8' |
49 |
| - } |
50 |
| - |
51 |
| - sourceSets { |
52 |
| - main.java.srcDirs += 'src/main/kotlin' |
| 32 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 33 | + targetCompatibility = JavaVersion.VERSION_1_8 |
53 | 34 | }
|
54 | 35 |
|
55 | 36 | defaultConfig {
|
56 |
| - applicationId "dev.jaffaketchup.fmtc.demo" |
57 |
| - minSdkVersion rootProject.ext.minSdkVersion |
58 |
| - targetSdkVersion rootProject.ext.targetSdkVersion |
59 |
| - versionCode flutterVersionCode.toInteger() |
60 |
| - versionName flutterVersionName |
| 37 | + applicationId = "dev.jaffaketchup.fmtc.demo" |
| 38 | + minSdk = flutter.minSdkVersion |
| 39 | + targetSdk = flutter.targetSdkVersion |
| 40 | + versionCode = flutterVersionCode.toInteger() |
| 41 | + versionName = flutterVersionName |
61 | 42 | }
|
62 | 43 |
|
63 | 44 | buildTypes {
|
64 | 45 | release {
|
65 |
| - signingConfig signingConfigs.debug |
| 46 | + signingConfig = signingConfigs.debug |
66 | 47 | }
|
67 | 48 | }
|
68 | 49 | }
|
69 | 50 |
|
70 | 51 | flutter {
|
71 |
| - source '../..' |
72 |
| -} |
73 |
| - |
74 |
| -dependencies { |
75 |
| - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" |
76 |
| - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' |
| 52 | + source = "../.." |
77 | 53 | }
|
0 commit comments