This repository has been archived by the owner on May 23, 2022. It is now read-only.
generated from CrimsonWarpedcraft/plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
112 lines (95 loc) · 2.72 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
import java.text.SimpleDateFormat
plugins {
id 'java'
id 'checkstyle'
id "com.github.spotbugs" version "4.7.1"
id 'com.github.johnrengelman.shadow' version '7.1.0'
}
group = "com.snowypeaksystems.mobactions"
if (hasProperty('ver')) {
if (ver.charAt(0) == "v") {
version = ver.substring(1)
} else {
version = ver
}
} else {
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd-HHmm")
sdf.setTimeZone(TimeZone.getTimeZone("UTC"))
version = sdf.format(new Date()).toString()
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
repositories {
mavenCentral {
content {
excludeModule("com.destroystokyo.paper", "paper-api")
excludeModule("io.papermc", "paperlib")
}
}
maven {
name 'papermc'
url 'https://papermc.io/repo/repository/maven-public/'
content {
excludeModule("com.github.spotbugs", "spotbugs-annotations")
excludeModule("com.h3xstream.findsecbugs", "findsecbugs-plugin")
excludeModule("org.junit.jupiter", "junit-jupiter-api")
excludeModule("org.junit.jupiter", "junit-jupiter-engine")
}
}
}
dependencies {
compileOnly 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT'
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.5.2'
implementation 'io.papermc:paperlib:1.0.7'
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.11.0'
testCompileOnly 'com.github.spotbugs:spotbugs-annotations:4.5.2'
testImplementation 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
test {
useJUnitPlatform()
}
processResources {
filesMatching("**/plugin.yml") {
expand ( NAME: rootProject.name, VERSION: version, PACKAGE: project.group.toString() )
}
}
checkstyle {
toolVersion '8.42'
maxWarnings = 0
}
tasks.withType(Checkstyle) {
reports {
xml.enabled false
html.enabled true
}
}
spotbugsMain {
reports {
xml.enabled false
html.enabled true
}
}
spotbugsTest {
reports {
xml.enabled false
html.enabled true
}
}
shadowJar {
archiveClassifier.set('SNAPSHOT')
relocate 'io.papermc.lib', 'shadow.io.papermc.paperlib'
minimize()
}
jar.enabled = false
assemble.dependsOn(shadowJar)
task release {
dependsOn build
doLast {
def dirStr = buildDir.toString() + File.separator + 'libs' + File.separator
file(dirStr + rootProject.name + '-' + version + '-SNAPSHOT.jar').renameTo(dirStr + rootProject.name + '.jar')
}
}