Skip to content

Commit

Permalink
Merge pull request #1250 from Tencent/dev
Browse files Browse the repository at this point in the history
for v1.3.4
  • Loading branch information
lingol authored Mar 15, 2024
2 parents 1bc1068 + 2e9fdcb commit 591140f
Show file tree
Hide file tree
Showing 37 changed files with 509 additions and 114 deletions.
4 changes: 2 additions & 2 deletions Android/MMKV/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ 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.3.3
VERSION_NAME_PREFIX=1.3.4
#VERSION_NAME_SUFFIX=-SNAPSHOT
VERSION_NAME_SUFFIX=

RELEASE_REPOSITORY_URL=https://oss.sonatype.org/service/local/staging/deploy/maven2
SNAPSHOT_REPOSITORY_URL=https://oss.sonatype.org/content/repositories/snapshots
SNAPSHOT_REPOSITORY_URL=https://oss.sonatype.org/content/repositories/snapshots
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:1.3.3'
// implementation 'com.tencent:mmkv-static:1.3.3' // this is identical to 'com.tencent:mmkv'
// implementation 'com.tencent:mmkv-shared:1.3.3'
// implementation 'com.tencent:mmkv:1.3.4'
// implementation 'com.tencent:mmkv-static:1.3.4' // this is identical to 'com.tencent:mmkv'
// implementation 'com.tencent:mmkv-shared:1.3.4'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# MMKV Change Log
## v1.3.4 / 2024-03-15
### Changes for All platforms
* Make `trim()` more robust in multi-process mode.

### iOS & macOS
* Support visionOS.

### POSIX
* Fix a compile error on `::unlink()`.

## v1.3.3 / 2024-01-25
### Changes for All platforms
* Add `removeStorage()` static method to safely delete underlying files of an MMKV instance.
Expand Down
6 changes: 4 additions & 2 deletions Core/Core.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@
SDKROOT = iphoneos;
TVOS_DEPLOYMENT_TARGET = 13.0;
WATCHOS_DEPLOYMENT_TARGET = 4.0;
XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Debug;
};
Expand Down Expand Up @@ -559,6 +560,7 @@
TVOS_DEPLOYMENT_TARGET = 13.0;
VALIDATE_PRODUCT = YES;
WATCHOS_DEPLOYMENT_TARGET = 4.0;
XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Release;
};
Expand All @@ -582,7 +584,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos";
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos xrsimulator xros";
TARGETED_DEVICE_FAMILY = "1,2,3";
};
name = Debug;
Expand All @@ -608,7 +610,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos";
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos xrsimulator xros";
TARGETED_DEVICE_FAMILY = "1,2,3";
};
name = Release;
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 = "v1.3.3";
constexpr auto MMKV_VERSION = "v1.3.4";

#ifdef DEBUG
# define MMKV_DEBUG
Expand Down
6 changes: 5 additions & 1 deletion Core/MMKV_IO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
# endif
#endif // MMKV_APPLE

#ifndef MMKV_WIN32
# include <unistd.h>
#endif

using namespace std;
using namespace mmkv;
using KVHolderRet_t = std::pair<bool, KeyValueHolder>;
Expand Down Expand Up @@ -1384,6 +1388,7 @@ void MMKV::trim() {
SCOPED_LOCK(m_lock);
MMKVInfo("prepare to trim %s", m_mmapID.c_str());

SCOPED_LOCK(m_exclusiveProcessLock);
checkLoadData();
if (!isFileValid()) {
MMKVWarning("[%s] file not valid", m_mmapID.c_str());
Expand All @@ -1396,7 +1401,6 @@ void MMKV::trim() {
} else if (m_file->getFileSize() <= m_expectedCapacity) {
return;
}
SCOPED_LOCK(m_exclusiveProcessLock);

fullWriteback();
auto oldSize = m_file->getFileSize();
Expand Down
1 change: 1 addition & 0 deletions Core/MemoryFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
# include <sys/file.h>
# include <dirent.h>
# include <cstring>
# include <unistd.h>

using namespace std;

Expand Down
3 changes: 2 additions & 1 deletion Core/MemoryFile_OSX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ void tryResetFileProtection(const string &path) {
#ifdef MMKV_APPLE

#include <copyfile.h>
#include <unistd.h>

namespace mmkv {

Expand All @@ -77,7 +78,7 @@ bool tryAtomicRename(const char *src, const char *dst) {
}
}

unlink(src);
::unlink(src);

return true;
}
Expand Down
5 changes: 3 additions & 2 deletions MMKV.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MMKV"
s.version = "1.3.3"
s.version = "1.3.4"
s.summary = "MMKV is a cross-platform key-value storage framework developed by WeChat."

s.description = <<-DESC
Expand All @@ -17,6 +17,7 @@ Pod::Spec.new do |s|
s.ios.deployment_target = "11.0"
s.osx.deployment_target = "10.13"
s.tvos.deployment_target = "13.0"
s.visionos.deployment_target = "1.0"

s.source = { :git => "https://github.com/Tencent/MMKV.git", :tag => "v#{s.version}" }
s.source_files = "iOS/MMKV/MMKV", "iOS/MMKV/MMKV/*.{h,mm,hpp}"
Expand All @@ -31,7 +32,7 @@ Pod::Spec.new do |s|
"CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF" => "NO",
}

s.dependency 'MMKVCore', '~> 1.3.3'
s.dependency 'MMKVCore', '~> 1.3.4'

end

3 changes: 3 additions & 0 deletions MMKV.xcworkspace/contents.xcworkspacedata

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

4 changes: 2 additions & 2 deletions MMKVAppExtension.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MMKVAppExtension"
s.version = "1.3.3"
s.version = "1.3.4"
s.summary = "MMKV is a cross-platform key-value storage framework developed by WeChat."
s.module_name = "MMKVAppExtension"

Expand Down Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
"GCC_PREPROCESSOR_DEFINITIONS" => "MMKV_IOS_EXTENSION",
}

