forked from SpongePowered/sponge-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
58 lines (51 loc) · 1.71 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
58 lines (51 loc) · 1.71 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
import org.spongepowered.gradle.plugin.config.PluginLoaders
import org.spongepowered.plugin.metadata.PluginDependency
plugins {
`java-library`
id("org.spongepowered.gradle.plugin") version "1.1.1"
}
group = "net.kernelcraft.example"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
sponge {
apiVersion("9.0.0")
plugin("example") {
loader(PluginLoaders.JAVA_PLAIN)
displayName("Example")
mainClass("net.kernelcraft.example.Example")
description("Just testing things...")
links {
homepage("https://kernelcraft.net")
source("https://github.com/Kernelcraft-Network/plugin-template")
issues("https://github.com/Kernelcraft-Network/plugin-template/issues")
}
contributor("KernelFreeze") {
description("Lead Developer")
}
dependency("spongeapi") {
loadOrder(PluginDependency.LoadOrder.AFTER)
optional(false)
}
}
}
val javaTarget = 16 // Sponge targets a minimum of Java 8
java {
sourceCompatibility = JavaVersion.toVersion(javaTarget)
targetCompatibility = JavaVersion.toVersion(javaTarget)
if (JavaVersion.current() < JavaVersion.toVersion(javaTarget)) {
toolchain.languageVersion.set(JavaLanguageVersion.of(javaTarget))
}
}
tasks.withType(JavaCompile::class).configureEach {
options.apply {
encoding = "utf-8" // Consistent source file encoding
release.set(javaTarget)
}
}
// Make sure all tasks which produce archives (jar, sources jar, javadoc jar, etc) produce more consistent output
tasks.withType(AbstractArchiveTask::class).configureEach {
isReproducibleFileOrder = true
isPreserveFileTimestamps = false
}