|
1 | 1 | plugins {
|
2 | 2 | id "com.android.application"
|
3 | 3 | id "kotlin-android"
|
| 4 | + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. |
4 | 5 | id "dev.flutter.flutter-gradle-plugin"
|
5 | 6 | }
|
6 | 7 |
|
7 |
| -def localProperties = new Properties() |
8 |
| -def localPropertiesFile = rootProject.file('local.properties') |
9 |
| -if (localPropertiesFile.exists()) { |
10 |
| - localPropertiesFile.withReader('UTF-8') { reader -> |
11 |
| - localProperties.load(reader) |
12 |
| - } |
13 |
| -} |
14 |
| - |
15 |
| -def flutterRoot = localProperties.getProperty('flutter.sdk') |
16 |
| -if (flutterRoot == null) { |
17 |
| - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") |
18 |
| -} |
19 |
| - |
20 |
| -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') |
21 |
| -if (flutterVersionCode == null) { |
22 |
| - flutterVersionCode = '1' |
23 |
| -} |
24 |
| - |
25 |
| -def flutterVersionName = localProperties.getProperty('flutter.versionName') |
26 |
| -if (flutterVersionName == null) { |
27 |
| - flutterVersionName = '1.0' |
28 |
| -} |
29 |
| - |
30 | 8 | android {
|
31 |
| - compileSdk 34 |
32 |
| - |
33 |
| - sourceSets { |
34 |
| - main.java.srcDirs += 'src/main/kotlin' |
35 |
| - } |
| 9 | + namespace = "com.deriv.example" |
| 10 | + compileSdk = 34 |
| 11 | + ndkVersion = flutter.ndkVersion |
36 | 12 |
|
37 |
| - lintOptions { |
38 |
| - disable 'InvalidPackage' |
| 13 | + compileOptions { |
| 14 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 15 | + targetCompatibility = JavaVersion.VERSION_1_8 |
39 | 16 | }
|
40 | 17 |
|
41 |
| - namespace "com.deriv.flutter_deriv_api_example" |
42 |
| - |
43 |
| - compileOptions { |
44 |
| - sourceCompatibility JavaVersion.VERSION_17 |
45 |
| - targetCompatibility JavaVersion.VERSION_17 |
| 18 | + kotlinOptions { |
| 19 | + jvmTarget = JavaVersion.VERSION_1_8 |
46 | 20 | }
|
47 | 21 |
|
48 | 22 | defaultConfig {
|
49 |
| - applicationId "com.deriv.flutter_deriv_api_example" |
50 |
| - minSdkVersion 21 |
51 |
| - targetSdkVersion 34 |
52 |
| - versionCode flutterVersionCode.toInteger() |
53 |
| - versionName flutterVersionName |
54 |
| - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| 23 | + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). |
| 24 | + applicationId = "com.deriv.example" |
| 25 | + // You can update the following values to match your application needs. |
| 26 | + // For more information, see: https://flutter.dev/to/review-gradle-config. |
| 27 | + minSdk = flutter.minSdkVersion |
| 28 | + targetSdk = flutter.targetSdkVersion |
| 29 | + versionCode = flutter.versionCode |
| 30 | + versionName = flutter.versionName |
55 | 31 | }
|
56 | 32 |
|
57 | 33 | buildTypes {
|
58 | 34 | release {
|
| 35 | + // TODO: Add your own signing config for the release build. |
59 | 36 | // Signing with the debug keys for now, so `flutter run --release` works.
|
60 |
| - signingConfig signingConfigs.debug |
| 37 | + signingConfig = signingConfigs.debug |
61 | 38 | }
|
62 | 39 | }
|
63 | 40 | }
|
64 | 41 |
|
65 | 42 | flutter {
|
66 |
| - source '../..' |
67 |
| -} |
68 |
| - |
69 |
| -dependencies { |
70 |
| - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" |
71 |
| - testImplementation 'junit:junit:4.13.2' |
72 |
| - androidTestImplementation 'androidx.test:runner:1.6.1' |
73 |
| - androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' |
| 43 | + source = "../.." |
74 | 44 | }
|
0 commit comments