-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbuild.gradle
More file actions
79 lines (75 loc) · 2.97 KB
/
build.gradle
File metadata and controls
79 lines (75 loc) · 2.97 KB
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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
// mavenLocal()
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
// mavenLocal()
google()
mavenCentral()
}
/*todo fix:
防止-Xlint:unchecked 重新编译。错误*/
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
// Try to turn them all off automatically
options.compilerArgs << '-Xlint:none'
options.compilerArgs << '-nowarn' // same as '-Xlint:none'
// Turn them off manually
options.compilerArgs << '-Xlint:-auxiliaryclass'
options.compilerArgs << '-Xlint:-cast'
options.compilerArgs << '-Xlint:-classfile'
options.compilerArgs << '-Xlint:-deprecation'
options.compilerArgs << '-Xlint:-dep-ann'
options.compilerArgs << '-Xlint:-divzero'
options.compilerArgs << '-Xlint:-empty'
options.compilerArgs << '-Xlint:-fallthrough'
options.compilerArgs << '-Xlint:-finally'
options.compilerArgs << '-Xlint:-options'
options.compilerArgs << '-Xlint:-overloads'
options.compilerArgs << '-Xlint:-overrides'
options.compilerArgs << '-Xlint:-path'
options.compilerArgs << '-Xlint:-processing'
options.compilerArgs << '-Xlint:-rawtypes'
options.compilerArgs << '-Xlint:-serial'
options.compilerArgs << '-Xlint:-static'
options.compilerArgs << '-Xlint:-try'
options.compilerArgs << '-Xlint:-unchecked'
options.compilerArgs << '-Xlint:-varargs'
}
}
/*todo fix :
忽略java编译时的警告*/
tasks.withType(JavaCompile) {
configure(options) {
incremental = true
}
// options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
options.encoding = "UTF-8"
}
configurations {
all*.exclude group: 'com.android.support', module: 'support-compat'
all*.exclude group: 'com.android.support', module: 'support-v4'
all*.exclude group: 'com.android.support', module: 'support-annotations'
all*.exclude group: 'com.android.support', module: 'support-fragment'
all*.exclude group: 'com.android.support', module: 'support-core-utils'
all*.exclude group: 'com.android.support', module: 'support-core-ui'
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}