forked from thekrakken/java-grok
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
79 lines (68 loc) · 1.72 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
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
apply plugin: "findbugs"
sourceCompatibility = JavaVersion.VERSION_1_6
version = '0.1.1'
task wrapper(type: Wrapper) {
gradleVersion = '1.10'
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile "com.github.tony19:named-regexp:0.2.3"
compile "org.apache.commons:commons-lang3:3.1"
compile "com.google.code.gson:gson:2.2.2"
compile "org.slf4j:slf4j-api:1.7.5"
testCompile group: 'junit', name: 'junit', version: '4.11'
}
/**
* Check the source code convention
*/
checkstyle {
configFile = new File(rootDir, '_tools/checkstyle/checkstyle.xml')
ignoreFailures = true
}
checkstyleMain {
include('**/*.java')
exclude('**/Pile.java')
doLast {
println("checkstyle main")
project.ext.checkType = "main"
tasks.checkstyleReport.execute()
}
}
checkstyleTest {
include ( '**/*.java')
doLast {
println("checkstyle test")
project.ext.checkType = "test"
tasks.checkstyleReport.execute()
}
}
task checkstyleReport {
checkstyleReport.outputs.upToDateWhen { false }
}
checkstyleReport << {
logger.info("Producing checkstyle html report")
final source = "${project.projectDir}/build/reports/checkstyle/${project.checkType}.xml"
final xls = "./_tools/checkstyle/checkstyle.xls"
final output = "$buildDir/reports/checkstyle/${project.checkType}.html"
println("HTML report can be found at: " + output)
ant.xslt(in: source, style: xls, out: output)
}
findbugs {
ignoreFailures = true
toolVersion = "2.0.1"
sourceSets = [sourceSets.main]
reportsDir = file("$project.buildDir/reports/findbugs")
effort = "max"
}
findbugsMain {
reports {
xml.enabled = false
html.enabled = true
}
}