-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
74 lines (64 loc) · 2.17 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath "com.mrcd:xrouter-gradle-plugin-x:1.2.1.1"
classpath 'com.novoda:bintray-release:0.9.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
ext {
appcompatVersion = "28.0.0"
targetSdk = 28
minSdk = 19
compileSdk = 28
routerAnnotation = "1.2.1.1"
routerCompiler = "1.2.1.1"
gsonVersion = "2.8.5"
retrofitVersion = "2.6.0"
okgoVersion = "2.1.4"
glideVersion="4.10.0"
}
project.subprojects.each { childProject ->
childProject.plugins.apply("checkstyle")
CheckstylePlugin
CheckstyleExtension checkstyle = childProject.extensions.getByName("checkstyle")
checkstyle.toolVersion = '5.9'
Task checkTask = childProject.tasks.create("checkstyle", Checkstyle.class)
checkTask.configure {
// 编译任务依赖aCheckstyle就可以先检测再
File styleFile = file(rootProject.projectDir.toString() + "/checkstyle/checkstyle.xml")
println styleFile
configFile styleFile
source 'src/main'
include '**/*.java'
exclude '**/gen/**'
exclude '**/encrypt/**'
exclude '**/XRouter.java'
classpath = files()
reports {
// 注意: 如果清空build目录之后再运行可能会导致失败,此时注释掉下面两行再重新运行,等build/reports/checkstyle 目录下
// 生成了xml之后再放开注释即可.
// ant.xslt(in: reports.xml.destination,
// style: new File('../config/xsl/checkstyle-noframes-sorted.xsl'),
// out: new File(reports.xml.destination.parent, 'checkstyle-report.html'))
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}