|
1 | | -def localProperties = new Properties() |
2 | | -def localPropertiesFile = rootProject.file('local.properties') |
3 | | -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.") |
12 | | -} |
13 | | - |
14 | | -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') |
15 | | -if (flutterVersionCode == null) { |
16 | | - flutterVersionCode = '1' |
17 | | -} |
18 | | - |
19 | | -def flutterVersionName = localProperties.getProperty('flutter.versionName') |
20 | | -if (flutterVersionName == null) { |
21 | | - flutterVersionName = '1.0' |
| 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" |
22 | 6 | } |
23 | 7 |
|
24 | | -apply plugin: 'com.android.application' |
25 | | -apply plugin: 'kotlin-android' |
26 | | -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" |
27 | | - |
| 8 | +// flutter. variables commented for backwards compatibility with Flutter 3.16 and 3.19. |
28 | 9 | android { |
29 | | - compileSdkVersion 34 |
30 | | - |
31 | | - namespace 'com.xraph.plugin.flutter_unity_widget_example' |
| 10 | + namespace = "com.xraph.plugin.flutter_unity_widget_example" |
| 11 | + compileSdk = 34 // flutter.compileSdkVersion |
| 12 | + // ndkVersion = flutter.ndkVersion |
32 | 13 |
|
33 | | - sourceSets { |
34 | | - main.java.srcDirs += 'src/main/kotlin' |
| 14 | + compileOptions { |
| 15 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 16 | + targetCompatibility = JavaVersion.VERSION_1_8 |
35 | 17 | } |
36 | 18 |
|
37 | | - lintOptions { |
38 | | - disable 'InvalidPackage' |
| 19 | + kotlinOptions { |
| 20 | + // if you change this value, also change it in android/build.gradle subprojects{} |
| 21 | + jvmTarget = JavaVersion.VERSION_1_8 |
39 | 22 | } |
40 | 23 |
|
41 | 24 | defaultConfig { |
42 | | - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). |
43 | | - applicationId "com.xraph.plugin.flutter_unity_widget_example" |
44 | | - minSdkVersion 28 // >= unity minSdk in player settings |
45 | | - targetSdkVersion 34 |
46 | | - versionCode flutterVersionCode.toInteger() |
47 | | - versionName flutterVersionName |
| 25 | + applicationId = "com.xraph.plugin.flutter_unity_widget_example" |
| 26 | + // You can update the following values to match your application needs. |
| 27 | + // For more information, see: https://flutter.dev/to/review-gradle-config. |
| 28 | + minSdk = 24 // flutter.minSdkVersion |
| 29 | + targetSdk = 34 // flutter.targetSdkVersion |
| 30 | + versionCode = 1 // flutter.versionCode |
| 31 | + versionName = "1.0.0" // flutter.versionName |
48 | 32 | } |
49 | 33 |
|
50 | 34 | buildTypes { |
51 | 35 | release { |
52 | 36 | // TODO: Add your own signing config for the release build. |
53 | 37 | // Signing with the debug keys for now, so `flutter run --release` works. |
54 | | - signingConfig signingConfigs.debug |
| 38 | + signingConfig = signingConfigs.debug |
55 | 39 | } |
56 | 40 | } |
57 | 41 | } |
58 | 42 |
|
59 | 43 | flutter { |
60 | | - source '../..' |
| 44 | + source = "../.." |
61 | 45 | } |
62 | 46 |
|
63 | 47 | dependencies { |
64 | 48 | implementation project(':unityLibrary') |
65 | 49 | implementation project(':flutter_unity_widget') |
66 | | - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" |
67 | 50 | } |
0 commit comments