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