Skip to content

Commit cffee73

Browse files
committed
add filterExpire param for count() & allKeys() for flutter
1 parent bcfa406 commit cffee73

File tree

16 files changed

+63
-36
lines changed

16 files changed

+63
-36
lines changed

Android/MMKV/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xmx1536m
1414
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1515
# org.gradle.parallel=true
1616

17-
VERSION_NAME_PREFIX=1.3.0
17+
VERSION_NAME_PREFIX=1.3.1
1818
#VERSION_NAME_SUFFIX=-SNAPSHOT
1919
VERSION_NAME_SUFFIX=
2020

Android/MMKV/mmkv/src/main/cpp/flutter-bridge.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,10 @@ MMKV_EXPORT int32_t writeValueToNB(void *handle, char *oKey, void *pointer, uint
347347
return -1;
348348
}
349349

350-
MMKV_EXPORT uint64_t allKeys(void *handle, char ***keyArrayPtr, uint32_t **sizeArrayPtr) {
350+
MMKV_EXPORT uint64_t allKeys(void *handle, char ***keyArrayPtr, uint32_t **sizeArrayPtr, bool filterExpire) {
351351
MMKV *kv = static_cast<MMKV *>(handle);
352352
if (kv) {
353-
auto keys = kv->allKeys();
353+
auto keys = kv->allKeys(filterExpire);
354354
if (!keys.empty()) {
355355
auto keyArray = (char **) malloc(keys.size() * sizeof(void *));
356356
auto sizeArray = (uint32_t *) malloc(keys.size() * sizeof(uint32_t *));
@@ -385,10 +385,10 @@ MMKV_EXPORT bool containsKey(void *handle, char *oKey) {
385385
return false;
386386
}
387387

388-
MMKV_EXPORT uint64_t count(void *handle) {
388+
MMKV_EXPORT uint64_t count(void *handle, bool filterExpire) {
389389
MMKV *kv = static_cast<MMKV *>(handle);
390390
if (kv) {
391-
return kv->count();
391+
return kv->count(filterExpire);
392392
}
393393
return 0;
394394
}

Android/MMKV/mmkvdemo/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ repositories {
7676
dependencies {
7777
implementation fileTree(include: ['*.jar'], dir: 'libs')
7878
implementation project(':mmkv')
79-
// implementation 'com.tencent:mmkv:1.3.0'
80-
// implementation 'com.tencent:mmkv-static:1.3.0' // this is identical to 'com.tencent:mmkv'
81-
// implementation 'com.tencent:mmkv-shared:1.3.0'
79+
// implementation 'com.tencent:mmkv:1.3.1'
80+
// implementation 'com.tencent:mmkv-static:1.3.1' // this is identical to 'com.tencent:mmkv'
81+
// implementation 'com.tencent:mmkv-shared:1.3.1'
8282
implementation 'androidx.appcompat:appcompat:1.6.1'
8383
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
8484
testImplementation 'junit:junit:4.13.2'
8585
androidTestImplementation 'androidx.test:runner:1.5.2'
8686
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
87-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
87+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
8888
implementation 'com.getkeepsafe.relinker:relinker:1.4.3'
8989
}

Core/MMKVPredef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include <vector>
3535
#include <unordered_map>
3636

37-
constexpr auto MMKV_VERSION = "v1.3.0";
37+
constexpr auto MMKV_VERSION = "v1.3.1";
3838

3939
#ifdef DEBUG
4040
# define MMKV_DEBUG

Core/MMKV_IO.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,9 @@ size_t MMKV::filterExpiredKeys() {
15361536
}
15371537
}
15381538
}
1539-
MMKVInfo("deleted %zu expired keys inside [%s]", count, m_mmapID.c_str());
1539+
if (count != 0) {
1540+
MMKVInfo("deleted %zu expired keys inside [%s]", count, m_mmapID.c_str());
1541+
}
15401542
return count;
15411543
}
15421544

Core/core.vcxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
</ItemGroup>
6666
<PropertyGroup Label="Globals">
6767
<ProjectGuid>{32CD39C9-37B5-3D38-A3D9-45E13F4AF9C5}</ProjectGuid>
68-
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
68+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
6969
<Keyword>Win32Proj</Keyword>
7070
<Platform>Win32</Platform>
7171
<ProjectName>core</ProjectName>
@@ -75,12 +75,12 @@
7575
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
7676
<ConfigurationType>StaticLibrary</ConfigurationType>
7777
<CharacterSet>Unicode</CharacterSet>
78-
<PlatformToolset>v140</PlatformToolset>
78+
<PlatformToolset>v143</PlatformToolset>
7979
</PropertyGroup>
8080
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
8181
<ConfigurationType>StaticLibrary</ConfigurationType>
8282
<CharacterSet>Unicode</CharacterSet>
83-
<PlatformToolset>v140</PlatformToolset>
83+
<PlatformToolset>v143</PlatformToolset>
8484
</PropertyGroup>
8585
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
8686
<ImportGroup Label="ExtensionSettings">

Win32/Win32Demo/Win32Demo.vcxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323
<ProjectGuid>{532303C4-38D9-45D3-B925-18056C66CD01}</ProjectGuid>
2424
<Keyword>Win32Proj</Keyword>
2525
<RootNamespace>Win32Demo</RootNamespace>
26-
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
26+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2727
</PropertyGroup>
2828
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2929
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
3030
<ConfigurationType>Application</ConfigurationType>
3131
<UseDebugLibraries>true</UseDebugLibraries>
32-
<PlatformToolset>v140</PlatformToolset>
32+
<PlatformToolset>v143</PlatformToolset>
3333
<CharacterSet>Unicode</CharacterSet>
3434
</PropertyGroup>
3535
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3636
<ConfigurationType>Application</ConfigurationType>
3737
<UseDebugLibraries>false</UseDebugLibraries>
38-
<PlatformToolset>v140</PlatformToolset>
38+
<PlatformToolset>v143</PlatformToolset>
3939
<WholeProgramOptimization>true</WholeProgramOptimization>
4040
<CharacterSet>Unicode</CharacterSet>
4141
</PropertyGroup>

Win32/Win32DemoProcess/Win32DemoProcess.vcxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323
<ProjectGuid>{86D6C605-81F3-407B-A766-690EDF4CD346}</ProjectGuid>
2424
<Keyword>Win32Proj</Keyword>
2525
<RootNamespace>Win32DemoProcess</RootNamespace>
26-
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
26+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2727
</PropertyGroup>
2828
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2929
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
3030
<ConfigurationType>Application</ConfigurationType>
3131
<UseDebugLibraries>true</UseDebugLibraries>
32-
<PlatformToolset>v140</PlatformToolset>
32+
<PlatformToolset>v143</PlatformToolset>
3333
<CharacterSet>Unicode</CharacterSet>
3434
</PropertyGroup>
3535
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3636
<ConfigurationType>Application</ConfigurationType>
3737
<UseDebugLibraries>false</UseDebugLibraries>
38-
<PlatformToolset>v140</PlatformToolset>
38+
<PlatformToolset>v143</PlatformToolset>
3939
<WholeProgramOptimization>true</WholeProgramOptimization>
4040
<CharacterSet>Unicode</CharacterSet>
4141
</PropertyGroup>

flutter/android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:4.2.1'
11+
classpath 'com.android.tools.build:gradle:7.4.1'
1212
}
1313
}
1414

1515
rootProject.allprojects {
1616
repositories {
1717
google()
1818
mavenCentral()
19-
// mavenLocal()
19+
mavenLocal()
2020
}
2121
}
2222

@@ -33,6 +33,6 @@ android {
3333
}
3434

3535
dependencies {
36-
implementation 'com.tencent:mmkv:1.3.0'
36+
implementation 'com.tencent:mmkv:1.3.1'
3737
}
3838
}

flutter/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.7.1-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip

0 commit comments

Comments
 (0)