This commit is contained in:
huanghongxun
2015-09-07 13:28:56 +08:00
parent 01526546b1
commit 7916715efa
5 changed files with 2661 additions and 3121 deletions

View File

@@ -74,45 +74,6 @@ jar {
}
}
task proguard(type: proguard.gradle.ProGuardTask, dependsOn: jar) {
ext {
def re = jar.classifier
injar = jar.archivePath
jar.classifier = ''
outjar = jar.archivePath
jar.classifier = re
}
injars injar
outjars outjar
printmapping "obfuscate_" + version + ".map"
configuration 'proguard.pro'
}
task makeExecutable(dependsOn: jar) << {
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)+".exe")
def fos = new FileOutputStream(loc)
def is = new FileInputStream(new File(project.buildDir, '../HMCLauncher.exe'))
int read
def bytes = new byte[8192]
while((read = is.read(bytes)) != -1)
fos.write(bytes, 0, read);
is.close()
is = new FileInputStream(makeExecutableinjar)
while((read = is.read(bytes)) != -1)
fos.write(bytes, 0, read);
is.close()
fos.close()
}
launch4j {
launch4jCmd = 'D:\\Develop\\Java\\Launch4j\\launch4j.exe'
supportUrl = 'http://www.mcbbs.net/thread-142335-1-1.html'

BIN
HMCSM/HMCLauncher.exe Normal file

Binary file not shown.

View File

@@ -36,7 +36,6 @@ buildscript {
repositories {
mavenCentral();
dependencies {
classpath 'net.sf.proguard:proguard-gradle:4.10'
classpath 'edu.sc.seis.gradle:launch4j:1.0.6'
classpath 'me.tatarka:gradle-retrolambda:3.1.0'
}
@@ -72,26 +71,10 @@ jar {
}
}
task proguard(type: proguard.gradle.ProGuardTask, dependsOn: jar) {
ext {
injar = jar.archivePath
jar.classifier = 'proguard'
outjar = jar.archivePath
jar.classifier = ''
}
injars injar
outjars outjar
printusage "shrinking_" + version + ".map"
printmapping "obfuscate_" + version + ".map"
configuration 'proguard.pro'
}
processResources {
from(sourceSets.main.resources.srcDirs) {
exclude 'icon.icns'
}
}
build.dependsOn proguard
build.dependsOn makeExecutable

File diff suppressed because it is too large Load Diff

View File

@@ -54,3 +54,26 @@ task createFolders(description: 'Creates the source folders if they do not exist
}
}
}
task makeExecutable(dependsOn: jar) << {
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)+".exe")
def fos = new FileOutputStream(loc)
def is = new FileInputStream(new File(project.buildDir, '../HMCLauncher.exe'))
int read
def bytes = new byte[8192]
while((read = is.read(bytes)) != -1)
fos.write(bytes, 0, read);
is.close()
is = new FileInputStream(makeExecutableinjar)
while((read = is.read(bytes)) != -1)
fos.write(bytes, 0, read);
is.close()
fos.close()
}