From 6f7d22518e5bf025b53e7a6a4c9992f598a8996d Mon Sep 17 00:00:00 2001 From: yushijinhun Date: Tue, 31 Jul 2018 13:34:17 +0800 Subject: [PATCH] Remove pack.gz build --- HMCL/build.gradle | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/HMCL/build.gradle b/HMCL/build.gradle index 9cb2c579b..b373f41aa 100644 --- a/HMCL/build.gradle +++ b/HMCL/build.gradle @@ -1,9 +1,5 @@ -import org.apache.tools.ant.filters.ReplaceTokens - import java.security.MessageDigest import java.util.jar.JarFile -import java.util.jar.Pack200 -import java.util.zip.GZIPOutputStream if (!hasProperty('mainClass')) { ext.mainClass = 'org.jackhuang.hmcl.Main' @@ -68,29 +64,6 @@ processResources { } } -task makePackGZ(dependsOn: jar) doLast { - ext { - jar.classifier = '' - makeExecutableinjar = jar.archivePath - jar.classifier = '' - makeExecutableoutjar = jar.archivePath - jar.classifier = '' - } - def loc = new File(project.buildDir, "libs/" + makeExecutableoutjar.getName().substring(0, makeExecutableoutjar.getName().length()-4)+".pack.gz") - def os = new GZIPOutputStream(new FileOutputStream(loc)) - Pack200.newPacker().pack new JarFile(makeExecutableinjar), os - os.close() - - def messageDigest = MessageDigest.getInstance("SHA1") - loc.eachByte 1024 * 1024, { byte[] buf, int bytesRead -> - messageDigest.update(buf, 0, bytesRead) - } - def sha1Hex = new BigInteger(1, messageDigest.digest()).toString(16).padLeft(40, '0') - def fileEx = new File(project.buildDir, "libs/" + makeExecutableoutjar.getName().substring(0, makeExecutableoutjar.getName().length()-4)+".pack.gz.sha1") - if (!fileEx.exists()) fileEx.createNewFile() - fileEx.append sha1Hex -} - task makeExecutable(dependsOn: jar) doLast { ext { jar.classifier = '' @@ -115,5 +88,4 @@ task makeExecutable(dependsOn: jar) doLast { } -build.dependsOn makePackGZ -build.dependsOn makeExecutable \ No newline at end of file +build.dependsOn makeExecutable