-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
104 lines (86 loc) · 2.87 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
/*
* This build file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/3.4.1/userguide/tutorial_java_projects.html
*/
// Apply the java plugin to add support for Java
apply plugin: 'java'
// Apply the application plugin to add support for building an application
apply plugin: 'application'
// Support des IDEs
//apply plugin: 'eclipse'
//apply plugin: 'idea'
// Plugins de test
apply plugin: 'findbugs'
apply plugin: 'jacoco'
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
jcenter()
// You can declare any Maven/Ivy/file repository here.
//mavenCentral()
}
ext {
lombockVersion = '1.16.+'
//Logging
// ...
//Testing
junitVersion = '4.+'
}
dependencies {
// This dependency is found on compile classpath of this component and consumers.
//compile 'com.google.guava:guava:20.0'
// Use JUnit test framework
testCompile "junit:junit:$junitVersion"
compileOnly "org.projectlombok:lombok:$lombockVersion"
}
// Define the main class for the application
mainClassName = 'fr.esgi.projet.softwareneedsyou.App'
// On spécifie la version de Java à utiliser
sourceCompatibility = JavaVersion.VERSION_1_8 //1.8
targetCompatibility = JavaVersion.VERSION_1_8 //1.8
jar {
manifest {
attributes 'Main-Class': "$mainClassName"
}
}
findbugs {
toolVersion = "3.0.1" //pour compactibilité jre 1.7
effort = "max"
reportLevel = "low"
ignoreFailures = true //sinon echec de la compilation
reportsDir = file("${buildDir}/findbugsReports") //$project.buildDir
}
tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}
build.finalizedBy(jacocoTestReport) //pour exécuter automatique le test de couverture (avec junit) après la compilation
jacocoTestReport {
group = "Reporting"
description = "Générer un rapport de couverture de code (JAvaCOdeCOverage) après les tests"
additionalSourceDirs = files(sourceSets.main.allJava.srcDirs)
reports {
xml.enabled false
csv.enabled false
html.enabled true
html.destination "${buildDir}/jacocoHtml"
}
doFirst {
sourceDirectories = files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['**/tri/**Exception**'])
})
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['**/tri/**Exception**'])
})
}
afterEvaluate { //pas vraiment nécessaire avec doFirst
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['**/tri/**Exception**'])
})
}
}