From c1924512d808ee5a69b965dd6f0415f49c99f189 Mon Sep 17 00:00:00 2001 From: Uwe Date: Mon, 2 Dec 2024 13:46:00 +0100 Subject: [PATCH] Examples: apply Flutter SDK 3.16.9 upgrade to other examples --- .../example/flutter/objectbox_demo/.gitignore | 6 - .../example/flutter/objectbox_demo/.metadata | 30 +- .../objectbox_demo/analysis_options.yaml | 3 +- .../objectbox_demo/android/app/build.gradle | 35 ++- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../android/app/src/main/AndroidManifest.xml | 5 +- .../MainActivity.kt | 0 .../app/src/profile/AndroidManifest.xml | 3 +- .../objectbox_demo/android/build.gradle | 3 +- .../objectbox_demo/android/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../objectbox_demo/android/settings.gradle | 34 ++- .../ios/Flutter/AppFrameworkInfo.plist | 2 +- .../flutter/objectbox_demo/ios/Podfile | 3 + .../ios/Runner.xcodeproj/project.pbxproj | 259 +++++++++++++++--- .../xcshareddata/xcschemes/Runner.xcscheme | 13 +- .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin 564 -> 295 bytes .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin 1283 -> 406 bytes .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin 1588 -> 450 bytes .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin 1025 -> 282 bytes .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin 1716 -> 462 bytes .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin 1920 -> 704 bytes .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin 1283 -> 406 bytes .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin 1895 -> 586 bytes .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin 2665 -> 862 bytes .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin 2665 -> 862 bytes .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin 3831 -> 1674 bytes .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin 1888 -> 762 bytes .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin 3294 -> 1226 bytes .../Icon-App-83.5x83.5@2x.png | Bin 3612 -> 1418 bytes .../objectbox_demo/ios/Runner/Info.plist | 2 - .../ios/RunnerTests/RunnerTests.swift | 12 + .../objectbox_demo/linux/CMakeLists.txt | 7 + .../flutter/objectbox_demo/macos/Podfile | 3 + .../macos/Runner.xcodeproj/project.pbxproj | 212 ++++++++++++-- .../xcshareddata/xcschemes/Runner.xcscheme | 13 +- .../macos/Runner/Configs/AppInfo.xcconfig | 2 +- .../macos/Runner/MainFlutterWindow.swift | 2 +- .../macos/RunnerTests/RunnerTests.swift | 12 + .../flutter/objectbox_demo/pubspec.yaml | 2 +- .../objectbox_demo/windows/CMakeLists.txt | 9 +- .../windows/flutter/CMakeLists.txt | 7 +- .../windows/runner/CMakeLists.txt | 1 + .../objectbox_demo/windows/runner/Runner.rc | 2 +- .../windows/runner/flutter_window.cpp | 10 + .../objectbox_demo/windows/runner/main.cpp | 2 +- .../objectbox_demo/windows/runner/utils.cpp | 9 +- .../windows/runner/win32_window.cpp | 55 +++- .../windows/runner/win32_window.h | 20 +- 49 files changed, 628 insertions(+), 157 deletions(-) rename objectbox/example/flutter/objectbox_demo/android/app/src/main/kotlin/com/example/{objectbox_demo => objectbox_demo_relations}/MainActivity.kt (100%) create mode 100644 objectbox/example/flutter/objectbox_demo/ios/RunnerTests/RunnerTests.swift create mode 100644 objectbox/example/flutter/objectbox_demo/macos/RunnerTests/RunnerTests.swift diff --git a/objectbox/example/flutter/objectbox_demo/.gitignore b/objectbox/example/flutter/objectbox_demo/.gitignore index 30378e1a7..da6e72113 100644 --- a/objectbox/example/flutter/objectbox_demo/.gitignore +++ b/objectbox/example/flutter/objectbox_demo/.gitignore @@ -27,14 +27,10 @@ migrate_working_dir/ .dart_tool/ .flutter-plugins .flutter-plugins-dependencies -.packages .pub-cache/ .pub/ /build/ -# Web related -lib/generated_plugin_registrant.dart - # Symbolication related app.*.symbols @@ -46,8 +42,6 @@ app.*.map.json /android/app/profile /android/app/release -objectbox - # Not checking in Podfile.lock to avoid updating it for every # ObjectBox release and to always build with latest dependencies on CI. ios/Podfile.lock diff --git a/objectbox/example/flutter/objectbox_demo/.metadata b/objectbox/example/flutter/objectbox_demo/.metadata index 89866adfa..ef4bc2c73 100644 --- a/objectbox/example/flutter/objectbox_demo/.metadata +++ b/objectbox/example/flutter/objectbox_demo/.metadata @@ -1,11 +1,11 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled. +# This file should be version controlled and should not be manually edited. version: - revision: 135454af32477f815a7525073027a3ff9eff1bfd - channel: unknown + revision: "41456452f29d64e8deb623a3c927524bcf9f111b" + channel: "[user-branch]" project_type: app @@ -13,23 +13,23 @@ project_type: app migration: platforms: - platform: root - create_revision: 135454af32477f815a7525073027a3ff9eff1bfd - base_revision: 135454af32477f815a7525073027a3ff9eff1bfd + create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b - platform: android - create_revision: 135454af32477f815a7525073027a3ff9eff1bfd - base_revision: 135454af32477f815a7525073027a3ff9eff1bfd + create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b - platform: ios - create_revision: 135454af32477f815a7525073027a3ff9eff1bfd - base_revision: 135454af32477f815a7525073027a3ff9eff1bfd + create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b - platform: linux - create_revision: 135454af32477f815a7525073027a3ff9eff1bfd - base_revision: 135454af32477f815a7525073027a3ff9eff1bfd + create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b - platform: macos - create_revision: 135454af32477f815a7525073027a3ff9eff1bfd - base_revision: 135454af32477f815a7525073027a3ff9eff1bfd + create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b - platform: windows - create_revision: 135454af32477f815a7525073027a3ff9eff1bfd - base_revision: 135454af32477f815a7525073027a3ff9eff1bfd + create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b + base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b # User provided section diff --git a/objectbox/example/flutter/objectbox_demo/analysis_options.yaml b/objectbox/example/flutter/objectbox_demo/analysis_options.yaml index 61b6c4de1..0d2902135 100644 --- a/objectbox/example/flutter/objectbox_demo/analysis_options.yaml +++ b/objectbox/example/flutter/objectbox_demo/analysis_options.yaml @@ -13,8 +13,7 @@ linter: # The lint rules applied to this project can be customized in the # section below to disable rules from the `package:flutter_lints/flutter.yaml` # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. + # and their documentation is published at https://dart.dev/lints. # # Instead of disabling a lint rule for the entire project in the # section below, it can also be suppressed for a single line of code diff --git a/objectbox/example/flutter/objectbox_demo/android/app/build.gradle b/objectbox/example/flutter/objectbox_demo/android/app/build.gradle index 136b9f09c..74dcf441c 100644 --- a/objectbox/example/flutter/objectbox_demo/android/app/build.gradle +++ b/objectbox/example/flutter/objectbox_demo/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -21,13 +22,19 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { - compileSdkVersion flutter.compileSdkVersion - ndkVersion flutter.ndkVersion + namespace "com.example.objectbox_demo" + // compileSdkVersion flutter.compileSdkVersion + // Set compileSdkVersion 34 for path_provider_android plugin; + // this can be removed once minimum tested Flutter version is 3.19.0. + compileSdkVersion 34 + // ndkVersion flutter.ndkVersion + // Flutter defaults to NDK 23.1.7779620, but + // - objectbox_flutter_libs requires Android NDK 25.1.8937393 + // - path_provider_android requires Android NDK 25.1.8937393 + // Until Flutter uses a newer version (https://github.com/flutter/flutter/commit/919bed6e0a18bd5b76fb581ede10121f8c14a6f7) + // manually set the required one: + ndkVersion = "25.1.8937393" compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -45,9 +52,8 @@ android { defaultConfig { applicationId "com.example.objectbox_demo" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. - // minSdkVersion flutter.minSdkVersion - minSdkVersion 19 // ObjectBox requires at least SDK 19 (Android 4.4) + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName @@ -67,5 +73,4 @@ flutter { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } diff --git a/objectbox/example/flutter/objectbox_demo/android/app/src/debug/AndroidManifest.xml b/objectbox/example/flutter/objectbox_demo/android/app/src/debug/AndroidManifest.xml index 0357bd34b..399f6981d 100644 --- a/objectbox/example/flutter/objectbox_demo/android/app/src/debug/AndroidManifest.xml +++ b/objectbox/example/flutter/objectbox_demo/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - +