-
Notifications
You must be signed in to change notification settings - Fork 478
/
build.gradle
84 lines (71 loc) · 2.1 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
buildscript {
repositories {
maven {
url = uri("$rootDir/repo")
}
google()
mavenCentral()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
//https://developer.android.com/studio/releases/gradle-plugin?hl=zh-cn
classpath "com.android.tools.build:gradle:$agp_version"
classpath Deps.kotlinPlugin
//protocol buffer插件:https://github.com/google/protobuf-gradle-plugin
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.17'
//classpath 'com.fastgo:plugin:1.0-test'
// classpath 'com.performance.optimize:lib_bytecode:1.0.0'
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
//-------配置完成后,可以通过Task.getTaskGraph()获取Task有向无环图-------
//TaskExecutionGraph graph = gradle.getTaskGraph()
//graph.whenReady {
// println("whenReady")
//}
//graph.beforeTask {Task task -> println("任务名称:${task.name} beforeTask")}
//graph.afterTask {Task task -> println("任务名称:${task.name} afterTask")}
//1、直接在build.gradle中定义插件
//apply plugin: GreetingPlugin
//class GreetingPlugin implements Plugin<Project> {
//
// @Override
// void apply(Project project) {
// project.task('hello') {
// doLast {
// println 'Hello from the GreetingPlugin'
// }
// }
// }
//}
//2、在rootProject/buildSrc/main/groovy中定义插件
//apply plugin: GreetingExtensionPlugin
//
//greeting {
// message = 'hello'
// greeter = 'GreetingExtensionPlugin'
//}
//3、定义在单独的moudle中并发布
// apply plugin: 'com.fastgo.plugin'
//ext.greetingFile="$buildDir/hello.txt"