@@ -6,7 +6,7 @@ plugins {
66}
77
88group = ' org.moddingx'
9- java. toolchain. languageVersion = JavaLanguageVersion . of(21 )
9+ java. toolchain. languageVersion = JavaLanguageVersion . of(25 )
1010
1111configurations {
1212 lib
@@ -33,8 +33,8 @@ repositories {
3333}
3434
3535dependencies {
36- lib ' org.ow2.asm:asm:9.8 '
37- lib ' org.ow2.asm:asm-tree:9.8 '
36+ lib ' org.ow2.asm:asm:9.9.1 '
37+ lib ' org.ow2.asm:asm-tree:9.9.1 '
3838 libImpl ' jakarta.annotation:jakarta.annotation-api:3.0.0'
3939 libImpl ' net.sf.jopt-simple:jopt-simple:5.0.4'
4040 implementation sourceSets. lib. output
@@ -51,39 +51,46 @@ gradlePlugin {
5151 }
5252}
5353
54- jar {
54+ tasks . named( ' jar' , Jar ) . configure { task ->
5555 from sourceSets. lib. output
56- manifest {
56+ task . manifest {
5757 attributes ' Main-Class' : application. mainClass. get()
5858 }
5959}
6060
61- task fatjar ( type : Jar ) {
61+ var fatJar = tasks . register( ' fatjar ' , Jar ) { task ->
6262 archiveClassifier = ' fatjar'
63- manifest = jar. manifest
64- with jar
65- }
66- build. dependsOn fatjar
63+ manifest = tasks. named(' jar' , Jar ). get(). manifest
64+ with tasks. named(' jar' , Jar ). get()
6765
68- task configureFatJar {
69- doLast {
70- configurations. libResolvable. each { dep ->
71- fatjar. from(project. zipTree(dep)) {
72- exclude ' META-INF/*.SF' , ' META-INF/*.DSA' , ' META-INF/*.RSA' , ' module-info.class'
73- duplicatesStrategy DuplicatesStrategy . INCLUDE
74- }
66+ configurations. runtimeClasspath. each { dep ->
67+ task. from(project. zipTree(dep)) {
68+ exclude ' META-INF/MANIFEST.MF' , ' META-INF/INDEX.LIST'
69+ exclude ' module-info.class' , ' META-INF/versions/*/module-info.class'
70+ exclude ' META-INF/*.SF' , ' META-INF/*.DSA' , ' META-INF/*.RSA' , ' META-INF/SIG-*'
71+ exclude ' META-INF/README*' , ' META-INF/LICENSE*' , ' META-INF/NOTICE*'
72+ exclude ' META-INF/readme*' , ' META-INF/license*' , ' META-INF/notice*'
73+ duplicatesStrategy DuplicatesStrategy . FAIL
74+ }
75+ task. from(project. zipTree(dep)) {
76+ include ' META-INF' , ' META-INF/**' , ' module-info.class'
77+ into " META-INF/libraries/${ dep.name.replaceAll('\\.jar$', '')} /"
78+ duplicatesStrategy DuplicatesStrategy . FAIL
7579 }
7680 }
77- outputs. upToDateWhen { false }
7881}
79- fatjar. dependsOn configureFatJar
8082
81- task sourcesJar ( type : Jar , dependsOn : classes ) {
83+ var sourcesJar = tasks . register( ' sourcesJar ' , Jar ) {
8284 archiveClassifier = ' sources'
8385 from sourceSets. lib. allSource
8486 from sourceSets. main. allSource
87+ dependsOn tasks. named(' classes' )
88+ }
89+
90+ tasks. named(' build' ). configure { task ->
91+ task. dependsOn fatJar
92+ task. dependsOn sourcesJar
8593}
86- build. dependsOn sourcesJar
8794
8895publishing {
8996 publications {
0 commit comments