This repository was archived by the owner on Jan 4, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
122 lines (110 loc) · 3.06 KB
/
build.gradle
File metadata and controls
122 lines (110 loc) · 3.06 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
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
113
114
115
116
117
118
119
120
121
122
import java.text.SimpleDateFormat
plugins {
id 'java'
id 'idea'
}
//noinspection GroovyUnusedAssignment
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
/*
CHANGE THESE VALUES
FOR YOUR OWN
ADDON
Addon ID must be unique.
Set it carefully!
*/
group 'de.griefed'
def pluginClass = group + '.exampleaddon.Example'
def addon_id = 'example'
def addon_name = 'Example Addon'
def addon_description = 'An example addon for ServerPackCreator, demonstrating all extension points available.'
def addon_author = 'Griefed'
sourceSets {
//noinspection GroovyAssignabilityCheck
main {
java {
srcDirs = ['src/main/java']
}
//noinspection GroovyAssignabilityCheck
resources {
srcDirs = ['src/main/resources']
}
}
test {
java {
srcDirs = ['src/test/java']
}
//noinspection GroovyAssignabilityCheck
resources {
srcDirs = ['src/test/resources']
}
}
}
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
maven { url 'https://repo.spring.io/release' }
}
dependencies {
annotationProcessor 'org.pf4j:pf4j:3.7.0'
implementation 'de.griefed:serverpackcreator:3.14.7'
// Testing
testImplementation 'org.mockito:mockito-core:4.8.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
}
test {
useJUnitPlatform()
// Mention test result in logs
testLogging {
events(
"passed",
"skipped",
"failed"
)
}
}
processResources {
filesMatching("addon.toml") {
expand(
"version": project.version,
"addon_id": addon_id,
"addon_name": addon_name,
"addon_description": addon_description,
"addon_author": addon_author,
"addon_class": pluginClass
)
}
copy {
from layout.projectDirectory.file("LICENSE")
into layout.projectDirectory.dir("src/main/resources")
}
copy {
from layout.projectDirectory.file("README.md")
into layout.projectDirectory.dir("src/main/resources")
}
copy {
from layout.projectDirectory.file("CHANGELOG.md")
into layout.projectDirectory.dir("src/main/resources")
}
}
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
//noinspection GroovyAssignabilityCheck
manifest {
attributes(
"Main-Class": pluginClass,
"Description": addon_description,
"Built-By": System.getProperty("user.name"),
"Build-Timestamp": new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
"Created-By": "Gradle ${gradle.gradleVersion}",
"Build-Jdk": "${System.getProperty('java.version')} (${System.getProperty('java.vendor')} ${System.getProperty('java.vm.version')})",
"Build-OS": "${System.getProperty('os.name')} ${System.getProperty('os.arch')} ${System.getProperty('os.version')}",
"Plugin-Class": pluginClass,
"Plugin-Id": addon_id,
"Plugin-Name": addon_name,
"Plugin-Provider": addon_author,
"Plugin-Version": project.version,
"Plugin-Description": addon_description
)
}
}