-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathbuild.gradle
66 lines (56 loc) · 2.4 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// SunnyBeach-Kotlin 版本
// 导入配置文件
apply from: 'configs.gradle'
buildscript {
// 导入通用的 Maven 库配置
apply from: 'maven.gradle'
ext.kotlin_version = "1.9.22"
ext.agcp_version = "1.9.1.303"
ext.hilt_version = "2.47"
ext.android_aop_version = "1.4.7"
repositories {
// 阿里云云效仓库(Gradle 插件):https://maven.aliyun.com/mvn/guide
// 可能会出现编译错误:Could not find android-aop-plugin-1.4.0.jar (io.github.FlyJingFish.AndroidAop:android-aop-plugin:1.4.0)
// maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven { url 'https://mirrors.cloud.tencent.com/gradle/' }
// maven { url 'https://services.gradle.org/distributions/' }
addCommonMaven(repositories)
}
// Studio 插件推荐:https://github.com/getActivity/StudioPlugins
dependencies {
// Gradle 插件版本说明:https://developer.android.google.cn/studio/releases/gradle-plugin.html#updating-plugin
classpath 'com.android.tools.build:gradle:8.5.0'
// Kotlin 插件:https://plugins.jetbrains.com/plugin/6954-kotlin
// noinspection GradleDependency
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:1.9.22-1.0.17"
classpath "io.github.FlyJingFish.AndroidAop:android-aop-plugin:${android_aop_version}"
// 增加agcp插件配置
classpath "com.huawei.agconnect:agcp:$agcp_version"
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
}
}
allprojects {
repositories {
// 友盟远程仓库:https://info.umeng.com/detail?id=443&cateId=1
maven { url 'https://repo1.maven.org/maven2' }
addCommonMaven(repositories)
}
tasks.withType(JavaCompile).configureEach {
// 设置全局编码
options.encoding = 'UTF-8'
}
tasks.withType(Javadoc).configureEach {
// 设置文档编码
options {
encoding 'UTF-8'
charSet 'UTF-8'
links 'http://docs.oracle.com/javase/7/docs/api'
}
}
// 将构建文件统一输出到项目根目录下的 build 文件夹
layout.buildDirectory.set(file("$rootDir/build/${path.replace(':', '/')}"))
}
tasks.register('clean', Delete) {
delete rootProject.layout.buildDirectory
}