-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
149 lines (128 loc) · 4.12 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import java.nio.file.Files
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'java'
id("xyz.jpenilla.run-paper") version "1.0.6"
id "de.undercouch.download" version "5.1.0"
}
group = 'cz.neumimto.towny'
version = 'ALPHA-1.0.4'
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 = 'glaremasters repo'
url = 'https://repo.glaremasters.me/repository/towny/'
}
maven {
url = "https://repo.aikar.co/content/groups/aikar/"
}
maven {
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url = "https://mvn-repo.arim.space/lesser-gpl3/"
}
maven {
url = "https://repo.essentialsx.net/releases/"
}
}
compileJava {
options.compilerArgs += ["-parameters"]
options.fork = true
options.forkOptions.executable = 'javac'
}
test {
useJUnitPlatform()
}
dependencies {
compileOnly 'dev.folia:folia-api:1.19.4-R0.1-SNAPSHOT'
compileOnly 'com.palmergames.bukkit.towny:towny:0.99.2.5'
compileOnly 'com.electronwill.night-config:hocon:3.6.5'
compileOnly 'com.google.inject:guice:5.1.0'
implementation fileTree('libs/')
testImplementation fileTree('plugins-test/')
// implementation 'com.github.stefvanschie.inventoryframework:IF:0.10.8'
implementation "co.aikar:acf-paper:0.5.1-SNAPSHOT"
implementation 'net.kyori:adventure-text-minimessage:4.10.1'
implementation 'space.arim.morepaperlib:morepaperlib:0.4.2'
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
testImplementation 'io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.19:3.1.0'
// testImplementation 'net.essentialsx:EssentialsX:2.20.0'
testImplementation 'commons-lang:commons-lang:2.6'
testImplementation 'org.apache.logging.log4j:log4j-core:2.11.1'
}
configurations {
testImplementation.extendsFrom compileOnly
}
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 {
relocate 'co.aikar.commands', 'shaded.toco.co.aikar.commands'
relocate 'co.aikar.locales', 'shaded.toco.co.aikar.locales'
relocate 'com.github.stefvanschie', 'shaded.toco.com.github.stefvanschie'
}
runServer {
minecraftVersion("1.19.4")
}
java.nio.file.Path pluginsDir;
task preparePluginsDir {
pluginsDir = rootDir.toPath().resolve("run/plugins/");
if (!Files.exists(pluginsDir)) {
Files.createDirectories(pluginsDir)
}
}
task dlPlugins {
var pluginsFileDir = pluginsDir.toFile();
download.run {
src "https://github.com/MilkBowl/Vault/releases/download/1.7.3/Vault.jar"
dest new File(pluginsFileDir, "Vault.jar")
overwrite true
}
download.run {
src "https://github.com/TheNewEconomy/TNE-Bukkit/releases/download/TNE-0.1.1.16/TNE-0.1.1.16.jar"
dest new File(pluginsFileDir, "TNE.jar")
overwrite true
}
download.run {
src "https://github.com/TownyAdvanced/Towny/releases/download/0.99.2.5/towny-0.99.2.5.jar"
dest new File(pluginsFileDir, "Towny.jar")
overwrite true
}
//copy {
// from {
// var path = System.getProperty("java.io.tmpdir") + "/Towny.zip"
// zipTree(path).matching { include '**/*.jar' }.files
// }
// into pluginsDir.toFile()
//}
dependsOn preparePluginsDir
}