From 3d0cb69aa4e90cf724d479fd5009b22660b37fbd Mon Sep 17 00:00:00 2001 From: guoling Date: Thu, 20 Apr 2023 16:20:11 +0800 Subject: [PATCH] prepare for v1.2.16 --- Android/MMKV/gradle.properties | 2 +- Android/MMKV/mmkvdemo/build.gradle | 6 ++-- CHANGELOG.md | 19 ++++++++++ Core/MMKVPredef.h | 2 +- flutter/CHANGELOG.md | 8 +++++ flutter/README.md | 6 ++-- flutter/example/ios/Podfile.lock | 6 ++-- .../ios/Runner.xcodeproj/project.pbxproj | 11 ++++++ flutter/example/lib/main.dart | 14 ++++---- flutter/example/pubspec.lock | 31 +++++++++------- flutter/lib/mmkv.dart | 1 + flutter/pubspec.lock | 35 +++++++++++-------- flutter/pubspec.yaml | 2 +- iOS/MMKV/MMKV.xcodeproj/project.pbxproj | 12 +++---- 14 files changed, 104 insertions(+), 51 deletions(-) diff --git a/Android/MMKV/gradle.properties b/Android/MMKV/gradle.properties index e6a93ba9..50b7c023 100644 --- a/Android/MMKV/gradle.properties +++ b/Android/MMKV/gradle.properties @@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xmx1536m # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -VERSION_NAME_PREFIX=1.2.15 +VERSION_NAME_PREFIX=1.2.16 #VERSION_NAME_SUFFIX=-SNAPSHOT VERSION_NAME_SUFFIX= diff --git a/Android/MMKV/mmkvdemo/build.gradle b/Android/MMKV/mmkvdemo/build.gradle index 7189b441..e50030d2 100644 --- a/Android/MMKV/mmkvdemo/build.gradle +++ b/Android/MMKV/mmkvdemo/build.gradle @@ -76,9 +76,9 @@ repositories { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation project(':mmkv') -// implementation 'com.tencent:mmkv:1.2.15' -// implementation 'com.tencent:mmkv-static:1.2.15' // this is identical to 'com.tencent:mmkv' -// implementation 'com.tencent:mmkv-shared:1.2.15' +// implementation 'com.tencent:mmkv:1.2.16' +// implementation 'com.tencent:mmkv-static:1.2.16' // this is identical to 'com.tencent:mmkv' +// implementation 'com.tencent:mmkv-shared:1.2.16' implementation 'androidx.appcompat:appcompat:1.6.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' testImplementation 'junit:junit:4.13.2' diff --git a/CHANGELOG.md b/CHANGELOG.md index 02ab943a..7fd57e41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # MMKV Change Log +## v1.2.16 / 2023-04-20 +### Changes for All platforms +* Optimization: The actual file content is lazy loaded now, saving time on MMKV instance creation, and avoiding lock waiting when a lot of instances are created at the same time. +* Fix a bug when restoring a loaded MMKV instance the meta file might mistakenly report corrupted. + +### Android +* Optimization: Remove unnecessary binder call on main process instantiation. + +### Flutter +* Fix a crash on decoding an empty list. +* Remove deprecated dependence. +* Make the script more robust to fix the iOS Flutter plugin name. + +### Win32 +* Fix a string format bug on the MinGW64 environment. + +### golang +* Fix a build error on 32-bit OS. + ## v1.2.15 / 2023-01-12 ### Changes for All platforms * Log handler now handles all logs from the very beginning, especially the logs in initialization. diff --git a/Core/MMKVPredef.h b/Core/MMKVPredef.h index f90ce129..1fa1b683 100755 --- a/Core/MMKVPredef.h +++ b/Core/MMKVPredef.h @@ -34,7 +34,7 @@ #include #include -constexpr auto MMKV_VERSION = "v1.2.15"; +constexpr auto MMKV_VERSION = "v1.2.16"; #ifdef DEBUG # define MMKV_DEBUG diff --git a/flutter/CHANGELOG.md b/flutter/CHANGELOG.md index ae826131..86cfc368 100644 --- a/flutter/CHANGELOG.md +++ b/flutter/CHANGELOG.md @@ -1,5 +1,13 @@ # MMKV for Flutter Change Log +## v1.2.17 / 2023-04-20 +* Optimization: The actual file content is lazy loaded now, saving time on MMKV instance creation, and avoiding lock waiting when a lot of instances are created at the same time. +* Fix a bug when restoring a loaded MMKV instance the meta file might mistakenly report corrupted. +* Fix a crash on decoding an empty list. +* Remove deprecated dependence. +* Make the script more robust to fix the iOS Flutter plugin name. +* Keep up with MMKV native lib v1.2.16. + ## v1.2.16 / 2023-01-12 * Reduce the privacy info needed to obtain android sdkInt, avoid unnecessary risk on Android App Review. * Log handler now handles all logs from the very beginning, especially the logs in initialization. diff --git a/flutter/README.md b/flutter/README.md index 18c4aa2c..4c0d647f 100644 --- a/flutter/README.md +++ b/flutter/README.md @@ -1,6 +1,6 @@ [![license](https://img.shields.io/badge/license-BSD_3-brightgreen.svg?style=flat)](https://github.com/Tencent/MMKV/blob/master/LICENSE.TXT) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/MMKV/pulls) -[![Release Version](https://img.shields.io/badge/release-1.2.16-brightgreen.svg)](https://github.com/Tencent/MMKV/releases) +[![Release Version](https://img.shields.io/badge/release-1.2.17-brightgreen.svg)](https://github.com/Tencent/MMKV/releases) [![Platform](https://img.shields.io/badge/Platform-%20Android%20%7C%20iOS-brightgreen.svg)](https://github.com/Tencent/MMKV/wiki/home) MMKV is an **efficient**, **small**, **easy-to-use** mobile key-value storage framework used in the WeChat application. It's currently available on **Android** and **iOS**. @@ -26,11 +26,11 @@ Add the following lines to `pubspec.yaml` on your app module. Then run `flutter ```yaml dependencies: - mmkv: ">=1.2.16" + mmkv: ">=1.2.17" ... ``` -If you already include MMKV native lib in your App, you need to upgrade to version newer than v1.2.15. +If you already include MMKV native lib in your App, you need to upgrade to version newer than v1.2.16. #### iOS To avoid conflict of the native lib name 'libMMKV.so' on iOS, we need to **change the plugin name 'mmkv' to 'mmkvflutter'**. diff --git a/flutter/example/ios/Podfile.lock b/flutter/example/ios/Podfile.lock index 7ad5eb62..bbd5eb62 100644 --- a/flutter/example/ios/Podfile.lock +++ b/flutter/example/ios/Podfile.lock @@ -28,12 +28,12 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/path_provider_ios/ios" SPEC CHECKSUMS: - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a MMKV: 7f34558bbb5a33b0eaefae2de4b6a20a2ffdad6f MMKVCore: ddf41b9d9262f058419f9ba7598719af56c02cd3 mmkvflutter: adff7ed724316d0cea22d65b59f43d467fc57403 path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 -PODFILE CHECKSUM: 2acd6b65862dca90667a4e676cf781dbf247bef7 +PODFILE CHECKSUM: 751e522a1d35e86af4f588d982f4a515941611c5 -COCOAPODS: 1.11.3 +COCOAPODS: 1.11.2 diff --git a/flutter/example/ios/Runner.xcodeproj/project.pbxproj b/flutter/example/ios/Runner.xcodeproj/project.pbxproj index 7284960b..ac062d52 100644 --- a/flutter/example/ios/Runner.xcodeproj/project.pbxproj +++ b/flutter/example/ios/Runner.xcodeproj/project.pbxproj @@ -146,6 +146,7 @@ buildPhases = ( 19FB7C13A6F154DB79BFE09E /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, + DBADF7DE4086731B8B058FA4 /* [CP-User] Fix MMKV Plugin Name */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, @@ -258,6 +259,16 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n"; }; + DBADF7DE4086731B8B058FA4 /* [CP-User] Fix MMKV Plugin Name */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + name = "[CP-User] Fix MMKV Plugin Name"; + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "sed -i \"\" \"s/@import mmkv;/@import mmkvflutter;/g\" ${SRCROOT}/Runner/GeneratedPluginRegistrant.m"; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/flutter/example/lib/main.dart b/flutter/example/lib/main.dart index 94ca0f0a..99d0c41e 100644 --- a/flutter/example/lib/main.dart +++ b/flutter/example/lib/main.dart @@ -18,10 +18,10 @@ * limitations under the License. */ -import 'dart:async'; -import 'dart:convert'; -import 'dart:io'; -import 'dart:typed_data'; +import "dart:async"; +import "dart:convert"; +import "dart:io"; +import "dart:typed_data"; import "package:flutter/material.dart"; import "package:mmkv/mmkv.dart"; @@ -140,21 +140,21 @@ class _MyAppState extends State { final list = Uint8List(0); final buffer = MMBuffer.fromList(list)!; - const key = 'empty_bytes'; + const key = "empty_bytes"; mmkv.encodeBytes(key, buffer); buffer.destroy(); String bytesA; final result = mmkv.decodeBytes(key); if (result == null) { - bytesA = 'decodeBytes is null'; + bytesA = "decodeBytes is null"; } else { // bytes = result.takeList().toString(); final listA = result.asList(); bytesA = listA.toString(); result.destroy(); } - print('$key = $bytesA'); + print("$key = $bytesA"); } print('contains "bool": ${mmkv.containsKey('bool')}'); diff --git a/flutter/example/pubspec.lock b/flutter/example/pubspec.lock index c11a4521..0208d4f6 100644 --- a/flutter/example/pubspec.lock +++ b/flutter/example/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.9.0" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,14 +21,21 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.0" collection: dependency: transitive description: @@ -49,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.3.0" ffi: dependency: transitive description: @@ -80,21 +87,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.12" + version: "0.12.11" material_color_utilities: dependency: transitive description: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.5" + version: "0.1.4" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.7.0" mmkv: dependency: "direct main" description: @@ -108,7 +115,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.2" + version: "1.8.1" path_provider: dependency: "direct main" description: @@ -190,7 +197,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.9.0" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -211,21 +218,21 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.12" + version: "0.4.9" vector_math: dependency: transitive description: diff --git a/flutter/lib/mmkv.dart b/flutter/lib/mmkv.dart index 3d93ebd7..a382f240 100644 --- a/flutter/lib/mmkv.dart +++ b/flutter/lib/mmkv.dart @@ -22,6 +22,7 @@ import "dart:async"; import "dart:convert"; import "dart:ffi"; // For FFI import "dart:io"; // For Platform.isX +import "dart:typed_data"; import "package:ffi/ffi.dart"; import "package:flutter/cupertino.dart"; diff --git a/flutter/pubspec.lock b/flutter/pubspec.lock index 868ce507..ac869174 100644 --- a/flutter/pubspec.lock +++ b/flutter/pubspec.lock @@ -28,7 +28,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.9.0" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -42,14 +42,21 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.0" collection: dependency: transitive description: @@ -84,7 +91,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.3.0" ffi: dependency: "direct main" description: @@ -178,21 +185,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.12" + version: "0.12.11" material_color_utilities: dependency: transitive description: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.5" + version: "0.1.4" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.7.0" mime: dependency: transitive description: @@ -220,7 +227,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.2" + version: "1.8.1" path_provider: dependency: "direct main" description: @@ -358,7 +365,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.9.0" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -379,35 +386,35 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.0" test: dependency: "direct dev" description: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.21.4" + version: "1.21.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.12" + version: "0.4.9" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.16" + version: "0.4.13" typed_data: dependency: transitive description: diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index a5357e7e..13ab68a5 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: mmkv description: An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX. -version: 1.2.16 +version: 1.2.17 homepage: https://github.com/Tencent/mmkv environment: diff --git a/iOS/MMKV/MMKV.xcodeproj/project.pbxproj b/iOS/MMKV/MMKV.xcodeproj/project.pbxproj index 6eca7016..835766d5 100644 --- a/iOS/MMKV/MMKV.xcodeproj/project.pbxproj +++ b/iOS/MMKV/MMKV.xcodeproj/project.pbxproj @@ -486,7 +486,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.2.15; + MARKETING_VERSION = 1.2.16; "OTHER_LDFLAGS[sdk=iphoneos*]" = ( "-framework", UIKit, @@ -529,7 +529,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.2.15; + MARKETING_VERSION = 1.2.16; "OTHER_LDFLAGS[sdk=iphoneos*]" = ( "-framework", UIKit, @@ -728,7 +728,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.2.15; + MARKETING_VERSION = 1.2.16; "OTHER_LDFLAGS[sdk=iphoneos*]" = ( "-framework", UIKit, @@ -766,7 +766,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.2.15; + MARKETING_VERSION = 1.2.16; "OTHER_LDFLAGS[sdk=iphoneos*]" = ( "-framework", UIKit, @@ -811,7 +811,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.2.15; + MARKETING_VERSION = 1.2.16; "OTHER_LDFLAGS[sdk=iphoneos*]" = ( "-framework", UIKit, @@ -858,7 +858,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.2.15; + MARKETING_VERSION = 1.2.16; "OTHER_LDFLAGS[sdk=iphoneos*]" = ( "-framework", UIKit,