Skip to content

Commit 663a639

Browse files
authored
Update Gradle to 8.14.3 and modernize buildscript (#24)
* Modernize buildscript and update Gradle to 8.14.3 * Replace JavaX Nullable with JetBrains Nullable
1 parent 526aaeb commit 663a639

9 files changed

Lines changed: 187 additions & 140 deletions

File tree

build.gradle

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
1-
import net.minecraftforge.gradleutils.PomUtils
21

32
plugins {
43
id 'java'
4+
id 'idea'
55
id 'eclipse'
66
id 'maven-publish'
7-
id 'org.cadixdev.licenser' version '0.6.1'
8-
id 'net.minecraftforge.gradleutils' version '[2.3,2.4)'
9-
id 'com.github.ben-manes.versions' version '0.50.0'
7+
alias libs.plugins.licenser
8+
alias libs.plugins.gradleutils
9+
alias libs.plugins.versions
1010
}
1111

12-
group 'net.minecraftforge'
13-
version = gradleutils.getTagOffsetVersion()
12+
final projectDisplayName = 'SRG Utils'
13+
final projectArtifactId = base.archivesName = 'srgutils'
14+
final projectVendor = 'Forge Development LLC'
15+
description = 'Library for managing java obfuscation mappings in various formats.'
16+
group = 'net.minecraftforge'
17+
version = gitversion.tagOffset
18+
1419
println "Version: $version"
1520

1621
java {
17-
toolchain {
18-
languageVersion = JavaLanguageVersion.of(8)
19-
}
20-
withSourcesJar()
21-
}
22+
toolchain.languageVersion = JavaLanguageVersion.of(8)
2223

23-
repositories {
24-
mavenLocal()
25-
maven gradleutils.forgeMaven
26-
mavenCentral()
24+
withSourcesJar()
2725
}
2826

2927
dependencies {
30-
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
31-
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.1'
32-
testImplementation 'org.powermock:powermock-core:2.0.9'
33-
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
28+
//region Static Analysis
29+
compileOnly libs.nulls
30+
compileOnly libs.jsr305
31+
//endregion
32+
33+
//region Testing
34+
testImplementation libs.bundles.junit
35+
testImplementation libs.powermock
36+
//endregion
3437
}
3538

3639
test {
@@ -42,7 +45,7 @@ changelog {
4245
}
4346

4447
license {
45-
header = file('LICENSE-header.txt')
48+
header = rootProject.file('LICENSE-header.txt')
4649
newLine = false
4750
exclude '**/*.properties'
4851
}
@@ -52,9 +55,27 @@ tasks.named('jar', Jar) {
5255
attributes([
5356
'Automatic-Module-Name': 'net.minecraftforge.srgutils'
5457
])
58+
attributes([
59+
'Specification-Title' : projectDisplayName,
60+
'Specification-Vendor' : projectVendor,
61+
'Specification-Version' : gitversion.info.tag,
62+
'Implementation-Title' : projectDisplayName,
63+
'Implementation-Vendor' : projectVendor,
64+
'Implementation-Version': project.version
65+
], 'net/minecraftforge/srgutils')
5566
}
5667
}
5768

69+
tasks.named('shadowJar', ShadowJar) {
70+
archiveClassifier = ''
71+
enableRelocation = true
72+
relocationPrefix = 'net.minecraftforge.srgutils.shadow'
73+
}
74+
75+
artifacts {
76+
archives shadowJar
77+
}
78+
5879
publishing {
5980
publications.register('mavenJava', MavenPublication) {
6081
from components.java

gradle/wrapper/gradle-wrapper.jar

-17.9 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

Lines changed: 16 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 94 additions & 92 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)