|
| 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 = '1' |
| 18 | + flutterVersionCode = "1" |
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 = '1.0' |
| 23 | + flutterVersionName = "1.0" |
22 | 24 | } |
23 | 25 |
|
24 | | -apply plugin: 'com.android.application' |
25 | | -apply plugin: 'kotlin-android' |
26 | | -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" |
27 | | - |
28 | 26 | android { |
29 | | - namespace "com.baseflow.example" |
30 | | - compileSdkVersion 33 |
31 | | - ndkVersion flutter.ndkVersion |
| 27 | + namespace = "com.example.example" |
| 28 | + compileSdk = flutter.compileSdkVersion |
| 29 | + ndkVersion = flutter.ndkVersion |
32 | 30 |
|
33 | 31 | compileOptions { |
34 | | - sourceCompatibility JavaVersion.VERSION_1_8 |
35 | | - targetCompatibility JavaVersion.VERSION_1_8 |
36 | | - } |
37 | | - |
38 | | - kotlinOptions { |
39 | | - jvmTarget = '1.8' |
40 | | - } |
41 | | - |
42 | | - sourceSets { |
43 | | - main.java.srcDirs += 'src/main/kotlin' |
| 32 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 33 | + targetCompatibility = JavaVersion.VERSION_1_8 |
44 | 34 | } |
45 | 35 |
|
46 | 36 | defaultConfig { |
47 | | - applicationId "com.baseflow.example" |
48 | | - minSdkVersion 21 |
49 | | - targetSdkVersion 33 |
50 | | - versionCode flutterVersionCode.toInteger() |
51 | | - versionName flutterVersionName |
| 37 | + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). |
| 38 | + applicationId = "com.example.example" |
| 39 | + // You can update the following values to match your application needs. |
| 40 | + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. |
| 41 | + minSdk = flutter.minSdkVersion |
| 42 | + targetSdk = flutter.targetSdkVersion |
| 43 | + versionCode = flutterVersionCode.toInteger() |
| 44 | + versionName = flutterVersionName |
52 | 45 | } |
53 | 46 |
|
54 | 47 | buildTypes { |
55 | 48 | release { |
56 | 49 | // TODO: Add your own signing config for the release build. |
57 | 50 | // Signing with the debug keys for now, so `flutter run --release` works. |
58 | | - signingConfig signingConfigs.debug |
| 51 | + signingConfig = signingConfigs.debug |
59 | 52 | } |
60 | 53 | } |
61 | 54 | } |
62 | 55 |
|
63 | 56 | flutter { |
64 | | - source '../..' |
65 | | -} |
66 | | - |
67 | | -dependencies { |
68 | | - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" |
| 57 | + source = "../.." |
69 | 58 | } |
0 commit comments