Skip to content

Commit

Permalink
Merge pull request #1431 from Tencent/dev
Browse files Browse the repository at this point in the history
v2.0.1
  • Loading branch information
lingol authored Nov 12, 2024
2 parents 0eb915a + 90516e3 commit f08b3ba
Show file tree
Hide file tree
Showing 23 changed files with 65 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Android/MMKV/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=2.0.0
VERSION_NAME_PREFIX=2.0.1
#VERSION_NAME_SUFFIX=-SNAPSHOT
VERSION_NAME_SUFFIX=

Expand Down
6 changes: 3 additions & 3 deletions Android/MMKV/mmkvdemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ repositories {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':mmkv')
// implementation 'com.tencent:mmkv:2.0.0'
// implementation 'com.tencent:mmkv-static:2.0.0' // this is identical to 'com.tencent:mmkv'
// implementation 'com.tencent:mmkv-shared:2.0.0'
// implementation 'com.tencent:mmkv:2.0.1'
// implementation 'com.tencent:mmkv-static:2.0.1' // this is identical to 'com.tencent:mmkv'
// implementation 'com.tencent:mmkv-shared:2.0.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# MMKV Change Log
## v2.0.1 / 2024-11-12
**This is a hotfix release.**
### Changes for All platforms
* Fix a bug that might cause MMKV to become dead-locked for other threads after decoding container-type values. The affected platforms and value types are listed below. So don't be surprised if you find no update on the unaffected platforms.

### HarmonyOS NEXT
* Fix a bug that MMKV might become dead-locked for other threads after `decodeStringSet()` / `decodeNumberSet` / `decodeBoolSet` or decoding `TypedArray`.

### Flutter
* Fix the bug on HarmonyOS NEXT listed above. A version named v2.0.1 was added to fix the Android version conflict between the LTS series & v2.0. Thanks to the federated plugins framework, only the underlying `mmkv_ohos` plugin is upgraded, the `mmkv` plugin stays the same.

### POSIX
* Fix a bug that MMKV might become dead-locked for other threads after decoding `std::vector<T>` or `std::span<T>` values.

## v2.0.0 / 2024-10-21
**This release is a breaking change release, especially for Android.**
### Changes for All platforms
Expand Down
4 changes: 2 additions & 2 deletions Core/MMKV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,8 @@ void MMKV::shared_lock() {
}

void MMKV::shared_unlock() {
m_sharedProcessLock->lock();
m_lock->lock();
m_sharedProcessLock->unlock();
m_lock->unlock();
}

#endif // MMKV_APPLE
Expand Down
2 changes: 1 addition & 1 deletion Core/MMKVPredef.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <vector>
#include <unordered_map>

constexpr auto MMKV_VERSION = "v2.0.0";
constexpr auto MMKV_VERSION = "v2.0.1";

#ifdef DEBUG
# define MMKV_DEBUG
Expand Down
2 changes: 1 addition & 1 deletion Core/MMKV_Android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ MMKV *MMKV::mmkvWithID(const string &mmapID, int size, MMKVMode mode, string *cr
return nullptr;
}
}
MMKVInfo("prepare to load %s (id %s) from rootPath %zu", mmapID.c_str(), mmapKey.c_str(), rootPath->c_str());
MMKVInfo("prepare to load %s (id %s) from rootPath %s", mmapID.c_str(), mmapKey.c_str(), rootPath->c_str());
}
auto kv = new MMKV(mmapID, size, mode, cryptKey, rootPath, expectedCapacity);
(*g_instanceDic)[mmapKey] = kv;
Expand Down
2 changes: 1 addition & 1 deletion OpenHarmony/MMKV/BuildProfile.ets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Use these variables when you tailor your ArkTS code. They must be of the const type.
*/
export const HAR_VERSION = '2.0.0';
export const HAR_VERSION = '2.0.1';
export const BUILD_MODE_NAME = 'release';
export const DEBUG = false;
export const TARGET_NAME = 'default';
Expand Down
2 changes: 2 additions & 0 deletions OpenHarmony/MMKV/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# MMKV for HarmonyOS NEXT Change Log
## v2.0.1 / 2024-11-12
* Fix a bug that MMKV might become dead-locked for other threads after `decodeStringSet()` / `decodeNumberSet` / `decodeBoolSet` or decoding `TypedArray`.

