Skip to content

Commit d7f5046

Browse files
author
huangziwei
committed
修改gradle相关配置至高版本
1 parent 7f200d6 commit d7f5046

File tree

5 files changed

+7
-52
lines changed

5 files changed

+7
-52
lines changed

app/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion COMPILE_SDK_VERSION as int
5-
buildToolsVersion BUILD_TOOLS_VERSION
65

76
defaultConfig {
87
applicationId "cn.hzw.graffitidemo"

build.gradle

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,17 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
3-
4-
def getLocalProperty(String key) {
5-
if (!localPropertiesFile().exists()) {
6-
return null
7-
}
8-
9-
Properties properties = new Properties()
10-
properties.load(localPropertiesFile().newDataInputStream())
11-
return properties.getProperty(key)
12-
}
13-
14-
def localPropertiesFile() {
15-
return project.rootProject.file('local.properties');
16-
}
17-
18-
def isForUpload2Maven() {
19-
return getLocalProperty("for.upload") == "true"
20-
}
21-
221
buildscript {
232
repositories {
3+
google()
244
jcenter()
255
}
266
dependencies {
27-
classpath 'com.android.tools.build:gradle:2.2.3'
28-
29-
// NOTE: Do not place your application dependencies here; they belong
30-
// in the individual module build.gradle files
31-
32-
File file = project.rootProject.file('local.properties')
33-
if (file.exists()) {
34-
Properties properties = new Properties()
35-
properties.load(file.newDataInputStream())
36-
boolean upload2maven = properties.getProperty("for.upload") == "true"
37-
if (upload2maven) {
38-
println 'upload2maven:true'
39-
//用于上传Maven生成的文件到Bintray
40-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
41-
//用于打包Maven所需文件
42-
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
43-
} else {
44-
println 'upload2maven:false'
45-
}
46-
}
7+
classpath 'com.android.tools.build:gradle:3.1.3'
478
}
489
}
4910

5011
allprojects {
5112
repositories {
5213
jcenter()
14+
google()
5315
}
5416
}
5517

gradle.properties

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
MIN_SDK_VERSION=14
2-
TARGET_SDK_VERSION=22
2+
TARGET_SDK_VERSION=27
33

44
VERSION_NAME=v5.0
55
VERSION_CODE=20
6-
BUILD_TOOLS_VERSION=23.0.2
7-
COMPILE_SDK_VERSION=23
6+
COMPILE_SDK_VERSION=27
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Mon Dec 28 10:00:20 PST 2015
1+
#Thu Jul 19 11:57:35 CST 2018
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

graffiti/build.gradle

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

33
android {
44
compileSdkVersion COMPILE_SDK_VERSION as int
5-
buildToolsVersion BUILD_TOOLS_VERSION
65

76
defaultConfig {
87
minSdkVersion MIN_SDK_VERSION as int
@@ -21,8 +20,4 @@ android {
2120
dependencies {
2221
// https://github.com/1993hzw/Androids
2322
compile 'com.forward.androids:androids:1.2.1'
24-
}
25-
26-
if (isForUpload2Maven()) {
27-
apply from: "https://raw.githubusercontent.com/1993hzw/common/master/bintrayUpload.gradle"
2823
}

0 commit comments

Comments
 (0)