Sign jar
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 383 KiB |
BIN
HMCL/HMCL.keystore
Normal file
BIN
HMCL/HMCL.keystore
Normal file
Binary file not shown.
@@ -36,13 +36,13 @@ if (!hasProperty('mainClass')) {
|
|||||||
|
|
||||||
def buildnumber = System.getenv("TRAVIS_BUILD_NUMBER")
|
def buildnumber = System.getenv("TRAVIS_BUILD_NUMBER")
|
||||||
if (buildnumber == null)
|
if (buildnumber == null)
|
||||||
buildnumber = System.getenv("BUILD_NUMBER")
|
buildnumber = System.getenv("BUILD_NUMBER")
|
||||||
if (buildnumber == null)
|
if (buildnumber == null)
|
||||||
buildnumber = "0"
|
buildnumber = "0"
|
||||||
|
|
||||||
def versionroot = System.getenv("VERSION_ROOT")
|
def versionroot = System.getenv("VERSION_ROOT")
|
||||||
if (versionroot == null)
|
if (versionroot == null)
|
||||||
versionroot = "2.7.4"
|
versionroot = "2.7.5"
|
||||||
|
|
||||||
String mavenGroupId = 'HMCL'
|
String mavenGroupId = 'HMCL'
|
||||||
String mavenVersion = versionroot + '.' + buildnumber
|
String mavenVersion = versionroot + '.' + buildnumber
|
||||||
@@ -93,6 +93,22 @@ jar {
|
|||||||
attributes 'Created-By' : 'Copyright(c) 2013-2017 huangyuhui.',
|
attributes 'Created-By' : 'Copyright(c) 2013-2017 huangyuhui.',
|
||||||
'Main-Class' : mainClass
|
'Main-Class' : mainClass
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
new File("build/signed").mkdirs()
|
||||||
|
ant.signjar(signedjar: archivePath, jar: archivePath,
|
||||||
|
keystore: "HMCL.keystore", storepass: "123456",
|
||||||
|
alias: "HMCL")
|
||||||
|
|
||||||
|
def messageDigest = MessageDigest.getInstance("SHA1")
|
||||||
|
archivePath.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/" + archivePath.getName() + ".sha1")
|
||||||
|
if (!fileEx.exists()) fileEx.createNewFile()
|
||||||
|
fileEx.append sha1Hex
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
launch4j {
|
launch4j {
|
||||||
@@ -138,14 +154,6 @@ task makeExecutable(dependsOn: jar) doLast {
|
|||||||
is.close()
|
is.close()
|
||||||
fos.close()
|
fos.close()
|
||||||
|
|
||||||
def messageDigest = MessageDigest.getInstance("SHA1")
|
|
||||||
makeExecutableoutjar.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)+".jar.sha1")
|
|
||||||
if (!fileEx.exists()) fileEx.createNewFile()
|
|
||||||
fileEx.append sha1Hex
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task makePackGZ(dependsOn: jar) doLast {
|
task makePackGZ(dependsOn: jar) doLast {
|
||||||
|
|||||||
BIN
HMCL/old.jpg
BIN
HMCL/old.jpg
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB |
Reference in New Issue
Block a user