-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
96 lines (80 loc) · 2.14 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
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id 'java'
id "com.github.spotbugs" version "4.0.2"
}
apply plugin: 'checkstyle'
apply plugin: 'pmd'
group 'org.mate'
version '0.4'
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
//create a single Jar with all dependencies
task fatJar(type: Jar) {
manifest {
attributes 'Main-Class': 'org.mate.Server'
}
// archiveBaseName = rootProject.name + '-all'
// archiveFileName = rootProject.name + '.jar'
archiveName(rootProject.name + '.jar')
from {configurations.compile.collect{it.isDirectory() ? it : zipTree(it)}}
with jar
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'lib', include: '*.jar')
compile group: 'org.jacoco', name: 'org.jacoco.report', version: '0.8.5'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
// https://mvnrepository.com/artifact/org.apache.commons/commons-text
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.9'
}
test {
useJUnitPlatform()
maxHeapSize = '1G'
}
spotbugs {
toolVersion = '4.0.0'
ignoreFailures = true
effort = "max"
reportLevel = "high"
}
checkstyle {
toolVersion = '8.20'
}
pmd {
ignoreFailures true
}
spotbugsMain {
reports {
xml.enabled = false
html {
enabled = true
destination = file("$buildDir/reports/spotbugs/main/spotbugs.html")
stylesheet = 'fancy-hist.xsl'
}
}
}
task checkstyle(type: Checkstyle) {
configFile = rootProject.file("config/checkstyle/checkstyle.xml")
//configProperties.checkstyleSuppressionsPath = file("$configPath/checkstyle/suppressions.xml").absolutePath
source 'src'
include '**/*.java'
exclude '**/gen/**'
reports {
html.enabled = true
xml.enabled = false
html.destination file("$project.buildDir/reports/checkstyle/checkstyle.html")
}
classpath = files()
}