1- import net.minecraftforge.gradleutils.PomUtils
21
32plugins {
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+
1419println " Version: $version "
1520
1621java {
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
2927dependencies {
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
3639test {
@@ -42,7 +45,7 @@ changelog {
4245}
4346
4447license {
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+
5879publishing {
5980 publications. register(' mavenJava' , MavenPublication ) {
6081 from components. java
0 commit comments