From 2fdf3e774e2d39ba547185d2418ba93f4f7512fd Mon Sep 17 00:00:00 2001 From: Uwe Date: Mon, 25 Nov 2024 14:45:56 +0100 Subject: [PATCH 01/16] Relations demo: update Gradle [7.4 -> 8.5] to support JDK 21 #127 --- .../android/gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/objectbox/example/flutter/objectbox_demo_relations/android/gradle/wrapper/gradle-wrapper.properties b/objectbox/example/flutter/objectbox_demo_relations/android/gradle/wrapper/gradle-wrapper.properties index cb24abda1..d0d403e27 100644 --- a/objectbox/example/flutter/objectbox_demo_relations/android/gradle/wrapper/gradle-wrapper.properties +++ b/objectbox/example/flutter/objectbox_demo_relations/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip From 52d5a02687af9a48d4ebae2f18fd184ad33c7f70 Mon Sep 17 00:00:00 2001 From: Uwe Date: Tue, 26 Nov 2024 14:44:53 +0100 Subject: [PATCH 02/16] Relations demo: re-generate with Flutter SDK 3.16.9 #127 At least Flutter SDK 3.7.12: This matches what can be built by CI due to dependency constraints, so is the lowest version users could possibly be using. At least Flutter SDK 3.13.9: required to upgrade to Android Gradle Plugin 8.2.1 (to support JDK 21) which requires using the namespace property. At least Flutter SDK 3.16.9: required to apply Flutter plugin using plugins block, which is required to do further changes to support JDK 21. --- .../objectbox_demo_relations/.gitignore | 4 - .../objectbox_demo_relations/.metadata | 30 +-- .../analysis_options.yaml | 3 +- .../android/app/build.gradle | 18 +- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../android/app/src/main/AndroidManifest.xml | 5 +- .../app/src/profile/AndroidManifest.xml | 3 +- .../android/build.gradle | 3 +- .../android/gradle.properties | 2 +- .../android/settings.gradle | 34 ++- .../ios/Flutter/AppFrameworkInfo.plist | 2 +- .../objectbox_demo_relations/ios/Podfile | 3 + .../ios/Runner.xcodeproj/project.pbxproj | 233 +++++++++++++++--- .../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 .../ios/Runner/Info.plist | 2 - .../ios/RunnerTests/RunnerTests.swift | 12 + .../linux/CMakeLists.txt | 7 + .../objectbox_demo_relations/macos/Podfile | 3 + .../macos/Runner.xcodeproj/project.pbxproj | 220 ++++++++++++++--- .../xcshareddata/xcschemes/Runner.xcscheme | 13 +- .../macos/Runner/Configs/AppInfo.xcconfig | 2 +- .../macos/Runner/MainFlutterWindow.swift | 2 +- .../macos/RunnerTests/RunnerTests.swift | 12 + .../objectbox_demo_relations/pubspec.yaml | 2 +- .../windows/CMakeLists.txt | 9 +- .../windows/flutter/CMakeLists.txt | 7 +- .../windows/runner/CMakeLists.txt | 1 + .../windows/runner/Runner.rc | 2 +- .../windows/runner/flutter_window.cpp | 10 + .../windows/runner/main.cpp | 2 +- .../windows/runner/utils.cpp | 9 +- .../windows/runner/win32_window.cpp | 55 ++++- .../windows/runner/win32_window.h | 20 +- 47 files changed, 605 insertions(+), 141 deletions(-) create mode 100644 objectbox/example/flutter/objectbox_demo_relations/ios/RunnerTests/RunnerTests.swift create mode 100644 objectbox/example/flutter/objectbox_demo_relations/macos/RunnerTests/RunnerTests.swift diff --git a/objectbox/example/flutter/objectbox_demo_relations/.gitignore b/objectbox/example/flutter/objectbox_demo_relations/.gitignore index fee68cc7b..da6e72113 100644 --- a/objectbox/example/flutter/objectbox_demo_relations/.gitignore +++ b/objectbox/example/flutter/objectbox_demo_relations/.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 diff --git a/objectbox/example/flutter/objectbox_demo_relations/.metadata b/objectbox/example/flutter/objectbox_demo_relations/.metadata index 89866adfa..ef4bc2c73 100644 --- a/objectbox/example/flutter/objectbox_demo_relations/.metadata +++ b/objectbox/example/flutter/objectbox_demo_relations/.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_relations/analysis_options.yaml b/objectbox/example/flutter/objectbox_demo_relations/analysis_options.yaml index 61b6c4de1..0d2902135 100644 --- a/objectbox/example/flutter/objectbox_demo_relations/analysis_options.yaml +++ b/objectbox/example/flutter/objectbox_demo_relations/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_relations/android/app/build.gradle b/objectbox/example/flutter/objectbox_demo_relations/android/app/build.gradle index 0c1717327..b28e68d69 100644 --- a/objectbox/example/flutter/objectbox_demo_relations/android/app/build.gradle +++ b/objectbox/example/flutter/objectbox_demo_relations/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,11 +22,8 @@ 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 { + namespace "com.example.objectbox_demo_relations" compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion @@ -76,8 +74,6 @@ configurations { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - // Optional: add ObjectBox Admin - https://docs.objectbox.io/data-browser // Add the Android library with ObjectBox Admin only for debug builds. // Note: when the objectbox package updates, check if the Android diff --git a/objectbox/example/flutter/objectbox_demo_relations/android/app/src/debug/AndroidManifest.xml b/objectbox/example/flutter/objectbox_demo_relations/android/app/src/debug/AndroidManifest.xml index 6dadcd9ba..399f6981d 100644 --- a/objectbox/example/flutter/objectbox_demo_relations/android/app/src/debug/AndroidManifest.xml +++ b/objectbox/example/flutter/objectbox_demo_relations/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - +