forked from ThierryChampot/TP-Jenkins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
97 lines (85 loc) · 2.16 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'findbugs'
apply plugin: 'pmd'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
apply plugin: 'jdepend'
findbugs{
ignoreFailures = true
sourceSets = [sourceSets.main]
}
task myJavadocs(type: Javadoc) {
source = sourceSets.main.allJava
}
pmd{
toolVersion = '5.1.1'
ignoreFailures = true
sourceSets = [sourceSets.main]
ruleSets = [
'java-android',
'java-basic',
'java-braces',
'java-clone',
'java-codesize',
'java-comments',
'java-controversial',
'java-coupling',
'java-design',
'java-empty',
'java-finalizers',
'java-imports',
'java-j2ee',
'java-javabeans',
'java-junit',
'java-logging-jakarta-commons',
'java-logging-java',
'java-migrating',
'java-naming',
'java-optimizations',
'java-strictexception',
'java-strings',
'java-sunsecure',
'java-typeresolution',
'java-unnecessary',
'java-unusedcode'
]
}
checkstyle {
toolVersion "7.6.1"
ignoreFailures = true
sourceSets = [sourceSets.main]
}
checkstyleMain {
configProperties = ['basedir': "$rootDir/config/checkstyle"]
configFile = new File(rootDir, 'config/checkstyle/checkstyle.xml')
}
repositories {
mavenCentral()
maven { url 'http://repo1.maven.org/maven2' }
}
dependencies {
testCompile 'junit:junit:4.12'
}
task cpdMain(dependsOn: 'pmdMain') {
ext.ignoreFailures = true
doLast {
File outDir = new File(reporting.baseDir, 'cpd/')
// Make sure the output dir exists to prevent a ReportException
outDir.mkdirs()
ant.taskdef(name: 'cpd', classname: 'net.sourceforge.pmd.cpd.CPDTask',
classpath: configurations.pmd.asPath)
ant.cpd(
minimumTokenCount: '100',
format: 'xml',
outputFile: new File(outDir , 'main.xml')) {
fileset(dir: projectDir.getPath()) {
sourceSets.main.java.each { sourceDir ->
include(name: project.relativePath(sourceDir.getPath()))
}
}
}
}
}
check.dependsOn cpdMain