forked from ayunami2000/ayunViaProxyEagUtils
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
66 lines (49 loc) · 1.26 KB
/
build.gradle.kts
File metadata and controls
66 lines (49 loc) · 1.26 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
import org.gradle.language.jvm.tasks.ProcessResources
val PLUGIN_NAME = "ayunViaProxyEagUtils"
val PLUGIN_VERS = "1.1"
val PLUGIN_ATHR = "ayunami2000"
val PLUGIN_CODE = "me.$PLUGIN_ATHR.$PLUGIN_NAME"
plugins {
id("java")
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
repositories {
mavenCentral()
maven("https://repo.viaversion.com")
}
dependencies {
compileOnly("net.raphimc:ViaProxy:3.4.11-SNAPSHOT")
}
tasks.named<JavaCompile>("compileJava") {
options.encoding = "UTF-8"
options.release.set(17)
}
tasks.named<ProcessResources>("processResources") {
outputs.upToDateWhen { false }
doFirst {
filesMatching("viaproxy.yml") {
expand(mapOf(
"plugin_name" to PLUGIN_NAME,
"plugin_vers" to PLUGIN_VERS,
"plugin_athr" to PLUGIN_ATHR,
"plugin_code" to PLUGIN_CODE
))
}
}
}
tasks.named<Jar>("jar") {
doFirst {
delete(layout.buildDirectory.dir("libs"))
mkdir(layout.buildDirectory.dir("libs"))
}
archiveFileName.set("$PLUGIN_NAME-$PLUGIN_VERS.jar")
}
tasks.register("printVars") {
doLast {
println("VERS = " + PLUGIN_VERS)
println("AFCT = " + tasks.named("jar").get().outputs.files.singleFile.name.removeSuffix(".jar"))
}
}