// 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 { ext.kotlin_version = '1.3.61+' repositories { maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'http://nexus.zhidaoauto.com/repository/maven-releases/' } maven { url 'http://nexus.zhidaoauto.com/repository/maven-public/' } google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.5.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "com.alibaba:arouter-register:1.0.2" // 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 'http://nexus.zhidaoauto.com/repository/maven-releases/' } maven { url 'http://nexus.zhidaoauto.com/repository/maven-public/' } google() jcenter() // flatDir { // 由于Library module中引用了 youkuplayer 库的 aar,在多 module 的情况下, // 其他的module编译会报错,所以需要在所有工程的repositories // 下把Library module中的libs目录添加到依赖关系中 // dirs project(':libraries:map-baidu').file('libs') // } } } task clean(type: Delete) { delete rootProject.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' } } } }