-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
299 lines (271 loc) · 9 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
//apply application and java up top to ease creation of gradle build
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'maven'
apply plugin: 'java-library'
//main class for running and variables
mainClassName = 'steg.StegMeister'
group 'StegMeister' //group name
version = '1.0' //version number
sourceCompatibility = 9 //java source version
targetCompatibility = 9 //target jdk 9 needed for pmd
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url 'http://dl.bintray.com/jetbrains/intellij-plugin-service'
}
maven {
url 'https://mvnrepository.com/artifact/junit/junit'
}
maven {
url "https://mvnrepository.com/artifact/org.controlsfx/controlsfx"
}
maven {
url "https://mvnrepository.com/artifact/com.jfoenix/jfoenix"
}
maven {
url "https://mvnrepository.com/artifact/de.jensd/fontawesomefx"
}
maven {
url "https://mvnrepository.com/artifact/net.sourceforge.pmd/pmd"
}
maven {
url "https://jitpack.io"
}
maven {
url "http://dl.bintray.com/typesafe/maven-releases"
}
mavenCentral()
jcenter()
mavenLocal()
}
dependencies {
//classpath "gradle.plugin.no.tornado:fxlauncher-gradle-plugin:1.0.16" //add if useful
classpath "org.controlsfx:controlsfx:9.0.0"
classpath "com.jfoenix:jfoenix:9.0.3"
classpath "de.jensd:fontawesomefx:8.9"
classpath "com.github.jengelman.gradle.plugins:shadow:2.0.2"
//classpath "com.google.googlejavaformat:google-java-format:1.5"
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.0'
classpath 'org.xerial:sqlite-jdbc:3.21.0.1'
classpath 'gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.6'
classpath 'gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.1'
classpath 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.7.1'
classpath 'com.github.spotbugs:spotbugs-annotations:3.1.2'
classpath "commons-codec:commons-codec:1.11"
classpath "com.github.codacy:codacy-coverage-reporter:-SNAPSHOT"
}
}
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'com.github.sherter.google-java-format'
apply plugin: "com.github.spotbugs"
apply plugin: "jacoco"
//add later if useful
//apply plugin: 'no.tornado.fxlauncher'
//Must be added after plugins keep above compile and test
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
//Separate test compile dependancies
dependencies {
testCompile(
'org.junit.jupiter:junit-jupiter-api:5.1.0',
'org.xerial:sqlite-jdbc:3.21.0.1',
'org.controlsfx:controlsfx:9.0.0',
'de.jensd:fontawesomefx:8.9',
'com.jfoenix:jfoenix:9.0.3',
'gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.6',
'com.github.spotbugs:spotbugs:3.1.2',
'net.jcip:jcip-annotations:1.0',
'com.github.spotbugs:spotbugs-annotations:3.1.2',
"commons-codec:commons-codec:1.11",
'de.jensd:fontawesomefx-emojione:2.2.7-2',
'de.jensd:fontawesomefx-fontawesome:4.7.0-5',
'de.jensd:fontawesomefx-icons525:3.0.0-4',
'de.jensd:fontawesomefx-materialdesignfont:1.7.22-4',
'de.jensd:fontawesomefx-materialicons:2.2.0-5',
'de.jensd:fontawesomefx-octicons:4.3.0-5',
'de.jensd:fontawesomefx-weathericons:2.0.10-5',
'de.jensd:fontawesomefx-controls:8.15'
)
testRuntime(
'org.junit.jupiter:junit-jupiter-engine:5.1.0'
)
}
//separate compile dependencies
dependencies {
compileOnly 'gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.6'
compile 'org.xerial:sqlite-jdbc:3.21.0.1'
compile 'org.controlsfx:controlsfx:9.0.0'
compile 'com.jfoenix:jfoenix:9.0.3'
compile 'de.jensd:fontawesomefx-emojione:2.2.7-2'
compile 'de.jensd:fontawesomefx-fontawesome:4.7.0-5'
compile 'de.jensd:fontawesomefx-icons525:3.0.0-4'
compile 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-4'
compile 'de.jensd:fontawesomefx-materialicons:2.2.0-5'
compile 'de.jensd:fontawesomefx-octicons:4.3.0-5'
compile 'de.jensd:fontawesomefx-weathericons:2.0.10-5'
compile 'de.jensd:fontawesomefx-controls:8.15'
compile "commons-codec:commons-codec:1.11"
//compileOnly 'com.github.spotbugs:spotbugs:3.1.2'
//compileOnly 'net.jcip:jcip-annotations:1.0'
//compileOnly 'com.github.spotbugs:spotbugs-annotations:3.1.2'
}
//set wrapper to 4.6
task wrapper(type: Wrapper) {
gradleVersion = '4.6'
}
//configure the jar file
jar {
manifest {
attributes 'Implementation-Title': 'StegMeister',
'Implementation-Version': version,
'Main-Class': 'steg.StegMeister'
}
}
//configure our test task for junit
test {
// enable JUnit Platform (a.k.a. JUnit 5) support
useJUnitPlatform()
// set a system property for the test JVM(s)
// systemProperty 'some.prop', 'value'
// explicitly include or exclude tests
//include 'org/foo/**'
//exclude 'org/boo/**'
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
// set heap size for the test JVM(s)
minHeapSize = "128m"
maxHeapSize = "512m"
// set JVM arguments for the test JVM(s)
jvmArgs '-XX:MaxPermSize=512'
// listen to events in the test execution lifecycle
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
// Fail the 'test' task on the first test failure
failFast = false
// listen to standard out and standard error of the test JVM(s)
onOutput { descriptor, event ->
logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message )
}
}
//configure javadoc
javadoc {
source = sourceSets.main.allJava
classpath = sourceSets.main.compileClasspath
// if not changed the destinationDir, the javadoc for production code is overridden.
destinationDir = file("/docs/javadoc")
title = "StegMeister"
}
//checkstyle
checkstyle {
toolVersion = "8.8"
configFile rootProject.file('checkstyle.xml')
ignoreFailures false
showViolations true
}
//pmd
pmd {
toolVersion = "6.1.0"
ignoreFailures = true
sourceSets = [sourceSets.main]
reportsDir = file("$project.buildDir/reports/pmd")
ruleSets = [
'java-basic',
'java-braces',
'java-clone',
'java-codesize',
'java-comments',
'java-controversial',
'java-design',
'java-empty',
'java-finalizers',
'java-imports',
'java-j2ee',
'java-javabeans',
'java-junit',
'java-logging-jakarta-commons',
'java-logging-java',
'java-migrating',
'java-naming',
'java-optimizations',
'java-strictexception',
'java-strings',
'java-sunsecure',
'java-typeresolution',
'java-unnecessary',
'java-unusedcode'
]
}//formatter
googleJavaFormat {
toolVersion = '1.5'
source = sourceSets*.allJava
source 'src/special_dir'
include '**/*.java'
exclude '**/*Template.java'
exclude 'src/test/template_*'
}
//spotbugs
spotbugs {
toolVersion = '3.1.2'
sourceSets = [sourceSets.main]
ignoreFailures = true
effort = "max"
reportLevel = "low"
dependencies {
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.7.1'
}
}
tasks.withType(com.github.spotbugs.SpotBugsTask) {
// configure automatically generated tasks
reports {
xml.enabled = false
html.enabled = true
}
}
//jacoco
jacoco {
toolVersion = "0.8.1"
reportsDir = file("$buildDir/reports/customJacocoReportDir")
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
// html.destination file("${buildDir}/reports/jacoco")
}
}
//codacy coverage
configurations { codacy }
repositories {
maven { url "https://jitpack.io" }
maven { url "http://dl.bintray.com/typesafe/maven-releases" }
}
dependencies {
codacy 'com.github.codacy:codacy-coverage-reporter:-SNAPSHOT'
}
task sendCoverageToCodacy(type: JavaExec, dependsOn: jacocoTestReport) {
main = "com.codacy.CodacyCoverageReporter"
classpath = configurations.codacy
args = [
"report",
"-l",
"Java",
"-r",
"${buildDir}/reports/jacoco/test/jacocoTestReport.xml",
"--project-token",
"64babb1d7f34490d88776e90983c5c05"
]
}