forked from SlimeDog/PluginVersions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
88 lines (78 loc) · 2.55 KB
/
build.gradle.kts
File metadata and controls
88 lines (78 loc) · 2.55 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
plugins {
java
}
group = "com.straight8.rambeau"
version = "2.0.0"
description = "List installed plugins and versions alphabetically"
val buildNumber = "006"
val javaTarget = "25"
val paperTarget = "26.1.2"
val paperApiVersion = "26.1.2.build.20-alpha"
val pluginApiCompatibility = "1.21.11"
val pluginName = project.name
val pluginVersion = project.version.toString()
val pluginJarName = "1MB-PluginVersions-v$pluginVersion-$buildNumber-j$javaTarget-$paperTarget.jar"
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.extendedclip.com/releases/")
}
dependencies {
compileOnly("io.papermc.paper:paper-api:$paperApiVersion")
compileOnly("net.kyori:adventure-text-minimessage:4.26.1")
compileOnly("net.kyori:adventure-text-serializer-legacy:4.26.1")
compileOnly("me.clip:placeholderapi:2.12.2")
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(25))
}
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release.set(25)
options.compilerArgs.addAll(listOf("-Xlint:deprecation", "-Xdiags:verbose"))
}
tasks.processResources {
filteringCharset = "UTF-8"
val props = mapOf(
"version" to project.version,
"description" to project.description,
"apiVersion" to pluginApiCompatibility,
)
inputs.properties(props)
filesMatching("plugin.yml") {
expand(props)
}
}
tasks.jar {
archiveFileName.set(pluginJarName)
destinationDirectory.set(layout.projectDirectory.dir("libs"))
manifest {
attributes(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version,
"Build-Number" to buildNumber,
"Java-Target" to javaTarget,
"Paper-API-Compile-Version" to paperApiVersion,
"Plugin-API-Compatibility" to pluginApiCompatibility,
)
}
}
tasks.clean {
delete(layout.projectDirectory.dir("builds"))
}
tasks.register("printBuildConfig") {
group = "help"
description = "Prints the plugin build and compatibility metadata."
doLast {
println("Plugin: $pluginName $pluginVersion")
println("Build number: $buildNumber")
println("Java target: $javaTarget")
println("Compiles against Paper API: $paperApiVersion")
println("Declares plugin api-version: $pluginApiCompatibility")
println("Jar output: libs/$pluginJarName")
}
}