## v2.0.0 / 2024-10-21
* Support obfuscation. For the time being, you will have to manually copy the content of MMKV's [consumer-rules.txt](https://github.com/Tencent/MMKV/blob/master/OpenHarmony/MMKV/consumer-rules.txt) into your App's obfuscation-rules.txt.
Expand Down
4 changes: 2 additions & 2 deletions OpenHarmony/MMKV/README.md
Original file line number Diff line number Diff line change
@@ -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-2.0.0-brightgreen.svg)](https://github.com/Tencent/MMKV/releases)
[![Release Version](https://img.shields.io/badge/release-2.0.1-brightgreen.svg)](https://github.com/Tencent/MMKV/releases)
[![Platform](https://img.shields.io/badge/Platform-%20HarmonyOS%20NEXT-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 now available on **HarmonyOS NEXT**.
Expand Down Expand Up @@ -37,7 +37,7 @@ Or, you can add it to your project manually.

```json
"dependencies": {
"@tencent/mmkv": "^2.0.0",
"@tencent/mmkv": "^2.0.1",
}
```
* Then run
Expand Down
4 changes: 2 additions & 2 deletions OpenHarmony/MMKV/build-profile.json5
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"externalNativeOptions": {
"path": "./src/main/cpp/CMakeLists.txt",
"arguments": "-DOHOS_STL=c++_static",
"cppFlags": "-DMMKV_STL_SHARED=0 -fvisibility=hidden -funwind-tables -fasynchronous-unwind-tables -O2",
"cppFlags": "-DMMKV_STL_SHARED=0 -fvisibility=hidden -funwind-tables -fasynchronous-unwind-tables -O2 -g",
"abiFilters": ["arm64-v8a", "x86_64"],
}
},
Expand All @@ -26,7 +26,7 @@
},
"nativeLib": {
"debugSymbol": {
"strip": true,
"strip": false,
"exclude": []
}
}
Expand Down
2 changes: 1 addition & 1 deletion OpenHarmony/MMKV/oh-package.json5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tencent/mmkv",
"version": "2.0.0",
"version": "2.0.1",
"description": "The official OpenHarmony package of MMKV. An efficient, small mobile key-value storage framework developed by WeChat.",
"main": "Index.ets",
"author": "guoling",
Expand Down
2 changes: 1 addition & 1 deletion OpenHarmony/entry/oh-package-lock.json5

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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-2.0.0-brightgreen.svg)](https://github.com/Tencent/MMKV/releases)
[![Release Version](https://img.shields.io/badge/release-2.0.1-brightgreen.svg)](https://github.com/Tencent/MMKV/releases)
[![Platform](https://img.shields.io/badge/Platform-%20Android%20%7C%20iOS%2FmacOS%20%7C%20Windows%20%7C%20POSIX%20%7C%20HarmonyOS%20NEXT-brightgreen.svg)](https://github.com/Tencent/MMKV/wiki/home)

中文版本请参看[这里](./README_CN.md)
Expand Down Expand Up @@ -28,8 +28,8 @@ Add the following lines to `build.gradle` on your app module:

```gradle
dependencies {
implementation 'com.tencent:mmkv:2.0.0'
// replace "2.0.0" with any available version
implementation 'com.tencent:mmkv:2.0.1'
// replace "2.0.1" with any available version
}
```

Expand Down
4 changes: 2 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ MMKV 是基于 mmap 内存映射的 key-value 组件,底层序列化/反序列

```gradle
dependencies {
implementation 'com.tencent:mmkv:2.0.0'
// replace "2.0.0" with any available version
implementation 'com.tencent:mmkv:2.0.1'
// replace "2.0.1" with any available version
}
```
更多安装指引参考 [Android Setup](https://github.com/Tencent/MMKV/wiki/android_setup_cn)
Expand Down
2 changes: 1 addition & 1 deletion flutter/mmkv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ For additional documents, checkout the [wiki](https://github.com/Tencent/MMKV/wi
MMKV is published under the BSD 3-Clause license. For details check out the [LICENSE.TXT](https://github.com/Tencent/MMKV/blob/master/LICENSE.TXT).

## Change Log
Check out the [CHANGELOG.md](https://github.com/Tencent/MMKV/blob/master/flutter/CHANGELOG.md) for details of change history.
Check out the [CHANGELOG.md](https://github.com/Tencent/MMKV/blob/master/flutter/mmkv/CHANGELOG.md) for details of change history.

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions flutter/mmkv/example/ohos/AppScope/app.json5
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"app": {
"bundleName": "com.example.mmkv_fake_example",
"vendor": "example",
"versionCode": 1000000,
"versionCode": 1,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name"
}
}
}
5 changes: 5 additions & 0 deletions flutter/mmkv/example/ohos/entry/build-profile.json5
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
{
"apiType": 'stageMode',
"buildOption": {
"nativeLib": {
"debugSymbol": {
"strip": false
}
}
},
"targets": [
{
Expand Down
4 changes: 2 additions & 2 deletions flutter/mmkv/example/ohos/entry/oh-package.json5
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"author": "",
"license": "",
"dependencies": {
"mmkv_fake": "file:../har/mmkv_fake.har",
"path_provider_ohos": "file:../har/path_provider_ohos.har",
"mmkv_ohos": "file:../har/mmkv_ohos.har"
"mmkv_ohos": "file:../har/mmkv_ohos.har",
// "@tencent/mmkv": "file:/Users/lingol/Developer/mmkv/OpenHarmony/MMKV/build/default/outputs/default/MMKV.har"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@
* limitations under the License.
*/

import { FlutterAbility, FlutterEngine } from '@ohos/flutter_ohos';
import { FlutterAbility, FlutterEngine, FlutterManager } from '@ohos/flutter_ohos';
import { GeneratedPluginRegistrant } from '../plugins/GeneratedPluginRegistrant';
// import { MMKV } from '@tencent/mmkv';
import AbilityConstant from '@ohos.app.ability.AbilityConstant';
import Want from '@ohos.app.ability.Want';

export default class EntryAbility extends FlutterAbility {
async onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): Promise<void> {
// EntryAbility.instance = this
// MMKV.initialize(this.context.getApplicationContext())
// let mmkv = MMKV.defaultMMKV();
// mmkv.encodeInt32('Harmony', 12)
// mmkv.decodeNumberSet('a')
super.onCreate(want, launchParam)
}

configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
GeneratedPluginRegistrant.registerWith(flutterEngine)
Expand Down
1 change: 0 additions & 1 deletion flutter/mmkv/example/ohos/oh-package.json5
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
},
"overrides": {
"@ohos/flutter_ohos": "file:./har/flutter.har",
"mmkv_fake": "file:./har/mmkv_fake.har",
"@ohos/flutter_module": "file:./entry",
"path_provider_ohos": "file:./har/path_provider_ohos.har",
"mmkv_ohos": "file:./har/mmkv_ohos.har"
Expand Down
3 changes: 3 additions & 0 deletions flutter/mmkv_ohos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# MMKV Platform OHOS Change Log
## v2.0.1 / 2024-10-25
Keep up with native lib v2.0.1.

## v2.0.0 / 2024-10-25
Bump to 2.0 to setup a breaking change version.

Expand Down
4 changes: 2 additions & 2 deletions flutter/mmkv_ohos/ohos/oh-package.json5
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"license": "Apache-2.0",
"dependencies": {
"@ohos/flutter_ohos": "file:./har/flutter.har",
"@tencent/mmkv": "^2.0.0"
// "@tencent/mmkv": "file:../../../OpenHarmony/MMKV/build/default/outputs/default/MMKV.har"
"@tencent/mmkv": "^2.0.1"
// "@tencent/mmkv": "file:/Users/lingol/Developer/mmkv/OpenHarmony/MMKV/build/default/outputs/default/MMKV.har"
},
"devDependencies": {},
"dynamicDependencies": {}
Expand Down
2 changes: 1 addition & 1 deletion flutter/mmkv_ohos/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: mmkv_ohos
description: OHOS platform implementation of MMKV.
repository: https://github.com/Tencent/MMKV/tree/master/flutter/mmkv_ohos
version: 2.0.0
version: 2.0.1
homepage: https://github.com/Tencent/mmkv

environment:
Expand Down

0 comments on commit f08b3ba

Please sign in to comment.