Skip to content

Commit 4ab2c19

Browse files
committed
修改发版
1 parent 7b091f3 commit 4ab2c19

File tree

11 files changed

+57
-26
lines changed

11 files changed

+57
-26
lines changed

.idea/gradle.xml

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

+10-6
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,39 @@ apply plugin: 'com.android.application'
33
android {
44
compileSdkVersion 29
55
buildToolsVersion "29.0.2"
6+
67
defaultConfig {
78
applicationId "vip.ruoyun.mekv.demo"
89
minSdkVersion 16
910
targetSdkVersion 29
1011
versionCode 1
1112
versionName "1.0"
1213
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13-
javaCompileOptions {
14-
annotationProcessorOptions {
15-
// arguments[argumentIncremental] = 'true'
16-
}
17-
}
1814
}
1915
buildTypes {
2016
release {
2117
minifyEnabled false
2218
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2319
}
2420
}
21+
lintOptions {
22+
abortOnError false
23+
disable 'TypographyFractions','TypographyQuotes'
24+
}
2525
}
2626

2727
dependencies {
2828
implementation fileTree(dir: 'libs', include: ['*.jar'])
29-
implementation 'androidx.appcompat:appcompat:1.0.2'
29+
implementation 'androidx.appcompat:appcompat:1.1.0'
3030
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
3131
testImplementation 'junit:junit:4.12'
3232
androidTestImplementation 'androidx.test:runner:1.1.1'
3333
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
3434

35+
// implementation 'vip.ruoyun.mekv:mekv-core:1.0.0'
36+
// implementation 'vip.ruoyun.mekv:mekv-annotation:1.0.0'
37+
// annotationProcessor 'vip.ruoyun.mekv:mekv-compiler:1.0.0'
38+
3539
implementation project(path: ':mekv')
3640
annotationProcessor project(path: ':mekv-processor')
3741

app/src/main/java/vip/ruoyun/mekv/demo/MainActivity.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,13 @@ protected void onCreate(Bundle savedInstanceState) {
2121
//多次操作,先获取,在保存
2222
User user = UserMeKV.getUser();
2323
if (user != null) {
24-
24+
user.setName("");
25+
user.getName();
26+
UserMeKV.saveUser(user);
2527
}
26-
user.setName("");
27-
user.getName();
28-
UserMeKV.saveUser(user);
2928
UserMeKV.remove();
3029
User user1 = MMKV.defaultMMKV().decodeParcelable("", User.class);
3130

32-
3331
PeopleMeKV.saveName("value");//保存
3432
PeopleMeKV.getName();//获取
3533
PeopleMeKV.removeName();//删除对应的字段信息

build.gradle

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ buildscript {
44
repositories {
55
google()
66
jcenter()
7+
maven { url "https://dl.bintray.com/bugyun/maven" } //我的仓库,如果 jcenter 能找到,就不要添加
78

89
}
910
dependencies {
10-
// classpath 'com.android.tools.build:gradle:3.5.0'
11-
classpath 'com.android.tools.build:gradle:3.6.0-alpha11'
11+
classpath 'com.android.tools.build:gradle:3.5.0'
12+
// classpath 'com.android.tools.build:gradle:3.6.0-alpha11'
1213
classpath 'com.novoda:bintray-release:0.9.1'
1314

1415
// NOTE: Do not place your application dependencies here; they belong
@@ -20,7 +21,7 @@ allprojects {
2021
repositories {
2122
google()
2223
jcenter()
23-
24+
maven { url "https://dl.bintray.com/bugyun/maven" } //我的仓库,如果 jcenter 能找到,就不要添加
2425
}
2526
}
2627

mekv-annotations/build.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
apply plugin: 'java-library'
2+
apply from: 'jcenter.gradle'//上传 jcenter 的插件
3+
24

35
dependencies {
4-
implementation fileTree(dir: 'libs', include: ['*.jar'])
6+
// implementation fileTree(dir: 'libs', include: ['*.jar'])
57
}
68

79
sourceCompatibility = "7"

mekv-annotations/jcenter.gradle

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//上传 jcenter 的插件
2+
apply plugin: 'com.novoda.bintray-release' // 新增
3+
4+
/**
5+
* 参考
6+
* 'com.android.support.test.espresso:espresso-core:3.0.2'
7+
* group: 'com.android.support.test.espresso', name: 'espresso-core', version: '3.0.2'
8+
*/
9+
10+
// 新增
11+
publish {
12+
userOrg = 'bugyun' //bintray.com用户名
13+
groupId = 'vip.ruoyun.mekv' //jcenter group
14+
artifactId = 'mekv-annotation' //项目名称 name
15+
publishVersion = '1.0.0'//版本号 version
16+
desc = 'Android Key-Value 管理框架'//描述
17+
website = 'https://github.com/bugyun/MeKV' // github 网址
18+
}
19+
20+
// ./gradlew clean build bintrayUpload -PbintrayUser=bintray.user -PbintrayKey=bintray.apikey -PdryRun=false

mekv-processor/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ targetCompatibility = "7"
66

77
dependencies {
88
implementation 'com.squareup:javapoet:1.11.1'
9-
implementation project(':mekv-annotations')
9+
implementation 'vip.ruoyun.mekv:mekv-annotation:1.0.0'
1010
}
1111

mekv/build.gradle

+9-5
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ android {
2020
}
2121
}
2222

23-
compileOptions {
24-
sourceCompatibility JavaVersion.VERSION_1_8
25-
targetCompatibility JavaVersion.VERSION_1_8
26-
}
23+
// compileOptions {
24+
// sourceCompatibility JavaVersion.VERSION_1_8
25+
// targetCompatibility JavaVersion.VERSION_1_8
26+
// }
2727

28+
lintOptions {
29+
abortOnError false
30+
}
2831
}
2932

3033
dependencies {
34+
api fileTree(dir: 'libs', include: ['*.jar'])
3135
api 'com.tencent:mmkv:1.0.23'
32-
api project(path: ':mekv-annotations')
36+
api 'vip.ruoyun.mekv:mekv-annotation:1.0.0'
3337
}

mekv/src/main/java/vip/ruoyun/mekv/IMeKVStrategy.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ public interface IMeKVStrategy<E> {
1515
*
1616
* @param key key
1717
* @param src 要保存的 bean
18-
* @param <T> 传入字符的泛型
1918
*/
20-
<T extends E> boolean encode(String key, T src);
19+
boolean encode(String key, E src);
2120

2221
/**
2322
* 解码

mekv/src/main/java/vip/ruoyun/mekv/MMKVStrategy.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public MMKVStrategy(MMKV mmkv) {
2626

2727

2828
@Override
29-
public <T extends Parcelable> boolean encode(final String key, final T src) {
29+
public boolean encode(final String key, final Parcelable src) {
3030
return mmkv.encode(key, src);
3131
}
3232

0 commit comments

Comments
 (0)