Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 3a29a48

Browse files
committed
Refactor build.gradle for improved readability and maintainability
1 parent 38302ab commit 3a29a48

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

build.gradle

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
plugins {
22
id 'java-library'
33
id 'maven-publish'
4-
id("io.papermc.paperweight.userdev") version "2.0.0-beta.17"
5-
id("com.gradleup.shadow") version "8.3.8"
4+
id "io.papermc.paperweight.userdev" version "2.0.0-beta.17"
5+
id "com.gradleup.shadow" version "8.3.8"
66
}
77

88
group = 'gg.nextforge'
99
version = '1.0-SNAPSHOT'
1010

11-
1211
repositories {
1312
mavenCentral()
1413
}
@@ -44,10 +43,17 @@ subprojects {
4443
implementation "com.google.code.gson:gson:2.10.1"
4544
implementation "org.bstats:bstats-bukkit:3.0.2"
4645
}
47-
}
4846

49-
test {
50-
useJUnitPlatform()
47+
// Version-Injection auch in Subprojects, falls benötigt
48+
tasks.withType(ProcessResources).configureEach {
49+
filesMatching("plugin.yml") {
50+
expand(
51+
version: project.version,
52+
group: project.group,
53+
name: project.name
54+
)
55+
}
56+
}
5157
}
5258

5359
java {
@@ -66,12 +72,13 @@ tasks {
6672
options.encoding = "UTF-8"
6773
}
6874

75+
// Haupt-Versionserweiterung für plugin.yml
6976
processResources {
7077
filesMatching("plugin.yml") {
7178
expand(
72-
version: project.version,
73-
group: project.group,
74-
name: project.name
79+
version: project.version,
80+
group: project.group,
81+
name: project.name
7582
)
7683
}
7784
}
@@ -84,11 +91,9 @@ shadowJar {
8491
}
8592

8693
publishing {
87-
8894
repositories {
8995
mavenLocal()
9096
}
91-
9297
publications {
9398
create("mavenJava", MavenPublication) {
9499
from components.java
@@ -102,4 +107,4 @@ publishing {
102107
}
103108
}
104109
}
105-
}
110+
}

0 commit comments

Comments
 (0)