Skip to content

Commit b030c38

Browse files
committed
从 JCenter 迁移到 JitPack
1 parent 8abd583 commit b030c38

File tree

6 files changed

+54
-35
lines changed

6 files changed

+54
-35
lines changed

.gitignore

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
/.gradle
2-
/.idea
3-
/build
4-
*/build
5-
/captures
6-
/.cxx
7-
*/.cxx
8-
/.externalNativeBuild
1+
.gradle
2+
.idea
3+
.cxx
4+
.externalNativeBuild
5+
build
6+
captures
97

108
._*
119
*.iml

README.md

+26-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,36 @@
22

33
* 码云地址:[Gitee](https://gitee.com/getActivity/GsonFactory)
44

5-
#### Gradle 集成
5+
#### 集成步骤
6+
7+
* 在项目根目录下的 `build.gradle` 文件中加入
68

79
```groovy
10+
buildscript {
11+
......
12+
}
13+
allprojects {
14+
repositories {
15+
// JitPack 远程仓库:https://jitpack.io
16+
maven { url 'https://jitpack.io' }
17+
}
18+
}
19+
```
20+
21+
* 在项目 app 模块下的 `build.gradle` 文件中加入
22+
23+
```groovy
24+
android {
25+
// 支持 JDK 1.8
26+
compileOptions {
27+
targetCompatibility JavaVersion.VERSION_1_8
28+
sourceCompatibility JavaVersion.VERSION_1_8
29+
}
30+
}
31+
832
dependencies {
933
// Gson 解析容错:https://github.com/getActivity/GsonFactory
10-
implementation 'com.hjq.gson:factory:5.2'
34+
implementation 'com.github.getActivity:GsonFactory:5.2'
1135
// Json 解析框架:https://github.com/google/gson
1236
implementation 'com.google.code.gson:gson:2.8.5'
1337
}

app/src/main/res/values/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<resources>
2-
<string name="app_name">GsonFactoryDemo</string>
2+
<string name="app_name">GsonFactory</string>
33
</resources>

build.gradle

+16-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
31
buildscript {
42
repositories {
5-
jcenter()
3+
// 阿里云云效仓库:https://maven.aliyun.com/mvn/guide
4+
maven { url 'https://maven.aliyun.com/repository/jcenter' }
5+
maven { url 'https://maven.aliyun.com/repository/google' }
6+
// 华为开源镜像:https://mirrors.huaweicloud.com/
7+
maven { url 'https://repo.huaweicloud.com/repository/maven/' }
8+
// JitPack 远程仓库:https://jitpack.io
9+
maven { url 'https://jitpack.io' }
10+
mavenCentral()
611
google()
12+
jcenter()
713
}
814
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.4.0'
10-
classpath 'com.novoda:bintray-release:0.9.2'
15+
classpath 'com.android.tools.build:gradle:4.1.2'
1116
}
1217
}
1318

1419
allprojects {
1520
repositories {
16-
jcenter()
21+
maven { url 'https://maven.aliyun.com/repository/jcenter' }
22+
maven { url 'https://maven.aliyun.com/repository/google' }
23+
maven { url 'https://repo.huaweicloud.com/repository/maven/' }
24+
maven { url 'https://jitpack.io' }
25+
mavenCentral()
1726
google()
18-
maven {url "https://jitpack.io"}
27+
jcenter()
1928
}
2029
}
2130

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Wed Jul 18 11:21:06 CST 2018
2-
distributionBase=GRADLE_USER_HOME
3-
distributionPath=wrapper/dists
4-
zipStoreBase=GRADLE_USER_HOME
5-
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
1+
zipStoreBase = GRADLE_USER_HOME
2+
zipStorePath = wrapper/dists
3+
distributionBase = GRADLE_USER_HOME
4+
distributionPath = wrapper/dists
5+
distributionUrl = https\://services.gradle.org/distributions/gradle-6.5-all.zip

library/build.gradle

-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
//文件开头配置
21
apply plugin: 'com.android.library'
3-
apply plugin: 'com.novoda.bintray-release'
42

53
android {
64
compileSdkVersion 26
@@ -18,15 +16,6 @@ dependencies {
1816
implementation 'com.google.code.gson:gson:2.8.5'
1917
}
2018

21-
publish {
22-
userOrg = 'getactivity'
23-
groupId = 'com.hjq.gson'
24-
artifactId = 'factory'
25-
publishVersion = '5.2'
26-
desc = 'Gson parsing fault-tolerant framework'
27-
website = "https://github.com/getActivity/GsonFactory"
28-
}
29-
3019
// 防止编码问题
3120
tasks.withType(Javadoc) {
3221
options.addStringOption('Xdoclint:none', '-quiet')

0 commit comments

Comments
 (0)