// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenLocal()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
classpath "com.github.dcendents:android-maven-gradle-plugin:1.4.1"
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
}
tasks.withType(Javadoc).all {
enabled = false
options.setEncoding('UTF-8')
}
}
ext {
minSdkVersion = 10
compileSdkVersion = 23
targetSdkVersion = compileSdkVersion
buildToolsVersion = '23.0.2'
supportLibVersion = '23.0.1'
javaVersion = JavaVersion.VERSION_1_7
GROUP = 'com.tencent.tinker'
VERSION_NAME = "${VERSION_NAME_PREFIX}${VERSION_NAME_SUFFIX}"
POM_PACKAGING = "pom"
POM_DESCRIPTION= "tinker"
POM_URL = "https://github.com/Tencent/tinker"
POM_SCM_URL = "https://github.com/Tencent/tinker.git"
POM_ISSUE_URL = 'https://github.com/Tencent/tinker/issues'
POM_LICENCE_NAME = "BSD License"
POM_LICENCE_URL = "https://opensource.org/licenses/BSD-3-Clause"
POM_LICENCE_DIST = "repo"
POM_DEVELOPER_ID="Tencent Wechat"
POM_DEVELOPER_NAME="Tencent Wechat, Inc."
BINTRAY_LICENCE= ['BSD 3-Clause']
BINTRAY_ORGANIZATION = "tinker"
}
buildscript
聲明的是gradle腳本自身需要使用的資源。repositories
配置該想項目需要的存儲庫-
dependencies
配置該項目的依賴項
image.png
image.png allprojects
配置該項目以及每一個子項目tasks
項目本質上是任務對象的集合。每個任務執行一些基本的工作,例如編譯類、運行單元測試或壓縮WAR文件。ext
Gradle領域對象的一個屬性,我們將自定義的屬性添加到ext對象上,Build.gradle中的其它片段可以使用