This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbuild.gradle
132 lines (109 loc) · 3.23 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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', 'wrapper'
sourceSets {
main {
java {
srcDirs 'src/main/resources'
srcDirs 'src/main/java'
}
resources {
srcDirs 'recursos'
}
}
}
repositories {
mavenCentral()
}
configurations {
pmdConf
}
dependencies {
compile files('gson-2.8.0.jar','Recursos.jar','Dominio.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": "frames.MenuInicio"
}
baseName = project.name
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
from('src/main/java/frames') {
include '*.png'
include '*.jpg'
into 'frames'
}
from(rootDir) {
include 'config.txt'
}
with jar
}
jacocoTestReport {
reports {
xml.enabled false
csv.enabled true
html.enabled true
//html.destination "${buildDir}/jacocoHtml"
}
task wrapper(type: Wrapper) {
gradleVersion = '2.14'
}
}