-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
112 lines (97 loc) · 3.23 KB
/
build.gradle
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
import java.util.regex.Pattern
plugins {
id 'java'
id 'checkstyle'
id "com.github.johnrengelman.shadow" version "8.1.1"
}
group = 'dev.felnull'
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
checkstyle {
toolVersion = "10.12.2"
}
configurations {
implementation.extendsFrom shadowIn
}
repositories {
maven {
name = 'felnull maven'
url = 'https://maven.felnull.dev/'
}
}
repositories {
mavenCentral()
maven {
name = "papermc-repo"
url = "https://repo.papermc.io/repository/maven-public/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
maven {
name = "xenondevs"
url = "https://repo.xenondevs.xyz/releases"
}
maven { url = "https://repo.codemc.org/repository/maven-public/" }
maven {
name = 'enginehub-maven'
url = 'https://maven.enginehub.org/repo/'
}
maven { url 'https://repo.kryptonmc.org/releases' }
}
dependencies {
compileOnly "io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT"
compileOnly 'com.sk89q.worldedit:worldedit-bukkit:7.2.15'
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.9'
compileOnly "dev.jorel:commandapi-bukkit-core:9.2.0"
compileOnly files("libs/MechanicsCore-3.3.1.jar")
compileOnly files("libs/WeaponMechanics-3.3.1.jar")
compileOnly 'me.neznamy:tab-api:4.0.2'
shadowIn "xyz.xenondevs.invui:invui:1.15"
shadowIn "net.kunmc.lab:ikisugi-logger:1.3"
shadowIn "dev.felnull:felnull-java-library:1.75"
shadowIn "de.tr7zw:item-nbt-api:2.12.0"
}
def targetJavaVersion = 17
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
}
tasks.withType(JavaCompile).configureEach {
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}
processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}
shadowJar {
configurations = [project.configurations.shadowIn]
archiveClassifier.set("")
def relocatedPath = 'dev.felnull.shortlifeplugin.include'
relocate 'net.kunmc.lab.ikisugilogger', relocatedPath + '.net.kunmc.lab.ikisugilogger'
relocate 'xyz.xenondevs', relocatedPath + '.xyz.xenondevs'
relocate 'org.jetbrains.annotations', relocatedPath + '.org.jetbrains.annotations'
relocate 'org.intellij.lang.annotations', relocatedPath + '.org.intellij.lang.annotations'
relocate 'dev.felnull.fnjl', relocatedPath + '.dev.felnull.fnjl'
relocate("de.tr7zw.changeme.nbtapi", relocatedPath + '.de.tr7zw.changeme.nbtapi')
}
build {
dependsOn(shadowJar)
}
// ビルドしたJarファイルをサーバーのプラグインフォルダへコピー
tasks.register('copyJar', Copy) {
from(layout.buildDirectory.dir("libs/ShortLifePlugin-${version}.jar"))
into(".run/plugins")
rename("ShortLifePlugin-${Pattern.quote(version)}.jar", "ShortLifePlugin.jar")
}