@@ -3,6 +3,7 @@ plugins {
3
3
id ' legacy-looming' version " 1.10-SNAPSHOT" // Version must be the same as fabric-loom's
4
4
id ' maven-publish'
5
5
id ' com.gradleup.shadow' version ' 8.3.6'
6
+ id ' xyz.wagyourtail.jvmdowngrader' version ' 1.3.0'
6
7
id " com.modrinth.minotaur" version " 2.+"
7
8
id ' jacoco'
8
9
id " org.sonarqube" version " 5.0.0.4638"
@@ -62,6 +63,12 @@ dependencies {
62
63
testImplementation " net.fabricmc:fabric-loader-junit:${ project.loader_version} "
63
64
}
64
65
66
+ jvmdg {
67
+ downgradeTo = JavaVersion . VERSION_1_8
68
+ multiReleaseOriginal. set(true )
69
+ multiReleaseVersions = [JavaVersion . VERSION_17 ]
70
+ }
71
+
65
72
base {
66
73
archivesName = project. archives_base_name
67
74
}
@@ -79,7 +86,7 @@ processResources {
79
86
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
80
87
tasks. withType(JavaCompile ). configureEach {
81
88
it. options. encoding = " UTF-8"
82
- if ( JavaVersion . current() . isJava9Compatible()) it. options. release = 17
89
+ it. options. release = 17
83
90
}
84
91
85
92
java {
@@ -94,7 +101,7 @@ java {
94
101
95
102
shadowJar {
96
103
configurations = [project. configurations. shadow]
97
- exclude(" META-INF" )
104
+ exclude(" META-INF/** " )
98
105
99
106
relocate ' net.fabricmc.mappingio' , ' fr.catcore.modremapperapi.impl.lib.mappingio'
100
107
relocate ' net.fabricmc.tinyremapper' , ' fr.catcore.modremapperapi.impl.lib.tinyremapper'
@@ -114,6 +121,15 @@ remapJar {
114
121
mustRunAfter(shadowJar)
115
122
// Set the input jar for the task. Here use the shadow Jar that include the .class of the transitive dependency
116
123
input = shadowJar. archiveFile
124
+ setArchiveClassifier(" remapped" )
125
+ }
126
+
127
+ downgradeJar {
128
+ inputFile = remapJar. archiveFile
129
+ }
130
+
131
+ shadeDowngradedApi {
132
+ setArchiveClassifier(" " )
117
133
}
118
134
119
135
test {
@@ -157,7 +173,7 @@ Apply method invocation replacers to Interface methods as well.\
157
173
Fix possible crash while remapping refmap.\
158
174
Add system property to run in development mode for 3rd party remappers.
159
175
"""
160
- uploadFile = remapJar
176
+ uploadFile = shadeDowngradedApi
161
177
162
178
dependencies {
163
179
embedded. version " spasm" , project. spasm_version
@@ -170,4 +186,4 @@ task testmodJar(type: Jar) {
170
186
archiveClassifier. set(" testmod" )
171
187
}
172
188
173
- build. dependsOn testmodJar
189
+ build. dependsOn( testmodJar, shadeDowngradedApi)
0 commit comments