Files
MoGoEagleEye/build.gradle
2021-09-07 01:30:33 +08:00

89 lines
3.0 KiB
Groovy

// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: "config.gradle"
apply from: "javadoc.gradle"
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://nexus.zhidaoauto.com/repository/maven-releases/' }
maven { url 'https://nexus.zhidaoauto.com/repository/maven-public/' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20'
classpath "com.alibaba:arouter-register:1.0.2"
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4'
// classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true }
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://nexus.zhidaoauto.com/repository/maven-releases/' }
maven { url 'http://nexus.zhidaoauto.com/repository/maven-public/' }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
task cleanAll(type: Delete) {
group = "custom"
rootProject.allprojects {
//println "delete ${it.buildDir}"
delete it.buildDir
}
}
def getValueFromRootProperties(String key) {
File file = rootProject.file('gradle.properties')
String value = "";
if (file.exists()) {
//加载资源
InputStream inputStream = file.newDataInputStream();
Properties properties = new Properties()
properties.load(inputStream)
if (properties.containsKey(key)) {
value = properties.getProperty(key)
}
}
return value
}
afterEvaluate {
rootProject.subprojects { project ->
project.afterEvaluate {
dependencies {
components {
all { ComponentMetadataDetails details ->
if (details.toString().endsWith("-SNAPSHOT")) {
details.changing = true
}
}
}
}
it.configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
}
}
}