|
| 1 | +plugins { |
| 2 | + id "com.android.application" |
| 3 | + id "kotlin-android" |
| 4 | + id "dev.flutter.flutter-gradle-plugin" |
| 5 | +} |
| 6 | + |
1 | 7 | def localProperties = new Properties()
|
2 | 8 | def localPropertiesFile = rootProject.file('local.properties')
|
3 | 9 | if (localPropertiesFile.exists()) {
|
4 |
| - localPropertiesFile.withReader('UTF-8') { reader -> |
5 |
| - localProperties.load(reader) |
6 |
| - } |
7 |
| -} |
8 |
| - |
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.") |
| 10 | + localPropertiesFile.withReader('UTF-8') { reader -> |
| 11 | + localProperties.load(reader) |
| 12 | + } |
12 | 13 | }
|
13 | 14 |
|
14 | 15 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
15 | 16 | if (flutterVersionCode == null) {
|
16 |
| - flutterVersionCode = '1' |
| 17 | + flutterVersionCode = '1' |
17 | 18 | }
|
18 | 19 |
|
19 | 20 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
20 | 21 | if (flutterVersionName == null) {
|
21 |
| - flutterVersionName = '1.0' |
| 22 | + flutterVersionName = '1.0' |
22 | 23 | }
|
23 | 24 |
|
24 |
| -apply plugin: 'com.android.application' |
25 |
| -apply plugin: 'kotlin-android' |
26 |
| -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" |
27 |
| - |
28 | 25 | android {
|
29 |
| - compileSdk 34 |
| 26 | + compileSdk 34 |
30 | 27 |
|
31 |
| - namespace 'io.maido.intercomexample' |
| 28 | + namespace 'io.maido.intercomexample' |
32 | 29 |
|
33 |
| - sourceSets { |
34 |
| - main.java.srcDirs += 'src/main/kotlin' |
35 |
| - } |
| 30 | + sourceSets { |
| 31 | + main.java.srcDirs += 'src/main/kotlin' |
| 32 | + } |
36 | 33 |
|
37 |
| - lintOptions { |
38 |
| - disable 'InvalidPackage' |
39 |
| - } |
40 | 34 |
|
41 |
| - defaultConfig { |
42 |
| - applicationId "io.maido.intercomexample" |
43 |
| - minSdk 21 |
44 |
| - targetSdk 34 |
45 |
| - versionCode flutterVersionCode.toInteger() |
46 |
| - versionName flutterVersionName |
47 |
| - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
48 |
| - } |
| 35 | + defaultConfig { |
| 36 | + applicationId "io.maido.intercomexample" |
| 37 | + minSdk 21 |
| 38 | + targetSdk 34 |
| 39 | + versionCode flutterVersionCode.toInteger() |
| 40 | + versionName flutterVersionName |
| 41 | + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| 42 | + } |
49 | 43 |
|
50 |
| - buildTypes { |
51 |
| - release { |
52 |
| - signingConfig signingConfigs.debug |
53 |
| - } |
| 44 | + buildTypes { |
| 45 | + release { |
| 46 | + signingConfig signingConfigs.debug |
54 | 47 | }
|
| 48 | + } |
55 | 49 |
|
56 |
| - compileOptions { |
57 |
| - sourceCompatibility JavaVersion.VERSION_1_8 |
58 |
| - targetCompatibility JavaVersion.VERSION_1_8 |
59 |
| - } |
| 50 | + compileOptions { |
| 51 | + sourceCompatibility JavaVersion.VERSION_1_8 |
| 52 | + targetCompatibility JavaVersion.VERSION_1_8 |
| 53 | + } |
60 | 54 |
|
61 |
| - kotlinOptions { |
62 |
| - jvmTarget = '1.8' |
63 |
| - } |
64 |
| -} |
| 55 | + kotlinOptions { |
| 56 | + jvmTarget = '1.8' |
| 57 | + } |
65 | 58 |
|
66 |
| -flutter { |
67 |
| - source '../..' |
| 59 | + lint { |
| 60 | + disable 'InvalidPackage' |
| 61 | + } |
68 | 62 | }
|
69 | 63 |
|
70 |
| -dependencies { |
71 |
| - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" |
| 64 | +flutter { |
| 65 | + source '../..' |
72 | 66 | }
|
0 commit comments