11import java.util.function.Supplier
2+ import javax.inject.Inject
23
3- repositories {
4- maven { url " https://maven.fabricmc.net/ " }
4+ interface Injected {
5+ @Inject ArchiveOperations getArchiveOps ()
56}
67
8+ def injected = objects. newInstance(Injected . class)
9+ def archiveOps = injected. getArchiveOps()
10+
711sourceSets {
812 exampleMod
913 essential
@@ -151,15 +155,15 @@ tasks.register("essentialJijijJar", Jar) {
151155(1 .. 5 ). each { i ->
152156 def stage2Task = tasks. register(" stage2V${ i} Jar" , Jar ) {
153157 archiveBaseName. set(name)
154- from(evaluationDependsOn(' :stage2:fabric' ). tasks. jar. archiveFile. map { zipTree(it) })
158+ from(evaluationDependsOn(' :stage2:fabric' ). tasks. jar. archiveFile. map { archiveOps . zipTree(it) })
155159 // Dummy attribute so they all have different hashes
156160 manifest {
157161 attributes " Implementation-Version" : " $i "
158162 }
159163 }
160164 def stage3Task = tasks. register(" stage3V${ i} Jar" , Jar ) {
161165 archiveBaseName. set(name)
162- from(tasks. essentialJar. archiveFile. map { zipTree(it) })
166+ from(tasks. essentialJar. archiveFile. map { archiveOps . zipTree(it) })
163167 manifest {
164168 // Dummy attribute so they all have different hashes
165169 attributes " Implementation-Version" : " $i "
@@ -171,7 +175,7 @@ tasks.register("essentialJijijJar", Jar) {
171175 }
172176 tasks. register(" exampleBundledModJar$i " , Jar ) {
173177 archiveBaseName. set(name)
174- from(tasks. exampleModJar. archiveFile. map { zipTree(it) })
178+ from(tasks. exampleModJar. archiveFile. map { archiveOps . zipTree(it) })
175179
176180 def stage2Jar = stage2Task. get(). archiveFile
177181 def stage3Jar = stage3Task. get(). archiveFile
0 commit comments