mirror of
https://github.com/JHUAPL/DistMaker.git
synced 2026-01-10 13:07:59 -05:00
Various updates
This commit is contained in:
@@ -25,6 +25,14 @@ def buildRelease(args, buildPath):
|
||||
appName = args.name
|
||||
version = args.version
|
||||
|
||||
# Bail if launch4j is not installed
|
||||
appInstallRoot = miscUtils.getInstallRoot()
|
||||
appInstallRoot = os.path.dirname(appInstallRoot)
|
||||
launch4jExe = os.path.join(appInstallRoot, "launch4j", "launch4j")
|
||||
if os.path.exists(launch4jExe) == False:
|
||||
print('Launch4j is not installed. Windows releases will not be built.')
|
||||
return
|
||||
|
||||
# Create a tmp (working) folder
|
||||
tmpPath = tempfile.mkdtemp(dir=buildPath)
|
||||
|
||||
|
||||
@@ -153,13 +153,13 @@ public class DistMakerEngine
|
||||
if (strLine == null)
|
||||
break;
|
||||
|
||||
// Update the current instruction, if one specified
|
||||
if (strLine.startsWith("-") == true)
|
||||
currInstr = strLine;
|
||||
// Skip empty lines / comments
|
||||
else if (strLine.isEmpty() == true || strLine.startsWith("#") == true)
|
||||
if (strLine.isEmpty() == true || strLine.startsWith("#") == true)
|
||||
; // Nothing to do
|
||||
// Process the name instruction
|
||||
// Record the (current) instruction
|
||||
else if (strLine.startsWith("-") == true)
|
||||
currInstr = strLine;
|
||||
// Process the instruction
|
||||
else if (currInstr.equals("-name") == true)
|
||||
appName = strLine;
|
||||
else if (currInstr.equals("-version") == true)
|
||||
|
||||
Binary file not shown.
@@ -10,7 +10,7 @@ import time
|
||||
|
||||
# Globals
|
||||
# The version of DistMaker
|
||||
version = '0.34'
|
||||
version = '0.35'
|
||||
|
||||
|
||||
def logAndPrint(message="", indent=0, showTime=False):
|
||||
@@ -20,7 +20,7 @@ def logAndPrint(message="", indent=0, showTime=False):
|
||||
if showTime == True:
|
||||
message = '[' + getCurrTimeStr() + '] ' + message;
|
||||
# logging.info(message)
|
||||
print message
|
||||
print(message)
|
||||
|
||||
|
||||
def buildRelease():
|
||||
@@ -38,21 +38,18 @@ def buildRelease():
|
||||
logAndPrint("Aborting DistMaker release build. Release already exists. File: release/" + destFileGZ, indent=1)
|
||||
exit(-1)
|
||||
|
||||
# Laydown the structure
|
||||
# Laydown the structure, and let the user know of the version we are building
|
||||
print("Building DistMaker release " + version + "...")
|
||||
os.mkdir(workPath)
|
||||
os.mkdir(workPath + "/lib")
|
||||
os.mkdir(workPath + "/script")
|
||||
os.mkdir(workPath + "/jre")
|
||||
|
||||
# Let the user know of the version we are building
|
||||
print "Building DistMaker release " + version + "..."
|
||||
|
||||
# Copy the libraries
|
||||
os.mkdir(workPath + "/lib")
|
||||
shutil.copy2('lib/glum.jar', workPath + '/lib/')
|
||||
shutil.copy2('lib/guava-13.0.1.jar', workPath + '/lib/')
|
||||
shutil.copy2('bin/distMaker.jar', workPath + '/lib/')
|
||||
|
||||
# Copy the scripts
|
||||
os.mkdir(workPath + "/script")
|
||||
shutil.copy2('script/appleUtils.py', workPath + '/script/')
|
||||
shutil.copy2('script/linuxUtils.py', workPath + '/script/')
|
||||
shutil.copy2('script/windowsUtils.py', workPath + '/script/')
|
||||
@@ -60,22 +57,32 @@ def buildRelease():
|
||||
shutil.copy2('script/deployDist.py', workPath + '/script/')
|
||||
shutil.copy2('script/miscUtils.py', workPath + '/script/')
|
||||
|
||||
# Copy the launch4J utility
|
||||
shutil.copytree('launch4j', workPath + '/launch4j')
|
||||
|
||||
# Copy the jre tree
|
||||
os.mkdir(workPath + "/jre")
|
||||
shutil.copytree('jre/apple', workPath + '/jre/apple', symlinks=True)
|
||||
shutil.copytree('jre/linux', workPath + '/jre/linux', symlinks=True)
|
||||
shutil.copytree('jre/windows', workPath + '/jre/windows', symlinks=True)
|
||||
|
||||
# Copy the template tree
|
||||
shutil.copytree('template', workPath + '/template')
|
||||
# Setup the template tree
|
||||
os.mkdir(workPath + "/template")
|
||||
shutil.copytree('template/apple', workPath + '/template/apple')
|
||||
shutil.copytree('template/background', workPath + '/template/background')
|
||||
shutil.copy2('template/.DS_Store', workPath + '/template/')
|
||||
shutil.copy2('template/appLauncher.jar', workPath + '/template/')
|
||||
|
||||
# Setup the launch4j tree
|
||||
exeCmd = ['tar', '-C', workPath, '-xf', 'template/launch4j/launch4j-3.1.0-beta1-linux.tgz']
|
||||
retCode = subprocess.call(exeCmd)
|
||||
if retCode != 0:
|
||||
print("Failed to extract launch4j package...")
|
||||
exit(-1)
|
||||
shutil.copy2('template/launch4j/launch4j', workPath + '/launch4j/')
|
||||
|
||||
# Form the archive
|
||||
exeCmd = ['tar', '-czf', destFileGZ, workPath]
|
||||
retCode = subprocess.call(exeCmd)
|
||||
if retCode != 0:
|
||||
print "Failed to build tar.gz file: " + destFileGZ
|
||||
print("Failed to build tar.gz file: " + destFileGZ)
|
||||
exit(-1)
|
||||
|
||||
# Remove the workPath
|
||||
@@ -84,18 +91,18 @@ def buildRelease():
|
||||
# Move the release to the official release folder
|
||||
shutil.move(destFileGZ, 'release/')
|
||||
|
||||
print "DistMaker release " + version + " built."
|
||||
print("DistMaker release " + version + " built.")
|
||||
|
||||
|
||||
def printUsage():
|
||||
scriptName = os.path.split(sys.argv[0])[1]
|
||||
print scriptName + ' [-full]'
|
||||
print ' -full: Force a full build of the main jar file.'
|
||||
print(scriptName + ' [-full]')
|
||||
print(' -full: Force a full build of the main jar file.')
|
||||
exit(-1)
|
||||
|
||||
|
||||
def handleSignal(signal, frame):
|
||||
print 'You pressed Ctrl+C!'
|
||||
print('You pressed Ctrl+C!')
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
@@ -107,7 +114,7 @@ if __name__ == "__main__":
|
||||
if argc == 2 and argv[1] == "-full":
|
||||
doFullBuild = True
|
||||
elif argc != 1:
|
||||
print ' Invalid num args. Num Args:' + str(argc)
|
||||
print(' Invalid num args. Num Args:' + str(argc))
|
||||
printUsage()
|
||||
|
||||
# Logic to capture Ctrl-C and bail
|
||||
@@ -118,6 +125,6 @@ if __name__ == "__main__":
|
||||
|
||||
#TODO: Finish this functionality
|
||||
if doFullBuild == True:
|
||||
print "Unsupported action: [-full]. Skipping..."
|
||||
print("Unsupported action: [-full]. Skipping...")
|
||||
|
||||
buildRelease()
|
||||
|
||||
Reference in New Issue
Block a user