Skip to content

Commit

Permalink
Merge branch 'update-plugins-and-examples-flutter-3.3.10' into 'main'
Browse files Browse the repository at this point in the history
Update plugin and example files to match Flutter 3.3 templates

See merge request objectbox/objectbox-dart!59
  • Loading branch information
greenrobot-team committed Dec 5, 2023
2 parents e72f03f + df3feed commit 0c8b119
Show file tree
Hide file tree
Showing 65 changed files with 217 additions and 205 deletions.
4 changes: 2 additions & 2 deletions dev-doc/packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ with a command similar to
See the [plugin-update script](../tool/plugin-update.sh). It can also be used to adapt the plugin
code files to the latest templates (note that it won't delete e.g. obsolete files).

For now, the Flutter plugin is not used (e.g. method channels), no-op versions are provided because
it is required.
For now, the Flutter plugin is only used on Android (method channels) for a backwards-compatibility
workaround. No-op versions are provided for other platforms because it is required.

Some additional notes:
* `name` from pubspec.yaml defines:
Expand Down
9 changes: 6 additions & 3 deletions dev-doc/updating-examples.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Updating Flutter examples

In the example directory delete the platform specific directories.
First, make sure to switch your Flutter SDK to the lowest version the ObjectBox packages support
(see pubspec.yaml files).

Then run `flutter create --platforms=android,ios,linux,macos,windows .` to re-create these files.
Then, in the example directory delete the platform-specific directories.

- Remove the created default test.
Then, run `flutter create --platforms=android,ios,linux,macos,windows .` to re-create these files.

Then, remove the created default test files and manually review the changes and commit what's necessary.

Check changes do not break the example in any way, make additional changes as required.

Expand Down
38 changes: 35 additions & 3 deletions flutter_libs/.metadata
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
# 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 and should not be manually edited.
# This file should be version controlled.

version:
revision: 1d9032c7e1d867f071f2277eb1673e8f9b0274e3
channel: stable
revision: 135454af32477f815a7525073027a3ff9eff1bfd
channel: unknown

project_type: plugin

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: android
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: ios
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: linux
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: macos
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: windows
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
7 changes: 4 additions & 3 deletions flutter_libs/android/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Contents of this folder is based on `flutter create --template=plugin`.
It was reduced to the minimum that works for library inclusion by client apps.
Flutter plugin for Android reduced to the minimum that works for library inclusion by client apps.
See [packaging.md](/dev-doc/packaging.md).

Notably, the package depends on `io.objectbox:objectbox-android`, a native ObjectBox library distribution.
Notably, the Android package depends on `objectbox-android`, the native ObjectBox library
distribution for Android.
4 changes: 3 additions & 1 deletion flutter_libs/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ android {
}

dependencies {
// https://search.maven.org/search?q=g:io.objectbox%20objectbox-android
// ObjectBox Android library that includes an ObjectBox C library version compatible with
// the C API binding of the ObjectBox Dart package.
// https://central.sonatype.com/search?q=g:io.objectbox%20objectbox-android
implementation "io.objectbox:objectbox-android:3.7.0"
}
}
13 changes: 8 additions & 5 deletions flutter_libs/ios/objectbox_flutter_libs.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Provides the compiled framework as released in objectbox-swift. No dart-related sources.
# Run `pod lib lint objectbox_flutter_libs.podspec' to validate before publishing.
# This package is not distributed as a CocoaPod, rather it's automatically used by Flutter when creating
# ios/{app}.podspec in client applications using objectbox-dart as a dependency.
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint objectbox_flutter_libs.podspec` to validate before publishing.
#
# Provides the compiled framework as released with objectbox-swift. No Dart-related sources.
# This package is not distributed as a CocoaPod, rather it's automatically used by Flutter when
# creating ios/{app}.podspec in client applications using objectbox-dart as a dependency.
#
Pod::Spec.new do |s|
s.name = 'objectbox_flutter_libs'
s.version = '0.0.1' # not used anywhere - official flutter plugins use the same
Expand All @@ -18,7 +22,6 @@ Pod::Spec.new do |s|

# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }

s.swift_version = '5.3'

# Fail early during build instead of not finding the library during runtime
Expand Down
12 changes: 8 additions & 4 deletions flutter_libs/macos/objectbox_flutter_libs.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Provides the compiled framework as released in objectbox-swift. No dart-related sources.
# Run `pod lib lint objectbox_flutter_libs.podspec' to validate before publishing.
# This package is not distributed as a CocoaPod, rather it's automatically used by Flutter when creating
# ios/{app}.podspec in client applications using objectbox-dart as a dependency.
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint objectbox_flutter_libs.podspec` to validate before publishing.
#
# Provides the compiled framework as released with objectbox-swift. No Dart-related sources.
# This package is not distributed as a CocoaPod, rather it's automatically used by Flutter when
# creating ios/{app}.podspec in client applications using objectbox-dart as a dependency.
#
Pod::Spec.new do |s|
s.name = 'objectbox_flutter_libs'
s.version = '0.0.1' # not used anywhere - official flutter plugins use the same
Expand Down
18 changes: 16 additions & 2 deletions flutter_libs/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ homepage: https://objectbox.io
version: 2.3.1

environment:
sdk: '>=2.14.0 <4.0.0'
flutter: ">=2.0.0"
sdk: '>=2.18.0 <4.0.0'
flutter: ">=2.5.0"

dependencies:
flutter:
Expand All @@ -20,7 +20,21 @@ dependencies:
dev_dependencies:
flutter_lints: ^2.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:
# This section identifies this Flutter project as a plugin project.
# The 'pluginClass' specifies the class (in Java, Kotlin, Swift, Objective-C, etc.)
# which should be registered in the plugin registry. This is required for
# using method channels.
# The Android 'package' specifies package in which the registered class is.
# This is required for using method channels on Android.
# The 'ffiPlugin' specifies that native code should be built and bundled.
# This is required for using `dart:ffi`.
# All these are used by the tooling to maintain consistency when
# adding or updating assets for this project.
plugin:
platforms:
android:
Expand Down
31 changes: 14 additions & 17 deletions objectbox/example/flutter/objectbox_demo/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,32 @@
# This file should be version controlled.

version:
revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
channel: stable
revision: 135454af32477f815a7525073027a3ff9eff1bfd
channel: unknown

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: android
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: ios
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: linux
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: macos
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
- platform: web
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: windows
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd

# User provided section

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package="com.example.objectbox_demo">
<application
android:label="objectbox_demo"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ PRODUCT_NAME = objectbox_demo
PRODUCT_BUNDLE_IDENTIFIER = com.example.objectboxDemo

// The copyright displayed in application information
PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved.
PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved.
5 changes: 1 addition & 4 deletions objectbox/example/flutter/objectbox_demo/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ publish_to: 'none'
version: 1.0.0+1

environment:
sdk: '>=2.14.0 <4.0.0'
sdk: ">=2.18.0 <4.0.0"

dependencies:
flutter:
Expand All @@ -16,9 +16,6 @@ dependencies:
path: ^1.8.0

dev_dependencies:
flutter_driver:
sdk: flutter
test: any # Should specify a minimum version; but we use any for easier testing of multiple SDKs.
flutter_lints: ^2.0.1
build_runner: ^2.0.0
objectbox_generator: any
Expand Down
11 changes: 0 additions & 11 deletions objectbox/example/flutter/objectbox_demo/test_driver/app.dart

This file was deleted.

34 changes: 0 additions & 34 deletions objectbox/example/flutter/objectbox_demo/test_driver/app_test.dart

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ BEGIN
VALUE "FileDescription", "objectbox_demo" "\0"
VALUE "FileVersion", VERSION_AS_STRING "\0"
VALUE "InternalName", "objectbox_demo" "\0"
VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0"
VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0"
VALUE "OriginalFilename", "objectbox_demo.exe" "\0"
VALUE "ProductName", "objectbox_demo" "\0"
VALUE "ProductVersion", VERSION_AS_STRING "\0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</application>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<!-- Windows 10 and Windows 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
Expand Down
31 changes: 14 additions & 17 deletions objectbox/example/flutter/objectbox_demo_relations/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,32 @@
# This file should be version controlled.

version:
revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
channel: stable
revision: 135454af32477f815a7525073027a3ff9eff1bfd
channel: unknown

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: android
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: ios
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: linux
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: macos
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
- platform: web
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd
- platform: windows
create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
create_revision: 135454af32477f815a7525073027a3ff9eff1bfd
base_revision: 135454af32477f815a7525073027a3ff9eff1bfd

# User provided section

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package="com.example.objectbox_demo_relations">
<application
android:label="objectbox_demo_relations"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading

0 comments on commit 0c8b119

Please sign in to comment.