forked from programacion-avanzada/jrpg-2017b-servidor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
109 lines (87 loc) · 2.83 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
97
98
99
100
101
102
103
104
105
106
107
108
109
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
apply plugin: 'jacoco'
// Configuración
sourceCompatibility = 1.7
version = '0.1'
test.ignoreFailures = true
defaultTasks 'clean', 'compileJava', 'fatJar', 'test', 'checkstyleMain', 'pmd', 'findbugsMain', 'jacocoTestReport'
repositories {
mavenCentral()
}
configurations {
pmdConf
}
dependencies {
compile files('gson-2.8.0.jar','sqlite-jdbc-3.15.1.jar','Dominio.jar','Cliente.jar')
compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
testCompile group: 'junit', name: 'junit', version: '4.+'
pmdConf group: 'pmd', name: 'pmd', version: '4.3'
}
/*buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'net.saliman', name: 'gradle-cobertura-plugin', version: '1.1.0'
}
}*/
// Tareas
checkstyle {
configFile = new File(rootDir, "src/test/resources/sun_checks.xml")
ignoreFailures = true
}
/*cobertura {
coverageFormats = ['html', 'xml']
}*/
task pmd (dependsOn: compileJava) << {
println 'Running PMD/CPD static code analysis'
ant {
if (!buildDir.isDirectory()) {
buildDir.mkdirs()
}
reportFolder = new File(rootDir, "build/reports/pmd-cpd")
if (!reportFolder.isDirectory()) {
reportFolder.mkdirs()
}
taskdef(name: 'pmd', classname: 'net.sourceforge.pmd.ant.PMDTask', classpath: configurations.pmdConf.asPath)
taskdef(name: 'cpd', classname: 'net.sourceforge.pmd.cpd.CPDTask', classpath: configurations.pmdConf.asPath)
pmd(shortFilenames: 'true',
failonruleviolation: 'false',
rulesetfiles: 'rulesets/basic.xml, rulesets/braces.xml, rulesets/clone.xml, rulesets/coupling.xml, rulesets/codesize.xml, rulesets/design.xml, rulesets/migrating.xml, rulesets/naming.xml, rulesets/strictexception.xml, rulesets/strings.xml, rulesets/unusedcode.xml') {
formatter(type: 'xml', toFile: 'build/reports/pmd-cpd/pmd.xml')
fileset(dir: "src/main/java") {
include(name: '**/*.java')
}
}
cpd(minimumTokenCount: 10, format: 'xml',
ignoreLiterals: 'true',
ignoreIdentifiers: 'true',
outputFile: 'build/reports/pmd-cpd/cpd.xml') {
fileSet(dir: "src/main/java") {
include(name: '**/*.java')
}
}
}
}
findbugs {
ignoreFailures = true
}
task fatJar(type: Jar) {
manifest {
attributes "Main-Class": "servidor.Servidor"
}
baseName = project.name
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
jacocoTestReport {
reports {
xml.enabled false
csv.enabled true
html.enabled false
//html.destination "${buildDir}/jacocoHtml"
}
}