// 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 { mavenLocal() 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/' } maven { url "https://artifact.bytedance.com/repository/Volcengine/" } maven { url "https://artifact.bytedance.com/repository/byteX/" } // mavenCentral() google() } dependencies { classpath 'com.android.tools.build:gradle:3.5.3' classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30' classpath "com.alibaba:arouter-register:1.0.12-mogo" classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4' classpath 'com.tencent.bugly:symtabfileuploader:2.2.1' classpath "com.bytedance.android.byteX:base-plugin:0.3.0" classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}" classpath "com.mogo.cloud:bizconfig:${BIZCONFIG_VERSION}" classpath 'com.volcengine:apm_insight_plugin:1.4.1' classpath "com.mogo.thread.opt:plg:${THREAD_OPT_VERSION}" classpath 'com.mogo.cloud:systrace:1.0.1' classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18' classpath 'com.mogo.sticky:service:1.0.8' classpath 'io.github.knight-zxw:lancet-plugin:0.0.1' // classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true } } // 遇无法更新依赖情况(针对Snapshot无法刷新)然后sync project即可,刷新完成注释该代码 // configurations.all { // // 缓存时间设置为0,立即更新 // resolutionStrategy.cacheChangingModulesFor 0, 'seconds' // } } allprojects { repositories { mavenLocal() maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'http://maven.aliyun.com/nexus/content/groups/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' } // mavenCentral() maven { url 'http://nexus.zhidaoauto.com/repository/maven-releases/' } maven { url 'http://nexus.zhidaoauto.com/repository/maven-public/' } maven { url "https://artifact.bytedance.com/repository/Volcengine/" } maven { url "https://artifact.bytedance.com/repository/byteX/" } 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' } } } } subprojects.each { Class kotlinCompile = null try { kotlinCompile = Class.forName("org.jetbrains.kotlin.gradle.tasks.KotlinCompile") } catch (Throwable t) { t.printStackTrace() } if (kotlinCompile != null) { it.tasks.withType(kotlinCompile).configureEach { kotlinOptions { jvmTarget = '1.8' freeCompilerArgs += ["-Xopt-in=kotlin.RequiresOptIn"] } } } }