-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
164 lines (132 loc) · 4.03 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/*
* This build file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* user guide available at https://docs.gradle.org/3.5/userguide/java_library_plugin.html
*/
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.0'
}
}
plugins {
id 'jacoco'
id "com.github.kt3k.coveralls" version "2.10.1"
id 'com.github.spotbugs' version '3.0.0'
id 'java'
}
// Apply the java-library plugin to add support for Java Library
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'application'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
apply plugin: 'org.junit.platform.gradle.plugin'
sourceSets {
main {
java {
srcDir 'src/main/java'
}
}
test {
java {
srcDir 'src/test/java'
}
}
}
// Java Application Dependencies & properties
sourceCompatibility = 1.8
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// Google Drive API v3: https://developers.google.com/api-client-library/java/apis/drive/v3
implementation('com.google.api-client:google-api-client:1.23.0')
implementation('com.google.oauth-client:google-oauth-client-jetty:1.23.0')
implementation('com.google.apis:google-api-services-drive:v3-rev154-1.25.0')
// For internal usage
implementation('com.google.guava:guava:21.0')
// JUnit Jupiter API and TestEngine implementation
testImplementation('org.junit.jupiter:junit-jupiter-api:5.5.1')
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.5.1')
testImplementation('junit:junit:4.13')
testRuntimeOnly('org.junit.vintage:junit-vintage-engine:5.5.1')
}
// Plugins setup
checkstyle {
// Whether to allow the build to continue if there are warnings. Default: ignoreFailures = false
ignoreFailures = true
sourceSets = [sourceSets.main]
// Checkstyle version
toolVersion "8.8"
}
spotbugs {
ignoreFailures = true
toolVersion = '4.0.1'
}
tasks.withType(com.github.spotbugs.SpotBugsTask) {
reports {
xml.enabled = false
html.enabled = true
}
}
junitPlatform {
// platformVersion '1.1.0'
filters {
engines {
include 'junit-jupiter'
// exclude 'custom-engine'
}
}
// configurationParameter 'junit.jupiter.conditions.deactivate', '*'
enableStandardTestTask true
reportsDir file("${buildDir}/test-results/junit-platform") // this is the default
//logManager 'org.apache.logging.log4j.jul.LogManager'
}
jacocoTestReport {
// Show code coverage results
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
executionData(fileTree(project.rootDir.absolutePath).include("**/${buildDir}/jacoco/*.exec"))
// additionalSourceDirs = files(sourceSets.main.allJava.srcDirs)
reports {
xml.enabled true
xml.destination file("${buildDir}/reports/jacoco/test/jacocoTestReport.xml")
csv.enabled false
html.destination file("${buildDir}/reports/jacoco/test/jacocoTestReport_html/")
}
}
coveralls {
jacocoReportPath 'build/reports/jacoco/test/jacocoTestReport.xml'
}
test {
// Enable JUnit 5 (Gradle 4.6+).
useJUnitPlatform{
//includeTags 'fast'
excludeTags 'slow', 'db'
}
// Always run tests, even when nothing changed.
dependsOn 'cleanTest'
// Show test results.
testLogging {
events "passed", "skipped", "failed"
}
finalizedBy jacocoTestReport
}
task fatJar(type: Jar) {
manifest {
attributes 'Main-Class': 'it.uniba.main/AppMain'
}
archiveBaseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
project.tasks.getByName('build').dependsOn fatJar
// Main class
mainClassName = 'it.uniba.main/AppMain'