To add one option to trace deployment process of `macdeployqt` tool.

This refs #4 and #19.
This commit is contained in:
Kazunari Sekigawa 2018-01-04 19:55:11 +09:00
parent 91bf2a1eb0
commit ecade95463
1 changed files with 43 additions and 23 deletions

View File

@ -40,6 +40,7 @@ def SetGlobals():
global DebugMode # True if debug mode build global DebugMode # True if debug mode build
global CheckComOnly # True if only for checking the command line parameters to "build.sh" global CheckComOnly # True if only for checking the command line parameters to "build.sh"
global Deployment # True if deploying the binaries for a package global Deployment # True if deploying the binaries for a package
global DeployVerbose # -verbose=<0-3> level passed to 'macdeployqt' tool
global Version # KLayout's version global Version # KLayout's version
# auxiliary variables on platform # auxiliary variables on platform
global System # 6-tuple from platform.uname() global System # 6-tuple from platform.uname()
@ -73,7 +74,11 @@ def SetGlobals():
Usage += " : ! After confirmation of successful build of | \n" Usage += " : ! After confirmation of successful build of | \n"
Usage += " : KLayout, rerun this script with BOTH: | \n" Usage += " : KLayout, rerun this script with BOTH: | \n"
Usage += " : 1) the same options used for building AND | \n" Usage += " : 1) the same options used for building AND | \n"
Usage += " : 2) [-y|--deploy] | \n" Usage += " : 2) <-y|--deploy> | \n"
Usage += " : optionally with [-v|--verbose <0-3>] | \n"
Usage += " [-v|--verbose <0-3>] : verbose level of `macdeployqt' | 1 \n"
Usage += " : 0 = no output, 1 = error/warning (default), | \n"
Usage += " : 2 = normal, 3 = debug | \n"
Usage += " [-?|--?] : print this usage and exit | disabled \n" Usage += " [-?|--?] : print this usage and exit | disabled \n"
Usage += "---------------------------------------------------------------------------------------------\n" Usage += "---------------------------------------------------------------------------------------------\n"
@ -132,6 +137,7 @@ def SetGlobals():
DebugMode = False DebugMode = False
CheckComOnly = False CheckComOnly = False
Deployment = False Deployment = False
DeployVerbose = 1
Version = GetKLayoutVersionFrom( "./version.sh" ) Version = GetKLayoutVersionFrom( "./version.sh" )
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
@ -148,6 +154,7 @@ def ParseCommandLineArguments():
global DebugMode global DebugMode
global CheckComOnly global CheckComOnly
global Deployment global Deployment
global DeployVerbose
p = optparse.OptionParser( usage=Usage ) p = optparse.OptionParser( usage=Usage )
p.add_option( '-q', '--qt', p.add_option( '-q', '--qt',
@ -190,6 +197,10 @@ def ParseCommandLineArguments():
default=False, default=False,
help="deploy built binaries" ) help="deploy built binaries" )
p.add_option( '-v', '--verbose',
dest='deploy_verbose',
help="verbose level of `macdeployqt` tool" )
p.add_option( '-?', '--??', p.add_option( '-?', '--??',
action='store_true', action='store_true',
dest='checkusage', dest='checkusage',
@ -204,6 +215,7 @@ def ParseCommandLineArguments():
debug_build = False, debug_build = False,
check_command = False, check_command = False,
deploy_bins = False, deploy_bins = False,
deploy_verbose = "1",
checkusage = False ) checkusage = False )
opt, args = p.parse_args() opt, args = p.parse_args()
@ -304,6 +316,12 @@ def ParseCommandLineArguments():
DebugMode = opt.debug_build DebugMode = opt.debug_build
CheckComOnly = opt.check_command CheckComOnly = opt.check_command
Deployment = opt.deploy_bins Deployment = opt.deploy_bins
DeployVerbose = int(opt.deploy_verbose)
if not DeployVerbose in [0, 1, 2, 3]:
print("")
print( "!!! Unsupported verbose level passed to `macdeployqt` tool", file=sys.stderr )
print(Usage)
quit()
if not Deployment: if not Deployment:
target = "%s %s %s" % (Platform, Release, Machine) target = "%s %s %s" % (Platform, Release, Machine)
@ -459,6 +477,7 @@ def DeployBinariesForBundle():
global AbsMacBuildDir global AbsMacBuildDir
global AbsMacBuildLog global AbsMacBuildLog
global Version global Version
global DeployVerbose
print("") print("")
print( "##### Started deploying libraries and executables for <klayout.app> #####" ) print( "##### Started deploying libraries and executables for <klayout.app> #####" )
@ -662,14 +681,15 @@ def DeployBinariesForBundle():
#------------------------------------------------------------- #-------------------------------------------------------------
# [8] Deploy Qt frameworks # [8] Deploy Qt frameworks
#------------------------------------------------------------- #-------------------------------------------------------------
verbose = " -verbose=%d" % DeployVerbose
if ModuleQt == 'Qt4MacPorts': if ModuleQt == 'Qt4MacPorts':
deploytool = Qt4MacPorts['deploy'] deploytool = Qt4MacPorts['deploy']
app_bundle = "klayout.app" app_bundle = "klayout.app"
options = macdepQtOpt options = macdepQtOpt + verbose
elif ModuleQt == 'Qt5MacPorts': elif ModuleQt == 'Qt5MacPorts':
deploytool = Qt5MacPorts['deploy'] deploytool = Qt5MacPorts['deploy']
app_bundle = "klayout.app" app_bundle = "klayout.app"
options = macdepQtOpt options = macdepQtOpt + verbose
os.chdir(ProjectDir) os.chdir(ProjectDir)
os.chdir(MacPkgDir) os.chdir(MacPkgDir)