Skip to content

Commit

Permalink
修改gradle相关配置至高版本
Browse files Browse the repository at this point in the history
  • Loading branch information
huangziwei committed Jul 19, 2018
1 parent 7f200d6 commit d7f5046
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 52 deletions.
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOLS_VERSION

defaultConfig {
applicationId "cn.hzw.graffitidemo"
Expand Down
44 changes: 3 additions & 41 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,55 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.


def getLocalProperty(String key) {
if (!localPropertiesFile().exists()) {
return null
}

Properties properties = new Properties()
properties.load(localPropertiesFile().newDataInputStream())
return properties.getProperty(key)
}

def localPropertiesFile() {
return project.rootProject.file('local.properties');
}

def isForUpload2Maven() {
return getLocalProperty("for.upload") == "true"
}

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

File file = project.rootProject.file('local.properties')
if (file.exists()) {
Properties properties = new Properties()
properties.load(file.newDataInputStream())
boolean upload2maven = properties.getProperty("for.upload") == "true"
if (upload2maven) {
println 'upload2maven:true'
//用于上传Maven生成的文件到Bintray
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
//用于打包Maven所需文件
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
} else {
println 'upload2maven:false'
}
}
classpath 'com.android.tools.build:gradle:3.1.3'
}
}

allprojects {
repositories {
jcenter()
google()
}
}

Expand Down
5 changes: 2 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
MIN_SDK_VERSION=14
TARGET_SDK_VERSION=22
TARGET_SDK_VERSION=27

VERSION_NAME=v5.0
VERSION_CODE=20
BUILD_TOOLS_VERSION=23.0.2
COMPILE_SDK_VERSION=23
COMPILE_SDK_VERSION=27
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Thu Jul 19 11:57:35 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
5 changes: 0 additions & 5 deletions graffiti/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apply plugin: 'com.android.library'

android {
compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOLS_VERSION

defaultConfig {
minSdkVersion MIN_SDK_VERSION as int
Expand All @@ -21,8 +20,4 @@ android {
dependencies {
// https://github.com/1993hzw/Androids
compile 'com.forward.androids:androids:1.2.1'
}

if (isForUpload2Maven()) {
apply from: "https://raw.githubusercontent.com/1993hzw/common/master/bintrayUpload.gradle"
}

0 comments on commit d7f5046

Please sign in to comment.