-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
83 lines (65 loc) · 2.21 KB
/
build.gradle.kts
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
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/
plugins {
java
id("com.github.johnrengelman.shadow") version "8.1.1"
}
repositories {
mavenLocal()
maven {
url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
maven {
url = uri("https://oss.sonatype.org/content/groups/public/")
}
maven {
url = uri("https://repo.maven.apache.org/maven2/")
}
}
dependencies {
// Spigot API
compileOnly("org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT")
// This dependency is required for JSON Parsing
implementation("com.googlecode.json-simple:json-simple:1.1.1")
// This dependency is required for proper Websocket support
implementation("com.neovisionaries:nv-websocket-client:2.14")
// Nullable Support
implementation("org.jetbrains:annotations:16.0.1")
// System Info
implementation("com.github.oshi:oshi-core:6.4.0")
// Jackson JSON postprocessing
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.1")
// Apache IO since I am lazy to write all multiplexing stuff; TeeOutputStream
implementation("commons-io:commons-io:2.11.0")
// For Intercepting Log4J
compileOnly("org.apache.logging.log4j:log4j-core:2.17.2")
}
group = "kr.minehub.servers"
version = "0.0.1-ALPHA"
description = "ServerAgent"
java.sourceCompatibility = JavaVersion.VERSION_1_8
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks {
val pluginYamlFile = file("src/main/resources/plugin.yml")
val outputDir = layout.buildDirectory.dir("resources/main")
val generatePluginYml by registering {
inputs.file(pluginYamlFile)
outputs.dir(outputDir)
doLast {
val pluginYamlText = pluginYamlFile.readText()
val updatedText = pluginYamlText.replace(Regex("\nversion:(.*)"), "\nversion: $version")
println("${outputDir.get()}\\plugin.yml")
outputDir.get().asFile.mkdirs()
file("${outputDir.get()}\\plugin.yml").writeText(updatedText)
}
}
processResources {
exclude("plugin.yml")
dependsOn(generatePluginYml)
}
}