Skip to content

Commit 6176639

Browse files
authored
Merge pull request #17 from emanonwzy/upgrade
enhance: 升级 okhttp 以及相应的 minsdk
2 parents 1bfdf99 + d8acad7 commit 6176639

File tree

9 files changed

+244
-34
lines changed

9 files changed

+244
-34
lines changed

base.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ android {
1818

1919
}
2020

21-
apply from: 'https://github.com/mcxiaoke/gradle-mvn-push/raw/master/gradle-mvn-push.gradle'
21+
apply from: '../gradle-mvn-push.gradle'

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
3-
ext.support_version = '27.1.1'
3+
ext.support_version = '28.0.0'
44

55
repositories {
66
jcenter()
@@ -10,7 +10,7 @@ buildscript {
1010
}
1111

1212
dependencies {
13-
classpath 'com.android.tools.build:gradle:3.1.3'
13+
classpath 'com.android.tools.build:gradle:4.0.1'
1414
}
1515
}
1616

core/src/main/java/com/mcxiaoke/next/geo/LastLocationFinder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
public class LastLocationFinder {
2929

3030
protected static String TAG = LastLocationFinder.class.getSimpleName();
31-
protected static String SINGLE_LOCATION_UPDATE_ACTION = BuildConfig.APPLICATION_ID
31+
protected static String SINGLE_LOCATION_UPDATE_ACTION = BuildConfig.LIBRARY_PACKAGE_NAME
3232
+ ".action.SINGLE_LOCATION_UPDATE_ACTION";
3333

3434
protected PendingIntent pendingIntent;

gradle-mvn-push.gradle

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
/*
2+
* Copyright 2013 Chris Banes
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
apply plugin: 'maven'
18+
apply plugin: 'signing'
19+
20+
version = VERSION_NAME
21+
group = GROUP
22+
23+
def isReleaseBuild() {
24+
return VERSION_NAME.contains("SNAPSHOT") == false
25+
}
26+
27+
def getReleaseRepositoryUrl() {
28+
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
29+
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
30+
}
31+
32+
def getSnapshotRepositoryUrl() {
33+
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
34+
: "https://oss.sonatype.org/content/repositories/snapshots/"
35+
}
36+
37+
def getRepositoryUsername() {
38+
return hasProperty('USERNAME') ? USERNAME : (hasProperty('NEXUS_USERNAME')?NEXUS_USERNAME:"")
39+
}
40+
41+
def getRepositoryPassword() {
42+
return hasProperty('PASSWORD') ? PASSWORD : (hasProperty('NEXUS_PASSWORD')?NEXUS_PASSWORD:"")
43+
}
44+
45+
afterEvaluate { project ->
46+
uploadArchives {
47+
repositories {
48+
mavenDeployer {
49+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
50+
51+
pom.groupId = GROUP
52+
pom.artifactId = POM_ARTIFACT_ID
53+
pom.version = VERSION_NAME
54+
55+
repository(url: getReleaseRepositoryUrl()) {
56+
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
57+
}
58+
snapshotRepository(url: getSnapshotRepositoryUrl()) {
59+
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
60+
}
61+
62+
pom.project {
63+
name POM_NAME
64+
packaging POM_PACKAGING
65+
description POM_DESCRIPTION
66+
url POM_URL
67+
68+
scm {
69+
url POM_SCM_URL
70+
connection POM_SCM_CONNECTION
71+
developerConnection POM_SCM_DEV_CONNECTION
72+
}
73+
74+
licenses {
75+
license {
76+
name POM_LICENCE_NAME
77+
url POM_LICENCE_URL
78+
distribution POM_LICENCE_DIST
79+
}
80+
}
81+
82+
developers {
83+
developer {
84+
id POM_DEVELOPER_ID
85+
name POM_DEVELOPER_NAME
86+
}
87+
}
88+
}
89+
}
90+
}
91+
}
92+
93+
signing {
94+
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
95+
sign configurations.archives
96+
}
97+
98+
if (project.getPlugins().hasPlugin('com.android.application') || project.getPlugins().hasPlugin('com.android.library')) {
99+
task install(type: Upload, dependsOn: assemble) {
100+
repositories.mavenInstaller {
101+
configuration = configurations.archives
102+
103+
pom.groupId = GROUP
104+
pom.artifactId = POM_ARTIFACT_ID
105+
pom.version = VERSION_NAME
106+
107+
pom.project {
108+
name POM_NAME
109+
packaging POM_PACKAGING
110+
description POM_DESCRIPTION
111+
url POM_URL
112+
113+
scm {
114+
url POM_SCM_URL
115+
connection POM_SCM_CONNECTION
116+
developerConnection POM_SCM_DEV_CONNECTION
117+
}
118+
119+
licenses {
120+
license {
121+
name POM_LICENCE_NAME
122+
url POM_LICENCE_URL
123+
distribution POM_LICENCE_DIST
124+
}
125+
}
126+
127+
developers {
128+
developer {
129+
id POM_DEVELOPER_ID
130+
name POM_DEVELOPER_NAME
131+
}
132+
}
133+
}
134+
}
135+
}
136+
137+
task androidJavadocs(type: Javadoc) {
138+
failOnError false
139+
source = android.sourceSets.main.java.source
140+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
141+
}
142+
143+
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
144+
classifier = 'javadoc'
145+
from androidJavadocs.destinationDir
146+
}
147+
148+
task androidSourcesJar(type: Jar) {
149+
classifier = 'sources'
150+
from android.sourceSets.main.java.source
151+
}
152+
} else {
153+
install {
154+
repositories.mavenInstaller {
155+
pom.groupId = GROUP
156+
pom.artifactId = POM_ARTIFACT_ID
157+
pom.version = VERSION_NAME
158+
159+
pom.project {
160+
name POM_NAME
161+
packaging POM_PACKAGING
162+
description POM_DESCRIPTION
163+
url POM_URL
164+
165+
scm {
166+
url POM_SCM_URL
167+
connection POM_SCM_CONNECTION
168+
developerConnection POM_SCM_DEV_CONNECTION
169+
}
170+
171+
licenses {
172+
license {
173+
name POM_LICENCE_NAME
174+
url POM_LICENCE_URL
175+
distribution POM_LICENCE_DIST
176+
}
177+
}
178+
179+
developers {
180+
developer {
181+
id POM_DEVELOPER_ID
182+
name POM_DEVELOPER_NAME
183+
}
184+
}
185+
}
186+
}
187+
}
188+
189+
task sourcesJar(type: Jar, dependsOn:classes) {
190+
classifier = 'sources'
191+
from sourceSets.main.allSource
192+
}
193+
194+
task javadocJar(type: Jar, dependsOn:javadoc) {
195+
classifier = 'javadoc'
196+
from javadoc.destinationDir
197+
}
198+
}
199+
200+
artifacts {
201+
if (project.getPlugins().hasPlugin('com.android.application') || project.getPlugins().hasPlugin('com.android.library')) {
202+
archives androidSourcesJar
203+
archives androidJavadocsJar
204+
} else {
205+
archives sourcesJar
206+
archives javadocJar
207+
}
208+
}
209+
}

gradle.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
VERSION_NAME=1.5.4
2-
VERSION_CODE=1504
1+
VERSION_NAME=1.6.0
2+
VERSION_CODE=1600
33
GROUP=com.mcxiaoke.next
44

55
POM_DESCRIPTION=Android Next Components: Cache, Task, Views, Widgets, Utils
@@ -14,8 +14,8 @@ POM_DEVELOPER_ID=mcxiaoke
1414
POM_DEVELOPER_NAME=Xiaoke Zhang
1515
POM_DEVELOPER_EMAIL=mail@mcxiaoke.com
1616

17-
ANDROID_BUILD_TARGET_SDK_VERSION=27
18-
ANDROID_BUILD_TOOLS_VERSION=27.0.3
19-
ANDROID_BUILD_SDK_VERSION=27
17+
ANDROID_BUILD_TARGET_SDK_VERSION=29
18+
ANDROID_BUILD_TOOLS_VERSION=29.0.2
19+
ANDROID_BUILD_SDK_VERSION=29
2020

21-
ANDROID_BUILD_MIN_SDK_VERSION=10
21+
ANDROID_BUILD_MIN_SDK_VERSION=21
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Tue Jul 21 14:07:20 CST 2020
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
34
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

http/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ apply plugin: 'com.android.library'
33
dependencies {
44
implementation project(":core")
55
implementation project(":task")
6-
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
7-
implementation 'com.google.code.gson:gson:2.8.2'
6+
implementation 'com.squareup.okhttp3:okhttp:4.8.0'
7+
implementation 'com.google.code.gson:gson:2.8.6'
88

9-
testImplementation 'com.google.code.gson:gson:2.8.2'
9+
testImplementation 'com.google.code.gson:gson:2.8.6'
1010
testImplementation 'junit:junit:4.12'
1111
testImplementation 'org.mockito:mockito-core:2.18.3'
1212
androidTestImplementation 'com.android.support.test:runner:1.0.2'

samples/build.gradle

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
apply plugin: 'com.android.application'
22

33
dependencies {
4-
compile fileTree(dir: 'libs', include: ['*.jar'])
5-
compile project(":core")
6-
compile project(":task")
7-
compile project(":http")
8-
compile project(":ui")
9-
compile project(":recycler")
10-
compile 'com.mcxiaoke.volley:library:1.0.18'
11-
compile "com.jakewharton:butterknife:8.8.1"
12-
compile "com.android.support:support-v4:$support_version"
13-
compile "com.android.support:recyclerview-v7:$support_version"
14-
compile "com.android.support:appcompat-v7:$support_version"
15-
compile "com.android.support:design:$support_version"
16-
compile 'com.google.code.gson:gson:2.8.2'
17-
compile 'io.reactivex:rxjava:1.0.12'
18-
compile 'io.reactivex:rxandroid:0.25.0'
4+
implementation fileTree(dir: 'libs', include: ['*.jar'])
5+
implementation project(":core")
6+
implementation project(":task")
7+
implementation project(":http")
8+
implementation project(":ui")
9+
implementation project(":recycler")
10+
implementation 'com.mcxiaoke.volley:library:1.0.18'
11+
implementation "com.jakewharton:butterknife:8.8.1"
12+
implementation "com.android.support:support-v4:$support_version"
13+
implementation "com.android.support:recyclerview-v7:$support_version"
14+
implementation "com.android.support:appcompat-v7:$support_version"
15+
implementation "com.android.support:design:$support_version"
16+
implementation 'com.google.code.gson:gson:2.8.6'
17+
implementation 'io.reactivex:rxjava:1.0.12'
18+
implementation 'io.reactivex:rxandroid:0.25.0'
1919

2020
annotationProcessor "com.jakewharton:butterknife-compiler:8.8.1"
2121
}
2222

2323
android {
2424

2525
compileOptions {
26-
sourceCompatibility JavaVersion.VERSION_1_7
27-
targetCompatibility JavaVersion.VERSION_1_7
26+
sourceCompatibility JavaVersion.VERSION_1_8
27+
targetCompatibility JavaVersion.VERSION_1_8
2828
}
2929

3030
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
@@ -34,7 +34,7 @@ android {
3434

3535
defaultConfig {
3636
applicationId GROUP
37-
minSdkVersion 14
37+
minSdkVersion 21
3838
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
3939
}
4040

task/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apply plugin: 'com.android.library'
22

33
dependencies {
44
// compile project(":core")
5-
testCompile 'junit:junit:4.12'
6-
testCompile 'org.mockito:mockito-core:2.18.3'
5+
testImplementation 'junit:junit:4.12'
6+
testImplementation 'org.mockito:mockito-core:2.18.3'
77
}
88

99
apply from: '../base.gradle'

0 commit comments

Comments
 (0)