-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle.kts
175 lines (135 loc) · 5.9 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
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import org.gradle.kotlin.dsl.support.zipTo
allprojects {
group = "net.prosavage.factionsx"
version = "1.2-STABLE"
}
plugins {
java
kotlin("jvm") version "1.4.21"
id("com.github.johnrengelman.shadow") version "5.2.0"
}
val serverPluginDirectory: String by project
tasks {
// This is for the CI
register("setCIVersion") {
doFirst {
val teamcity: Map<*, *> by project
version = "dev-#${teamcity["teamcity.build.id"]}"
println("Set version to $version")
}
}
val copyToRoot = register("copyToRoot") {
doLast {
// Copy all our stuff to root project libs.
for (subproject in subprojects.filter { project -> project.name != "AddonFramework" }) {
copy {
from("${subproject.buildDir}/libs/")
into("${buildDir}/libs/")
include("${subproject.name}-${version}.jar")
}
}
}
}
register("packageRelease") {
dependsOn(copyToRoot)
doLast {
val releasePath = "${buildDir}/release/FactionsX+Addons"
mkdir(releasePath)
// Copy the plugins.
copy {
from("$buildDir/libs/")
into(releasePath)
include("*.jar")
exclude("${project.name}-$version-all.jar", "*-Addon-$version.jar")
}
// Copy the addons.
copy {
from("$buildDir/libs/")
into("$releasePath/addons")
include("*-Addon-$version.jar")
exclude("${project.name}-$version-all.jar")
}
val readme = file("$releasePath/README.txt")
readme.writeText(
"Hi, thanks for reading!\n" +
"\n" +
"The FactionsX-${project.version} is a normal minecraft plugin, can goes in the \"/plugins/\" folder.\n" +
"All jar files in the \"Addons\" folder, go in the \"/plugins/FactionsX/addons/\" folder.\n" +
"* F CropUpgrades Addon is 1.13+.\n" +
"\n" +
"The FactionsUUIDAPIProxy attempts to imitate FactionsUUID being present on your server, and proxies the API calls to FactionsX,\n" +
"this allows plugins using FactionsUUID's API to work with FactionsX. This is a very new addition and I dont expect it to work perfectly\n" +
"as it IS a hack. If you have issues with a plugin feel free to come to our discord for support.\n" +
"* FactionsUUIDAPIProxy is a minecraft plugin and goes in \"/plugins/\".\n" +
"\n" +
"\n" +
"Basic documentation for permissions or commands specific to this build can be found in the \"/plugins/FactionsX/docs\" " +
"folder after the first time starting up\n" +
"\n" +
"Discord: https://discord.gg/savagelabs\n" +
"Wiki: https://wiki.savagelabs.net"
)
zipTo(File("${buildDir}/release/FactionsX-Release-${project.version}.zip"), File(releasePath))
}
}
register("copyToServer") {
dependsOn(copyToRoot)
doLast {
if (project.hasProperty("serverPluginDirectory").not()) {
println(
"No serverPluginDirectory argument found, ex: \n" +
"gradle shadowJar copyToServer -PserverPluginDirectory=~/Documents/mc-server/plugins/"
)
return@doLast
}
println("copying $serverPluginDirectory")
// Copy the plugins.
copy {
from("$buildDir/libs/")
into(serverPluginDirectory)
include("*.jar")
exclude("${project.name}-$version-all.jar", "*-Addon-$version.jar")
}
// Copy the addons.
copy {
from("$buildDir/libs/")
into("$serverPluginDirectory/FactionsX/addons")
include("*-Addon-$version.jar")
exclude("${project.name}-$version-all.jar")
}
}
}
}
subprojects {
repositories {
mavenLocal()
mavenCentral()
maven("https://repo.maven.apache.org/maven2")
maven("https://nexus.savagelabs.net/repository/maven-releases/")
maven("https://hub.spigotmc.org/nexus/content/groups/public/")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots")
maven("https://repo.dmulloy2.net/nexus/repository/public/")
maven("https://oss.sonatype.org/content/groups/public/")
maven("http://repo.extendedclip.com/content/repositories/placeholderapi/")
maven("https://repo.codemc.org/repository/maven-public")
maven("https://papermc.io/repo/repository/maven-public/")
maven("https://ci.ender.zone/plugin/repository/everything/")
// maven("https://mavenrepo.cubekrowd.net/artifactory/repo/")
maven("https://maven.enginehub.org/repo/")
maven("https://jcenter.bintray.com/")
// maven("https://nexus.savagelabs.net/repository/maven-public/")
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://papermc.io/repo/repository/maven-releases/")
maven("https://ci.ender.zone/plugin/repository/everything/")
maven("https://minevolt.net/repo/")
maven("http://repo.citizensnpcs.co/")
maven("http://nexus.sirblobman.xyz/repository/public/")
maven("https://jitpack.io")
}
}
repositories {
mavenCentral()
mavenLocal()
}