@@ -177,70 +177,24 @@ tasks.named("assembleSlimCompilerDist", Copy) { t ->
177177 }
178178}
179179
180- // 4a ) Package ZIP on Windows
180+ // 4 ) Package ZIP on all platforms
181181tasks. register(" packageSlimCompilerDistZip" , Zip ) {
182- description = " Packages slim dist as a ZIP archive (Windows )."
182+ description = " Packages slim dist as a ZIP archive (all platforms )."
183183 group = " distribution"
184- enabled = os. isWindows()
185-
184+ enabled = true
186185 dependsOn(" assembleSlimCompilerDist" )
187186
188187 from(distRoot)
189188 destinationDirectory. set(releasesDir)
190189 archiveFileName. set(" wurst-compiler-${ project.version} -${ plat} .zip" )
191190}
192191
193- // 4b) Package tar.gz on Linux/macOS
194- tasks. register(" packageSlimCompilerDistTar" , Tar ) {
195- description = " Packages slim dist as a tar.gz archive (Linux/macOS)."
196- group = " distribution"
197- enabled = ! os. isWindows()
198-
199- dependsOn(" assembleSlimCompilerDist" )
200-
201- from(distRoot)
202- destinationDirectory. set(releasesDir)
203- compression = Compression . GZIP
204- archiveExtension. set(" tar.gz" )
205- archiveFileName. set(" wurst-compiler-${ project.version} -${ plat} .tar.gz" )
206- }
207-
208- // 4c) OS-aware convenience wrapper
192+ // OS-aware convenience wrapper now just points to ZIP
209193tasks. register(" packageSlimCompilerDist" ) {
210- description = " Packages slim dist for the current platform (zip on Windows, tar.gz elsewhere )."
194+ description = " Packages slim dist for the current platform (ZIP on all OSes )."
211195 group = " distribution"
212- dependsOn(os . isWindows() ? " packageSlimCompilerDistZip" : " packageSlimCompilerDistTar " )
196+ dependsOn(" packageSlimCompilerDistZip" )
213197}
214198
215- // 5) SHA-256 checksum for the packaged archive
216- tasks. register(" checksumSlimCompilerDist" ) {
217- description = " Writes SHA-256 alongside the packaged archive."
218- group = " distribution"
219- dependsOn(" packageSlimCompilerDist" )
220-
221- outputs. upToDateWhen { false }
222-
223- doLast {
224- def outDir = releasesDir. get(). asFile
225- def expectedZip = new File (outDir, " wurst-compiler-${ project.version} -${ plat} .zip" )
226- def expectedTarGz = new File (outDir, " wurst-compiler-${ project.version} -${ plat} .tar.gz" )
227- def archFile = expectedZip. exists() ? expectedZip : (expectedTarGz. exists() ? expectedTarGz : null )
228- if (archFile == null ) throw new GradleException (" Archive not found in ${ outDir} " )
229-
230- def md = java.security.MessageDigest . getInstance(" SHA-256" )
231- archFile. withInputStream { is ->
232- byte [] buf = new byte [8192 ]
233- for (int r = is. read(buf); r != -1 ; r = is. read(buf)) {
234- md. update(buf, 0 , r)
235- }
236- }
237- def hex = md. digest(). collect { String . format(" %02x" , it) }. join()
238- def sumFile = new File (outDir, archFile. name + " .sha256" )
239- sumFile. text = " ${ hex} ${ archFile.name} \n "
240-
241- logger. lifecycle(" [sha256] ${ sumFile.name} -> ${ hex} " )
242- logger. lifecycle(" [release] Upload: ${ archFile.absolutePath} " )
243- }
244- }
245199
246200
0 commit comments