-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
81 lines (64 loc) · 2 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
//file:noinspection GroovyAssignabilityCheck
plugins {
id("java")
id("checkstyle")
id("com.github.spotbugs").version("5.0.6").apply(false)
id("org.cadixdev.licenser").version("0.6.1").apply(false)
}
allprojects {
//apply(plugin: "java")
apply(plugin: "checkstyle")
apply(plugin: "com.github.spotbugs")
apply(plugin: "org.cadixdev.licenser")
setGroup("ru.meproject.distributify")
setVersion("0.0.1")
compileJava {
getOptions().setEncoding("UTF-8")
}
java {
setSourceCompatibility(JavaVersion.VERSION_11)
setTargetCompatibility(JavaVersion.VERSION_11)
}
repositories {
mavenCentral()
}
/*dependencies {
assemble.dependsOn(shadowJar)
}
shadowJar {
archiveClassifier.set("")
}*/
license {
setHeader(file("${this.getRootDir()}/HEADER.txt"))
}
checkstyle {
setToolVersion("10.1")
setConfigFile(file("${this.getRootDir()}/config/checkstyle/checkstyle.xml"))
setConfigProperties("configDirectory": "${this.getRootDir()}/config/checkstyle")
// The build should immediately fail if we have errors.
setMaxErrors(0)
setMaxWarnings(0)
}
spotbugsMain {
setExcludeFilter(file("${this.getRootDir()}/config/spotbugs/suppressions.xml"))
reports {
html {
getRequired().set(true)
getOutputLocation().set(file("${this.getBuildDir()}/reports/spotbugs/main/spotbugs.html"))
setStylesheet("fancy-hist.xsl")
}
}
}
}
String getCurrentShortRevision() {
OutputStream outputStream = new ByteArrayOutputStream()
exec {
if (System.getProperty("os.name").toLowerCase().contains("win")) {
commandLine("cmd", "/c", "git rev-parse --short HEAD")
} else {
commandLine("bash", "-c", "git rev-parse --short HEAD")
}
setStandardOutput(outputStream)
}
return outputStream.toString().trim()
}