|
| 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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" |
26 | | - |
27 | 26 | android { |
28 | | - compileSdkVersion 33 |
| 27 | + namespace = "com.example.example" |
| 28 | + compileSdk = flutter.compileSdkVersion |
| 29 | + ndkVersion = flutter.ndkVersion |
29 | 30 |
|
30 | | - lintOptions { |
31 | | - disable 'InvalidPackage' |
| 31 | + compileOptions { |
| 32 | + sourceCompatibility = JavaVersion.VERSION_17 |
| 33 | + targetCompatibility = JavaVersion.VERSION_17 |
32 | 34 | } |
33 | 35 |
|
34 | 36 | defaultConfig { |
35 | 37 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). |
36 | | - applicationId "com.example.flutterhsvcolorpickerexample" |
37 | | - minSdkVersion flutter.minSdkVersion |
38 | | - targetSdkVersion 30 |
39 | | - versionCode flutterVersionCode.toInteger() |
40 | | - versionName flutterVersionName |
41 | | - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
| 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 |
42 | 45 | } |
43 | 46 |
|
44 | 47 | buildTypes { |
45 | 48 | release { |
46 | 49 | // TODO: Add your own signing config for the release build. |
47 | 50 | // Signing with the debug keys for now, so `flutter run --release` works. |
48 | | - signingConfig signingConfigs.debug |
| 51 | + signingConfig = signingConfigs.debug |
49 | 52 | } |
50 | 53 | } |
51 | 54 | } |
52 | 55 |
|
53 | 56 | flutter { |
54 | | - source '../..' |
55 | | -} |
56 | | - |
57 | | -dependencies { |
58 | | - testImplementation 'junit:junit:4.13.2' |
59 | | - androidTestImplementation 'com.android.support.test:runner:1.0.2' |
60 | | - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' |
| 57 | + source = "../.." |
61 | 58 | } |
0 commit comments