|
1 | | -plugins { |
2 | | - id 'com.github.johnrengelman.shadow' version '8.1.1' |
3 | | - id 'kr.entree.spigradle' version '2.4.3' |
4 | | - id 'io.freefair.lombok' version '8.10.2' |
5 | | - id 'java' |
6 | | - id 'jacoco' |
7 | | -} |
8 | | - |
9 | | -sourceCompatibility = 21 |
10 | | -targetCompatibility = 21 |
11 | | - |
12 | | -ext { |
13 | | - mcVersion = "1.21.3" |
14 | | -} |
15 | | -archivesBaseName = "WorldSystem" |
16 | | -version = "2.4.38" |
17 | | -spigot { |
18 | | -group "de.butzlabben" |
19 | | -name = "WorldSystem" |
20 | | -authors = [" Trainerlord, Butzlabben & N1klasse "] |
21 | | -apiVersion = "1.21" |
22 | | -depends = ["WorldEdit"] |
23 | | -load = STARTUP |
24 | | - commands { |
25 | | - "ws" { |
26 | | - description = 'All WorldSystem Commands' |
27 | | - permissionMessage = 'You do not have permission!' |
28 | | - } |
29 | | - } |
30 | | - permissions { |
31 | | - 'ws.*' { |
32 | | - description = 'gives all Perms' |
33 | | - defaults = 'op' |
34 | | - children = [ |
35 | | - 'ws.tp.*':true, |
36 | | - 'ws.get':true, |
37 | | - 'ws.sethome':true, |
38 | | - 'ws.tp.world':true, |
39 | | - 'ws.tp.toother':true, |
40 | | - 'ws.tp.other':true, |
41 | | - 'ws.build':true, |
42 | | - 'ws.gamemode':true, |
43 | | - 'ws.delete':true, |
44 | | - 'ws.lag':true, |
45 | | - 'ws.big':true, |
46 | | - 'ws.large':true, |
47 | | - //'ws.confirm':true |
48 | | - ] |
49 | | - } |
50 | | - 'ws.sethome' { |
51 | | - description = 'You can set a different worldspawn' |
52 | | - defaults = true |
53 | | - } |
54 | | - 'ws.tp' { |
55 | | - description = 'You can teleport everything' |
56 | | - defaults = 'op' |
57 | | - children = ['ws.tp.toother':true,'ws.tp.other':true,'ws.tp.world':true] |
58 | | - } |
59 | | - 'ws.build' { |
60 | | - description = 'You can build on other Worlds without WorldPermissions' |
61 | | - defaults = 'op' |
62 | | - } |
63 | | - 'ws.get' { |
64 | | - description = 'You can create a world via /ws get' |
65 | | - defaults = true |
66 | | - } |
67 | | - 'ws.delete' { |
68 | | - description = 'You can delete a world' |
69 | | - defaults = 'op' |
70 | | - } |
71 | | - 'ws.gamemode' { |
72 | | - description = 'You can change GameMode on other worlds' |
73 | | - defaults = 'op' |
74 | | - } |
75 | | - 'ws.tp.other' { |
76 | | - description = 'You can teleport other persons' |
77 | | - defaults = 'op' |
78 | | - } |
79 | | - 'ws.tp.toother' { |
80 | | - description = 'You can teleport across worlds' |
81 | | - defaults = 'op' |
82 | | - } |
83 | | - 'ws.tp.world' { |
84 | | - description = 'You can teleport to without rights World' |
85 | | - defaults = 'op' |
86 | | - } |
87 | | - 'ws.lag' { |
88 | | - description = 'You can see lag messages' |
89 | | - defaults = 'op' |
90 | | - } |
91 | | - 'ws.big' { |
92 | | - description = 'Gives you a bigger world (if set)' |
93 | | - defaults = 'op' |
94 | | - } |
95 | | - 'ws.large' { |
96 | | - defaults = 'op' |
97 | | - children = ['ws.big':true] |
98 | | - /*} |
99 | | - 'ws.confirm' { |
100 | | - description = 'You can confirm (if needed) an auto-update' |
101 | | - defaults = 'op'*/ |
102 | | - } |
103 | | - } |
104 | | -} |
105 | | - |
106 | | -repositories { |
107 | | - mavenCentral() |
108 | | - maven { url "https://hub.spigotmc.org/nexus/content/repositories/public/" } |
109 | | - maven { url "https://repo.extendedclip.com/content/repositories/placeholderapi/" } |
110 | | - maven { url "https://ci.athion.net/job/FastAsyncWorldEdit/ws" } |
111 | | - maven { url "https://jitpack.io" } |
112 | | - maven { url "https://libraries.minecraft.net" } |
113 | | - maven { url "https://repo.onarandombox.com/content/groups/public/" } |
114 | | - maven { url "https://maven.enginehub.org/repo/" } |
115 | | - maven { url "https://ci.athion.net/job/FastAsyncWorldEdit/changes/" } |
116 | | - maven { url "https://mvnrepository.com/artifact/commons-io/commons-io/" } // Commons - IO |
117 | | - maven { url "https://maven.enginehub.org/repo/" } // WorldEdit |
118 | | - maven { url "https://mvn.intellectualsites.com/content/repositories/releases/" } |
119 | | -} |
120 | | - |
121 | | -dependencies { |
122 | | - implementation("org.yaml:snakeyaml:2.3") |
123 | | - implementation("net.kyori:adventure-text-minimessage:4.17.0") |
124 | | - compileOnly lombok() |
125 | | - annotationProcessor lombok() |
126 | | - //Test dependencies |
127 | | - testImplementation 'org.junit.jupiter:junit-jupiter:5.+' |
128 | | - testImplementation "org.mockito:mockito-core:5.+" |
129 | | - testImplementation 'org.assertj:assertj-core:3.+' |
130 | | - testImplementation lombok() |
131 | | - testAnnotationProcessor lombok() |
132 | | - implementation group: 'commons-io', name: 'commons-io', version: '2.17.0' |
133 | | - |
134 | | - compileOnly("me.clip:placeholderapi:2.11.6") |
135 | | - compileOnly("com.github.MilkBowl:VaultAPI:1.7.1") |
136 | | - compileOnly("com.mojang:authlib:1.5.26") |
137 | | - compileOnly("org.projectlombok:lombok:1.18.34") |
138 | | - compileOnly("org.spigotmc:spigot-api:1.21.3-R0.1-SNAPSHOT") |
139 | | - compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.3.6-SNAPSHOT") |
140 | | - compileOnly("com.sk89q.worldedit:worldedit-core:7.3.6-SNAPSHOT") |
141 | | - compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit:2.12.0") |
142 | | - compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core:2.12.0") |
143 | | -} |
144 | | -shadowJar { |
145 | | - minimize() |
146 | | - archiveFileName.set("${project.name}-${project.version}.jar") |
147 | | -} |
148 | | -javadoc { |
149 | | - options.links( |
150 | | - 'https://javadoc.io/static/org.jetbrains/annotations/20.1.0/', |
151 | | - 'https://docs.oracle.com/javase/17/docs/api/', |
152 | | - 'https://papermc.io/javadocs/paper/1.21.3/' |
153 | | - ) |
154 | | - source = sourceSets.main.allJava |
155 | | - include("**/api/*") |
156 | | - destinationDir = new File("build/javadocs") |
157 | | -} |
158 | | -processResources { |
159 | | - project.properties.put("version", this.version) |
160 | | - expand project.properties |
161 | | - from(sourceSets.main.resources.srcDirs) { |
162 | | - duplicatesStrategy DuplicatesStrategy.INCLUDE |
163 | | - } |
164 | | -} |
165 | | - |
166 | | -tasks.withType(JavaCompile) { |
167 | | - options.encoding = 'UTF-8' |
168 | | - options.compilerArgs += ["-parameters"] |
169 | | - options.fork = true |
170 | | -} |
171 | | -test { |
172 | | - useJUnitPlatform() |
173 | | - testLogging { |
174 | | - events "passed", "skipped", "failed" |
175 | | - } |
176 | | - ignoreFailures = false |
177 | | -} |
178 | | -tasks.build.dependsOn tasks.shadowJar |
179 | | - |
180 | | -defaultTasks 'build' |
| 1 | +plugins { |
| 2 | + id 'com.gradleup.shadow' version '8.3.4' |
| 3 | + id 'io.freefair.lombok' version '8.10.2' |
| 4 | + id 'java' |
| 5 | + id 'jacoco' |
| 6 | + id 'base' |
| 7 | +} |
| 8 | + |
| 9 | +group = "de.butzlabben" |
| 10 | +version = "2.4.38" |
| 11 | +java { |
| 12 | + sourceCompatibility = JavaVersion.VERSION_21 |
| 13 | + targetCompatibility = JavaVersion.VERSION_21 |
| 14 | +} |
| 15 | +ext { // Dependency versions |
| 16 | + SpigotAPI = "1.21.3-R0.1-SNAPSHOT" |
| 17 | + AuthLib = "1.5.26" |
| 18 | + WorldEdit = "7.3.6-SNAPSHOT" |
| 19 | + FAWE = "2.12.0" |
| 20 | + VaultAPI = "1.7.1" |
| 21 | + PlaceholderAPI = "2.11.6" |
| 22 | + Lombok = "1.18.34" |
| 23 | + CommonsIO = "2.17.0" |
| 24 | + Minimessage = "4.17.0" |
| 25 | + SnakeYAML = "2.3" |
| 26 | +} |
| 27 | +base { |
| 28 | + archivesName = "WorldSystem" |
| 29 | +} |
| 30 | + |
| 31 | + |
| 32 | +repositories { |
| 33 | + mavenCentral() |
| 34 | + maven { url "https://jitpack.io" } |
| 35 | + maven { url "https://libraries.minecraft.net" } |
| 36 | + maven { url "https://repo.onarandombox.com/content/groups/public/" } |
| 37 | + maven { url "https://hub.spigotmc.org/nexus/content/repositories/public/" } |
| 38 | + maven { url "https://mvn.intellectualsites.com/content/repositories/releases/" } |
| 39 | + // Plugin repositories |
| 40 | + maven { url "https://repo.extendedclip.com/content/repositories/placeholderapi/" } |
| 41 | + maven { url "https://ci.athion.net/job/FastAsyncWorldEdit/ws" } |
| 42 | + maven { url "https://maven.enginehub.org/repo/" } |
| 43 | +} |
| 44 | + |
| 45 | +dependencies { |
| 46 | + // YAML Parser |
| 47 | + implementation("org.yaml:snakeyaml:${SnakeYAML}") |
| 48 | + |
| 49 | + // Adventure API for text formatting |
| 50 | + implementation("net.kyori:adventure-text-minimessage:${Minimessage}") |
| 51 | + |
| 52 | + // Lombok for code generation |
| 53 | + compileOnly "org.projectlombok:lombok:${Lombok}" |
| 54 | + annotationProcessor "org.projectlombok:lombok:${Lombok}" |
| 55 | + |
| 56 | + // Commons IO library |
| 57 | + implementation "commons-io:commons-io:${CommonsIO}" |
| 58 | + |
| 59 | + // Compile-only dependencies |
| 60 | + compileOnly("me.clip:placeholderapi:${PlaceholderAPI}") |
| 61 | + compileOnly("com.github.MilkBowl:VaultAPI:${VaultAPI}") |
| 62 | + compileOnly("com.mojang:authlib:${AuthLib}") |
| 63 | + compileOnly("org.spigotmc:spigot-api:${SpigotAPI}") |
| 64 | + compileOnly("com.sk89q.worldedit:worldedit-bukkit:${WorldEdit}") |
| 65 | + compileOnly("com.sk89q.worldedit:worldedit-core:${WorldEdit}") |
| 66 | + compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit:${FAWE}") |
| 67 | + compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core:${FAWE}") |
| 68 | + |
| 69 | + // Test dependencies |
| 70 | + testImplementation 'org.junit.jupiter:junit-jupiter:5.+' |
| 71 | + testImplementation "org.mockito:mockito-core:5.+" |
| 72 | + testImplementation 'org.assertj:assertj-core:3.+' |
| 73 | + testImplementation "org.projectlombok:lombok:${Lombok}" |
| 74 | + testAnnotationProcessor "org.projectlombok:lombok:${Lombok}" |
| 75 | +} |
| 76 | + |
| 77 | +processResources { |
| 78 | + project.properties.put("version", this.version) // Add version to properties |
| 79 | + expand project.properties // Replace placeholders in resources |
| 80 | + from(sourceSets.main.resources.srcDirs) { |
| 81 | + include 'plugin.yml' // Ensure plugin.yml is included |
| 82 | + duplicatesStrategy DuplicatesStrategy.INCLUDE // Handle duplicates |
| 83 | + } |
| 84 | +} |
| 85 | + |
| 86 | +shadowJar { |
| 87 | + minimize() |
| 88 | + archiveClassifier.set('') |
| 89 | + archiveFileName.set("${project.name}-${project.version}.jar") |
| 90 | +} |
| 91 | + |
| 92 | +javadoc { |
| 93 | + options.links( |
| 94 | + 'https://javadoc.io/static/org.jetbrains/annotations/20.1.0/', |
| 95 | + 'https://docs.oracle.com/javase/17/docs/api/', |
| 96 | + 'https://papermc.io/javadocs/paper/1.21.3/' |
| 97 | + ) |
| 98 | + source = sourceSets.main.allJava |
| 99 | + include("**/api/*") |
| 100 | + destinationDir = new File("build/javadocs") |
| 101 | +} |
| 102 | + |
| 103 | +tasks.withType(JavaCompile) { |
| 104 | + options.encoding = 'UTF-8' |
| 105 | + options.compilerArgs += ["-parameters"] |
| 106 | + options.fork = true |
| 107 | +} |
| 108 | + |
| 109 | +test { |
| 110 | + useJUnitPlatform() |
| 111 | + testLogging { |
| 112 | + events "passed", "skipped", "failed" |
| 113 | + } |
| 114 | + ignoreFailures = false |
| 115 | +} |
| 116 | + |
| 117 | +tasks.build.dependsOn tasks.shadowJar |
| 118 | + |
| 119 | +defaultTasks 'build' |
0 commit comments