Files
MoGoEagleEye/build.gradle
2022-03-10 11:49:41 +08:00

135 lines
4.7 KiB
Groovy
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 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://artifact.bytedance.com/repository/byteX/" }
maven { url 'http://nexus.zhidaoauto.com/repository/maven-releases/' }
maven { url 'http://nexus.zhidaoauto.com/repository/maven-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.4.31'
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:latest.release'
classpath "com.bytedance.android.byteX:base-plugin:0.3.0"
classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
classpath 'com.volcengine:apm_insight_plugin:1.4.1'
classpath 'com.mogo.cloud:thread_opt:1.0.1'
classpath 'com.mogo.cloud:systrace:1.0.1'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
// classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true }
}
// 遇无法更新依赖情况针对Snapshot无法刷新然后sync project即可刷新完成注释该代码
// configurations.all {
// // 缓存时间设置为0立即更新
// resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
// }
}
allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/public' }
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/' }
maven { url "https://artifact.bytedance.com/repository/byteX/" }
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/"
}
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"]
}
}
}
}