forked from Elytrium/LimboAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
77 lines (64 loc) · 1.79 KB
/
build.gradle
File metadata and controls
77 lines (64 loc) · 1.79 KB
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
//file:noinspection GroovyAssignabilityCheck
plugins {
id("java")
id("checkstyle")
id("com.github.spotbugs").version("5.0.7").apply(false)
id("org.cadixdev.licenser").version("0.6.1").apply(false)
}
allprojects {
apply(plugin: "checkstyle")
apply(plugin: "com.github.spotbugs")
apply(plugin: "org.cadixdev.licenser")
setGroup("net.elytrium.limboapi")
setVersion("1.1.17-SNAPSHOT")
compileJava {
getOptions().setEncoding("UTF-8")
}
java {
setSourceCompatibility(JavaVersion.VERSION_11)
setTargetCompatibility(JavaVersion.VERSION_11)
}
repositories {
mavenCentral()
mavenLocal()
maven {
setName("elytrium-repo")
setUrl("https://maven.jnngl.me/public/")
}
maven {
setName("papermc-repo")
setUrl("https://papermc.io/repo/repository/maven-public/")
}
}
checkstyle {
setToolVersion("10.3")
setConfigFile(file("${this.getRootDir()}/config/checkstyle/checkstyle.xml"))
setConfigProperties("configDirectory": "${this.getRootDir()}/config/checkstyle")
setMaxErrors(0)
setMaxWarnings(0)
}
spotbugs {
setExcludeFilter(file("${this.getRootDir()}/config/spotbugs/suppressions.xml"))
}
spotbugsMain {
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()
}