forked from Dreeam-qwq/LimboAPI
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
79 lines (66 loc) · 2.01 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
//file:noinspection GroovyAssignabilityCheck
plugins() {
id("java")
id("checkstyle")
id("com.github.spotbugs").version("5.1.3").apply(false) // Dreeam TODO - Bump it and fix build error
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.18-SNAPSHOT")
compileJava() {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
repositories() {
mavenCentral()
maven() {
setName("elytrium-repo")
setUrl("https://maven.elytrium.net/repo/")
}
maven() {
setName("papermc-repo")
setUrl("https://repo.papermc.io/repository/maven-public/")
}
maven() {
setName("sonatype-oss-snapshots1")
setUrl("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
maven {
setName("william278Velocity")
setUrl("https://repo.william278.net/velocity")
}
}
checkstyle() {
toolVersion = "10.12.4"
configFile = file("$rootDir/config/checkstyle/checkstyle.xml")
configProperties = ["configDirectory": "$rootDir/config/checkstyle"]
maxErrors = 0
maxWarnings = 0
}
spotbugs() {
excludeFilter = file("${this.getRootDir()}/config/spotbugs/suppressions.xml")
if (this.project != rootProject) {
reports.register("html") {
required = true
outputLocation.value(layout.buildDirectory.file("reports/spotbugs/main/spotbugs.html"))
stylesheet = "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()
}