s.dependency 'MMKVCore', '~> 1.3.3'
s.dependency 'MMKVCore', '~> 1.3.4'

end

3 changes: 2 additions & 1 deletion MMKVCore.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MMKVCore"
s.version = "1.3.3"
s.version = "1.3.4"
s.summary = "MMKVCore for MMKV. MMKV is a cross-platform key-value storage framework developed by WeChat."

s.description = <<-DESC
Expand All @@ -18,6 +18,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = "10.13"
s.tvos.deployment_target = "13.0"
s.watchos.deployment_target = "4.0"
s.visionos.deployment_target = "1.0"

s.source = { :git => "https://github.com/Tencent/MMKV.git", :tag => "v#{s.version}" }
s.source_files = "Core", "Core/*.{h,cpp,hpp}", "Core/aes/*", "Core/aes/openssl/*", "Core/crc32/*.h"
Expand Down
4 changes: 2 additions & 2 deletions MMKVWatchExtension.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MMKVWatchExtension"
s.version = "1.3.3"
s.version = "1.3.4"
s.summary = "MMKV is a cross-platform key-value storage framework developed by WeChat."
s.module_name = "MMKVWatchExtension"

Expand Down Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
"GCC_PREPROCESSOR_DEFINITIONS" => "MMKV_IOS_EXTENSION",
}

s.dependency 'MMKVCore', '~> 1.3.3'
s.dependency 'MMKVCore', '~> 1.3.4'

end

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-1.3.3-brightgreen.svg)](https://github.com/Tencent/MMKV/releases)
[![Release Version](https://img.shields.io/badge/release-1.3.4-brightgreen.svg)](https://github.com/Tencent/MMKV/releases)
[![Platform](https://img.shields.io/badge/Platform-%20Android%20%7C%20iOS%2FmacOS%20%7C%20Win32%20%7C%20POSIX-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:1.3.3'
// replace "1.3.3" with any available version
implementation 'com.tencent:mmkv:1.3.4'
// replace "1.3.4" 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:1.3.3'
// replace "1.3.3" with any available version
implementation 'com.tencent:mmkv:1.3.4'
// replace "1.3.4" with any available version
}
```
更多安装指引参考 [Android Setup](https://github.com/Tencent/MMKV/wiki/android_setup_cn)
Expand Down
4 changes: 4 additions & 0 deletions flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# MMKV for Flutter Change Log

## v1.3.4 / 2024-03-15
* Make `trim()` more robust in multi-process mode.

## v1.3.3 / 2024-01-25
* Add `removeStorage()` static method to safely delete underlying files of an MMKV instance.
* Add protection from a potential crash of a multi-process MMKV loading due to the MMKV file not being valid.
Expand Down
6 changes: 3 additions & 3 deletions flutter/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-1.3.3-brightgreen.svg)](https://github.com/Tencent/MMKV/releases)
[![Release Version](https://img.shields.io/badge/release-1.3.4-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**.
Expand All @@ -26,11 +26,11 @@ Add the following lines to `pubspec.yaml` on your app module. Then run `flutter

```yaml
dependencies:
mmkv: ">=1.3.3"
mmkv: ">=1.3.4"
...
```

If you already include MMKV native lib in your App, you need to upgrade to version newer than v1.3.3.
If you already include MMKV native lib in your App, you need to upgrade to version newer than v1.3.4.

#### iOS
To avoid conflict of the native lib name 'libMMKV.so' on iOS, we need to **change the plugin name 'mmkv' to 'mmkvflutter'**.
Expand Down
2 changes: 1 addition & 1 deletion flutter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ android {
}

dependencies {
implementation 'com.tencent:mmkv:1.3.3'
implementation 'com.tencent:mmkv:1.3.4'
}
}
4 changes: 2 additions & 2 deletions flutter/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {

defaultConfig {
applicationId "com.tencent.mmkv_example"
minSdkVersion 16
minSdkVersion flutter.minSdkVersion
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand All @@ -49,7 +49,7 @@ android {
}

dependencies {
implementation('com.tencent:mmkv:1.3.3')
implementation('com.tencent:mmkv:1.3.4')

constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
Expand Down
Loading

0 comments on commit 591140f

Please sign in to comment.