-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
50 lines (43 loc) · 1.07 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
apply plugin:'java'
apply plugin: 'pmd'
version = "1.0.2"
repositories {
mavenCentral()
}
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
task writePom << {
pom {
project {
inceptionYear '2014'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
}
}.writeTo("$projectDir/pom.xml")
}
pmd {
ignoreFailures = true
sourceSets = [sourceSets.main]
reportsDir = file("$project.buildDir/reports/pmd")
ruleSets = [
"basic",
"braces"
]
}
check << {
File outDir = new File('build/reports/pmd/')
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 , 'cpd.xml')) {
fileset(dir: "src/main/java") {
include(name: '**/*.java')
}
}
}