1- buildscript {
2- repositories {
3- mavenCentral()
4- maven { url = ' https://maven.minecraftforge.net/' }
5- }
6- dependencies {
7- classpath group : ' net.minecraftforge.gradleutils' , name : ' GradleUtils' , version : ' 2.+' , changing : true
8- }
9- }
1+ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2+ import net.minecraftforge.gradleutils.PomUtils
103
114plugins {
125 id ' java-library'
136 id ' eclipse'
147 id ' maven-publish'
158 id ' org.cadixdev.licenser' version ' 0.6.1'
16- id ' com.github.johnrengelman.shadow' version ' 7.0.0'
9+ id ' com.github.johnrengelman.shadow' version ' 8.1.1'
10+ id ' net.minecraftforge.gradleutils' version ' 2.+'
1711}
18- apply plugin : ' net.minecraftforge.gradleutils'
1912
20- group ' net.minecraftforge'
13+ group = ' net.minecraftforge'
2114version = gradleutils. getTagOffsetBranchVersion(null , ' master' , ' HEAD' )
22- println (' Version: ' + version)
23-
24- java. toolchain. languageVersion = JavaLanguageVersion . of(8 )
25- compileJava. options. encoding = ' UTF-8'
15+ println " Version: $version "
2616
27- ext {
28- CHANGELOG = rootProject. file(' build/changelog.txt' )
29- REPO = ' ForgeAutoRenamingTool'
30- TITLE = ' Forge Auto Renaming Tool'
31- MANIFEST = manifest{
32- attributes(' Main-Class' : ' net.minecraftforge.fart.Main' )
33- attributes([
34- ' Specification-Title' : ' ForgeAutoRenamingTool' ,
35- ' Specification-Vendor' : ' Forge Development LLC' ,
36- ' Specification-Version' : gradleutils. gitInfo. tag,
37- ' Implementation-Title' : ' SimpleInstaller' ,
38- ' Implementation-Version' : project. version,
39- ' Implementation-Vendor' : ' Forge Development LLC'
40- ] as LinkedHashMap , ' net/minecraftforge/fart/' )
17+ java {
18+ toolchain {
19+ languageVersion = JavaLanguageVersion . of(8 )
4120 }
42- INITIAL_CHANGELOG_TAG = ' 0.1 '
21+ withSourcesJar()
4322}
4423
4524repositories {
4625 mavenCentral()
47- maven { url = ' https://maven.minecraftforge.net/' }
48- }
49-
50- test {
51- useJUnitPlatform()
52- }
53-
54- license {
55- header = file(' LICENSE-header.txt' )
56- ext. project = TITLE
26+ maven gradleutils. forgeMaven
5727}
5828
5929dependencies {
@@ -63,79 +33,98 @@ dependencies {
6333 implementation ' org.ow2.asm:asm-commons:9.5'
6434 implementation ' org.ow2.asm:asm-tree:9.5'
6535
66- testImplementation( platform(' org.junit:junit-bom:5.8.1' ) )
67- testImplementation( ' org.junit.jupiter:junit-jupiter' )
68- testImplementation( ' org.powermock:powermock-core:2.0.9' )
36+ testImplementation platform(' org.junit:junit-bom:5.8.1' )
37+ testImplementation ' org.junit.jupiter:junit-jupiter'
38+ testImplementation ' org.powermock:powermock-core:2.0.9'
6939
7040 compileOnly ' org.jetbrains:annotations:24.0.1'
7141}
7242
43+ tasks. named(' test' , Test ). configure {
44+ useJUnitPlatform()
45+ testLogging {
46+ events ' passed' , ' skipped' , ' failed'
47+ }
48+ }
7349
74- test {
75- useJUnitPlatform()
76- testLogging {
77- events ' passed' , ' skipped' , ' failed'
78- }
50+ tasks. named(' jar' , Jar ). configure {
51+ manifest {
52+ attributes(' Main-Class' : ' net.minecraftforge.fart.Main' )
53+ attributes([
54+ ' Specification-Title' : ' ForgeAutoRenamingTool' ,
55+ ' Specification-Vendor' : ' Forge Development LLC' ,
56+ ' Specification-Version' : gradleutils. gitInfo. tag,
57+ ' Implementation-Title' : ' ForgeAutoRenamingTool' ,
58+ ' Implementation-Version' : project. version,
59+ ' Implementation-Vendor' : ' Forge Development LLC'
60+ ], ' net/minecraftforge/fart/' )
61+ }
7962}
8063
81- java. withSourcesJar()
64+ tasks. named(' shadowJar' , ShadowJar ). configure {
65+ manifest {
66+ attributes(' Main-Class' : ' net.minecraftforge.fart.Main' )
67+ attributes([
68+ ' Specification-Title' : ' ForgeAutoRenamingTool' ,
69+ ' Specification-Vendor' : ' Forge Development LLC' ,
70+ ' Specification-Version' : gradleutils. gitInfo. tag,
71+ ' Implementation-Title' : ' ForgeAutoRenamingTool' ,
72+ ' Implementation-Version' : project. version,
73+ ' Implementation-Vendor' : ' Forge Development LLC'
74+ ], ' net/minecraftforge/fart/' )
75+ }
8276
83- shadowJar {
84- manifest. from(MANIFEST )
8577 minimize()
8678
87- def relocations = [
79+ final List< String > relocations = [
8880 ' org.objectweb.asm' ,
8981 ' net.minecraftforge.srgutils' ,
9082 ' joptsimple'
9183 ]
9284
93- relocations. forEach {
85+ relocations. each {
9486 relocate it, " net.minecraftforge.fart.relocated.$it "
9587 }
9688}
9789
98- assemble. dependsOn shadowJar
90+ tasks. named(' assemble' ). configure {
91+ dependsOn ' shadowJar'
92+ }
93+
94+ tasks. named(' compileJava' , JavaCompile ). configure {
95+ options. encoding = ' UTF-8'
96+ }
97+
98+ changelog {
99+ fromTag ' 0.1'
100+ }
101+
102+ license {
103+ header = file(' LICENSE-header.txt' )
104+ newLine = false
105+ exclude ' **/*.properties'
106+ }
99107
100108publishing {
101- publications {
102- mavenJava(MavenPublication ) {
103- from components. java
104- pom {
105- name = TITLE
106- description = ' A tool that renames java bytecode elements.'
107- url = " https://github.com/MinecraftForge/${ REPO} "
108- scm {
109- url = " https://github.com/MinecraftForge/${ REPO} "
110- connection = " scm:git:git://github.com/MinecraftForge/${ REPO} .git"
111- developerConnection
= " scm:git:[email protected] :MinecraftForge/${ REPO} .git" 112- }
113- issueManagement {
114- system = ' github'
115- url = " https://github.com/MinecraftForge/${ REPO} /issues"
116- }
117-
118- licenses {
119- license {
120- name = ' LGPLv2.1'
121- url = ' https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt'
122- }
123- }
124-
125- developers {
126- developer {
127- id = ' LexManos'
128- name = ' LexManos'
129- }
130- }
109+ publications. register(' mavenJava' , MavenPublication ) {
110+ from components. java
111+
112+ pom {
113+ name = ' Forge Auto Renaming Tool'
114+ description = ' A tool that renames java bytecode elements.'
115+ url = ' https://github.com/MinecraftForge/ForgeAutoRenamingTool'
116+
117+ PomUtils . setGitHubDetails(pom, ' ForgeAutoRenamingTool' )
118+
119+ license PomUtils.Licenses.LGPLv2_1
120+
121+ developers {
122+ developer PomUtils.Developers.LexManos
131123 }
132124 }
133125 }
126+
134127 repositories {
135128 maven gradleutils. getPublishingForgeMaven()
136129 }
137130}
138-
139- changelog {
140- fromTag INITIAL_CHANGELOG_TAG
141- }
0 commit comments