Skip to content

Commit

Permalink
Merge pull request #112 from Tencent/dev
Browse files Browse the repository at this point in the history
prepare for v1.0.13
  • Loading branch information
lingol authored Nov 14, 2018
2 parents c62f9a7 + 0e75ec6 commit 154d3e3
Show file tree
Hide file tree
Showing 49 changed files with 2,007 additions and 212 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ ObjCBlockIndentWidth: 4
Language: Java
ColumnLimit: 100
AllowShortFunctionsOnASingleLine: None
BreakBeforeBinaryOperators: NonAssignment
2 changes: 1 addition & 1 deletion Android/MMKV/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ 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.0.12
VERSION_NAME_PREFIX=1.0.13
#VERSION_NAME_SUFFIX=-SNAPSHOT
VERSION_NAME_SUFFIX=
14 changes: 12 additions & 2 deletions Android/MMKV/gradle/android-publish.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import java.util.regex.Matcher
import java.util.regex.Pattern

// OSS_ANDROID_TEMPLATE_FILE_HEADER
/**
* New android-publish gradle script
Expand Down Expand Up @@ -70,12 +73,18 @@ def pomConfig = {
}
}

def curArtifactId

def bintrayPublicationNames = []
android.libraryVariants.all { variant ->
// Skipped debug variants
if (variant.buildType.name == "debug") {
return
}
// Skipped non publishing variants
if(!android.defaultPublishConfig.startsWith(variant.flavorName)) {
return
}

def hasFlavors = !variant.flavorName.isEmpty()

Expand All @@ -92,7 +101,7 @@ android.libraryVariants.all { variant ->
artifactIdSuffix = '-' + artifactIdSuffix
}

def curArtifactId = "${POM_ARTIFACT_ID}${artifactIdSuffix}"
curArtifactId = "${POM_ARTIFACT_ID}${artifactIdSuffix}"

/**
* Includes
Expand Down Expand Up @@ -191,7 +200,8 @@ afterEvaluate {
pkg {
repo = 'maven'
userOrg = BINTRAY_ORGANIZATION
name = "${GROUP}:${POM_ARTIFACT_ID}"
// name = "${GROUP}:${POM_ARTIFACT_ID}"
name = "${GROUP}:" + curArtifactId
licenses = BINTRAY_LICENCE
vcsUrl = POM_SCM_URL
websiteUrl = POM_URL
Expand Down
5 changes: 5 additions & 0 deletions Android/MMKV/mmkv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ add_library( # Sets the name of the library.
src/main/cpp/aes/openssl/cfb128.c
src/main/cpp/aes/openssl/modes.h
src/main/cpp/aes/openssl/opensslconf.h
src/main/cpp/aes/openssl/md5_dgst.c
src/main/cpp/aes/openssl/md5_locl.h
src/main/cpp/aes/openssl/md5_one.c
src/main/cpp/aes/openssl/md5.h
src/main/cpp/aes/openssl/md32_common.h
)

# Searches for a specified prebuilt library and stores the path as a
Expand Down
2 changes: 1 addition & 1 deletion Android/MMKV/mmkv/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply from: rootProject.file('gradle/build_library.gradle')

android {
// Not working...Don't know why
// defaultPublishConfig "StaticCppRelease"
defaultPublishConfig "SharedCppRelease"
defaultConfig {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
Expand Down
2 changes: 2 additions & 0 deletions Android/MMKV/mmkv/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
-keepclasseswithmembers,includedescriptorclasses class com.tencent.mmkv.** {
native <methods>;
long nativeHandle;
private static *** onMMKVCRCCheckFail(***);
private static *** onMMKVFileLengthError(***);
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@ public void testString() {
@Test
public void testStringSet() {
HashSet<String> set = new HashSet<String>();
set.add("W"); set.add("e"); set.add("C"); set.add("h"); set.add("a"); set.add("t");
set.add("W");
set.add("e");
set.add("C");
set.add("h");
set.add("a");
set.add("t");
boolean ret = mmkv.encode("string_set", set);
assertEquals(ret, true);

Expand Down Expand Up @@ -182,7 +187,12 @@ public void testRemove() {
ret &= mmkv.encode("string_1", "hello");

HashSet<String> set = new HashSet<String>();
set.add("W"); set.add("e"); set.add("C"); set.add("h"); set.add("a"); set.add("t");
set.add("W");
set.add("e");
set.add("C");
set.add("h");
set.add("a");
set.add("t");
ret &= mmkv.encode("string_set_1", set);

byte[] bytes = {'m', 'm', 'k', 'v'};
Expand All @@ -193,7 +203,7 @@ public void testRemove() {
long count = mmkv.count();

mmkv.removeValueForKey("bool_1");
mmkv.removeValuesForKeys(new String[]{"int_1", "long_1"});
mmkv.removeValuesForKeys(new String[] {"int_1", "long_1"});

long newCount = mmkv.count();
assertEquals(count, newCount + 3);
Expand Down
Loading

0 comments on commit 154d3e3

Please sign in to comment.