-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
117 lines (105 loc) · 4.01 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
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.50'
id 'com.github.johnrengelman.shadow' version '5.1.0'
}
group 'io.illyria'
version '1.0-ALPHA'
sourceCompatibility = 1.8
repositories {
mavenCentral()
mavenLocal()
maven {
url "https://hub.spigotmc.org/nexus/content/repositories/snapshots"
}
maven {
url 'https://nexus.illyria.io/repository/maven-public/'
}
maven {
url 'https://rayzr.dev/repo/'
}
maven {
url 'https://libraries.minecraft.net/'
}
maven {
url "http://repo.dmulloy2.net/nexus/repository/public/"
}
}
dependencies {
implementation 'com.github.stefvanschie.inventoryframework:IF:0.5.8'
compileOnly ("org.spigotmc:spigot-api:1.14.2-R0.1-SNAPSHOT") {
exclude group: 'net.md-5', module: 'bungeecord-chat'
exclude group: 'javax.persistence', module: 'persistence-api'
exclude group: 'junit', module: 'junit'
exclude group: 'com.google.guava', module: 'guava'
exclude group: 'com.google.code.gson', module: 'gson'
}
implementation 'com.google.code.gson:gson:2.8.5'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation 'net.prosavage:BasePlugin:1.5'
compileOnly group: "com.comphenix.protocol", name: "ProtocolLib", version: "4.4.0"
compile 'me.rayzr522:jsonmessage:1.2.0'
}
processResources {
eachFile { details ->
if (details.name.endsWith('.yml')) { // or whatever pattern/criteria is appropriate
filter{
String line -> line.replaceAll('\\$\\{project.version\\}', version)
}
}
}
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
shadowJar {
mergeServiceFiles()
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
relocate 'com.github.stefvanschie.inventoryframework', 'io.illyria.skyblockx.shade.stefvanschie.inventoryframework'
relocate 'com.google.gson', 'io.illyria.skyblockx.shade.com.google.gson'
relocate 'net.prosavage.baseplugin', 'io.illyria.skyblockx.shade.baseplugin'
relocate 'org.jetbrains.kotlin', 'io.illyria.skyblockx.shade.kotlin'
relocate 'me.rayzr522.jsonmessage', 'io.illyria.skyblockx.shade.jsonmessage'
relocate 'io.illyria.WorldBorder-API', 'io.illyria.skyblockx.shade.WorldBorder-API'
archiveName 'SkyblockX.jar'
}
task updatePermissionsList {
File permissionsFile = file(".\\src\\main\\kotlin\\io\\illyria\\skyblockx\\core\\Permission.kt")
String text = permissionsFile.text
// Splits the file's text @ `{`.
// The first one should show the beginning of the class.
String[] textSplit = text.split("\\{")
String permissionsEnumText = textSplit[1].split(";")[0]
String[] permissionsListRaw = permissionsEnumText.split(",")
// Process each permission.
StringBuilder table = new StringBuilder()
table.append("Permission Name | Permission Node\n")
table.append("--- | ---\n")
for (String permissionRaw : permissionsListRaw) {
String[] permissionSplit = permissionRaw.split("\"")
String permissionName = permissionSplit[0].replace("(", "").replaceAll("[\\n\\t ]", "")
String permissionNode = "skyblockx.${permissionSplit[1].replace(" ", "").replaceAll("[\\n\\t ]", "")}"
println permissionName + " " + "skyblockx." + permissionSplit[1]
table.append("$permissionName | `$permissionNode`\n")
}
println("File Processed.")
// Clone and update wiki.
delete "./Wiki"
println("Deleted Wiki Folder.")
exec { commandLine 'git', 'clone', 'https://github.com/illyria-io/SkyblockX.wiki.git', 'Wiki' }
println("Wiki Cloned")
File permissionsWikiFile = file(".\\Wiki\\Permissions.md")
delete "./Wiki/Permissions.md"
println("Old Permissions.md Deleted.")
permissionsWikiFile.createNewFile()
println("New Permissions.md Created.")
permissionsWikiFile.text = table.toString()
println("Permissions.md file content set.")
}
task ci {
dependsOn clean
dependsOn shadowJar
}