1 Star 1 Fork 135

juntt/Android_CN_OAID

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 3.14 KB
一键复制 编辑 原始数据 按行查看 历史
liyujiang 提交于 2020-07-15 14:24 . ci: 基于GIT版本进行版本管理
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
classpath "com.tencent.mm:AndResGuard-gradle-plugin:${andResGuardVersion}"
}
}
allprojects {
repositories {
//本地的Maven仓库:{USER_HOME}/.m2/repository,如C:/Users/Administrator/.m2/repository
mavenLocal()
//项目里的aar文件
flatDir { dirs "libs" }
//JitPack提供的Maven仓库
maven { url "https://jitpack.io" }
//JFrog公司提供的Maven仓库:https://jcenter.bintray.com
jcenter()
//谷歌公司提供的Maven仓库:https://maven.google.com
google()
//Sonatype公司提供的中央库:http://central.maven.org/maven2
mavenCentral()
}
}
subprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
//增加一些编译选项
//options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
task clean(type: Delete) {
println("********** clean build **********")
println("delete project dir:" + rootProject.buildDir)
rootProject.buildDir.deleteDir()
def dir = new File(new File(".").getAbsolutePath())
println(" root dir:" + dir.getAbsolutePath())
dir.eachDirRecurse {
dir2 ->
dir2.eachDirMatch(~/build/) {
directory ->
println("delete child dir:" + directory)
directory.deleteDir()
}
}
}
@SuppressWarnings(["GrMethodMayBeStatic", "unused"])
def gitGitCommitNumber() {
try {
// See https://www.jianshu.com/p/1f81af606e41
def cmd = 'git rev-list HEAD --first-parent --count'
return cmd.execute().text.trim().toInteger()
} catch (ignored) {
return 1
}
}
@SuppressWarnings(["GrMethodMayBeStatic", "unused"])
def getGitLatestTag() {
try {
// See https://www.jianshu.com/p/1f81af606e41
def cmd = 'git describe --tags'
return cmd.execute().text.trim()
} catch (ignored) {
return "1.0.0"
}
}
@SuppressWarnings(["GrMethodMayBeStatic", "unused"])
def getGitBranch() {
try {
// See https://www.jianshu.com/p/1f81af606e41
def cmd = 'git symbolic-ref --short -q HEAD'
return cmd.execute().text.trim()
} catch (ignored) {
return "unknown"
}
}
@SuppressWarnings(["GrMethodMayBeStatic", "unused"])
def getGitLatestCommitHash() {
try {
// See https://www.cnblogs.com/fuyaozhishang/p/7675551.html
def cmd = 'git rev-parse HEAD'
return cmd.execute().text.trim()
} catch (ignored) {
return "unknown"
}
}
@SuppressWarnings(["GrMethodMayBeStatic", "unused"])
def getGitLatestCommitHashShort() {
try {
// See https://www.jianshu.com/p/1f81af606e41
def cmd = 'git rev-parse --short HEAD'
return cmd.execute().text.trim()
} catch (ignored) {
return "unknown"
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Android
1
https://gitee.com/eijcang/Android_CN_OAID.git
git@gitee.com:eijcang/Android_CN_OAID.git
eijcang
Android_CN_OAID
Android_CN_OAID
master

搜索帮助