[DEV] change color option and add size display of stipping
This commit is contained in:
parent
f67512f49d
commit
2a0f8bdb02
6
lutin.py
6
lutin.py
@ -14,7 +14,7 @@ mylutinArg = lutinArg.lutinArg()
|
|||||||
mylutinArg.Add(lutinArg.argDefine("h", "help", desc="display this help"))
|
mylutinArg.Add(lutinArg.argDefine("h", "help", desc="display this help"))
|
||||||
mylutinArg.AddSection("option", "Can be set one time in all case")
|
mylutinArg.AddSection("option", "Can be set one time in all case")
|
||||||
mylutinArg.Add(lutinArg.argDefine("v", "verbose", list=[["0","None"],["1","error"],["2","warning"],["3","info"],["4","debug"],["5","verbose"]], desc="Display makefile debug level (verbose) default =2"))
|
mylutinArg.Add(lutinArg.argDefine("v", "verbose", list=[["0","None"],["1","error"],["2","warning"],["3","info"],["4","debug"],["5","verbose"]], desc="Display makefile debug level (verbose) default =2"))
|
||||||
mylutinArg.Add(lutinArg.argDefine("c", "color", desc="Display makefile output in color"))
|
mylutinArg.Add(lutinArg.argDefine("C", "color", desc="Display makefile output in color"))
|
||||||
mylutinArg.Add(lutinArg.argDefine("f", "force", desc="Force the rebuild without checking the dependency"))
|
mylutinArg.Add(lutinArg.argDefine("f", "force", desc="Force the rebuild without checking the dependency"))
|
||||||
mylutinArg.Add(lutinArg.argDefine("P", "pretty", desc="print the debug has pretty display"))
|
mylutinArg.Add(lutinArg.argDefine("P", "pretty", desc="print the debug has pretty display"))
|
||||||
mylutinArg.Add(lutinArg.argDefine("j", "jobs", haveParam=True, desc="Specifies the number of jobs (commands) to run simultaneously"))
|
mylutinArg.Add(lutinArg.argDefine("j", "jobs", haveParam=True, desc="Specifies the number of jobs (commands) to run simultaneously"))
|
||||||
@ -22,7 +22,7 @@ mylutinArg.Add(lutinArg.argDefine("s", "force-strip", desc="Force the stripping
|
|||||||
|
|
||||||
mylutinArg.AddSection("properties", "keep in the sequency of the cible")
|
mylutinArg.AddSection("properties", "keep in the sequency of the cible")
|
||||||
mylutinArg.Add(lutinArg.argDefine("t", "target", list=[["Android",""],["Linux",""],["MacOs",""],["Windows",""]], desc="Select a target (by default the platform is the computer that compile this"))
|
mylutinArg.Add(lutinArg.argDefine("t", "target", list=[["Android",""],["Linux",""],["MacOs",""],["Windows",""]], desc="Select a target (by default the platform is the computer that compile this"))
|
||||||
mylutinArg.Add(lutinArg.argDefine("C", "compilator", list=[["clang",""],["gcc",""]], desc="Compile with clang or Gcc mode (by default gcc will be used)"))
|
mylutinArg.Add(lutinArg.argDefine("c", "compilator", list=[["clang",""],["gcc",""]], desc="Compile with clang or Gcc mode (by default gcc will be used)"))
|
||||||
mylutinArg.Add(lutinArg.argDefine("m", "mode", list=[["debug",""],["release",""]], desc="Compile in release or debug mode (default release)"))
|
mylutinArg.Add(lutinArg.argDefine("m", "mode", list=[["debug",""],["release",""]], desc="Compile in release or debug mode (default release)"))
|
||||||
mylutinArg.Add(lutinArg.argDefine("p", "package", desc="Disable the package generation (usefull when just compile for test on linux ...)"))
|
mylutinArg.Add(lutinArg.argDefine("p", "package", desc="Disable the package generation (usefull when just compile for test on linux ...)"))
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ def Start():
|
|||||||
# parse all argument
|
# parse all argument
|
||||||
for argument in localArgument:
|
for argument in localArgument:
|
||||||
if True==parseGenericArg(argument, False):
|
if True==parseGenericArg(argument, False):
|
||||||
None # nothing to do ...
|
continue
|
||||||
elif argument.GetOptionName() == "package":
|
elif argument.GetOptionName() == "package":
|
||||||
generatePackage=False
|
generatePackage=False
|
||||||
elif argument.GetOptionName() == "compilator":
|
elif argument.GetOptionName() == "compilator":
|
||||||
|
@ -150,9 +150,9 @@ class lutinArg:
|
|||||||
for prop in self.m_listProperties:
|
for prop in self.m_listProperties:
|
||||||
if prop.GetOptionBig()=="":
|
if prop.GetOptionBig()=="":
|
||||||
continue
|
continue
|
||||||
if prop.GetOptionBig() == option[2:2+len(prop.GetOptionBig())]:
|
if prop.GetOptionBig() == option[2:]:
|
||||||
# find it
|
# find it
|
||||||
debug.verbose("find argument 2 : " + option[2:2+len(prop.GetOptionBig())])
|
debug.verbose("find argument 2 : " + option[2:])
|
||||||
if prop.NeedParameters()==True:
|
if prop.NeedParameters()==True:
|
||||||
internalSub = option[2+len(prop.GetOptionBig()):]
|
internalSub = option[2+len(prop.GetOptionBig()):]
|
||||||
if len(internalSub)!=0:
|
if len(internalSub)!=0:
|
||||||
|
@ -282,11 +282,16 @@ class module:
|
|||||||
lutinMultiprocess.RunCommand(cmdLine)
|
lutinMultiprocess.RunCommand(cmdLine)
|
||||||
if "release"==target.buildMode \
|
if "release"==target.buildMode \
|
||||||
or lutinEnv.GetForceStripMode()==True:
|
or lutinEnv.GetForceStripMode()==True:
|
||||||
|
# get the file size of the non strip file
|
||||||
|
originSize = lutinTools.FileSize(file_dst);
|
||||||
debug.printElement("SharedLib(strip)", libName, "", "")
|
debug.printElement("SharedLib(strip)", libName, "", "")
|
||||||
cmdLineStrip=lutinTools.ListToStr([
|
cmdLineStrip=lutinTools.ListToStr([
|
||||||
target.strip,
|
target.strip,
|
||||||
file_dst])
|
file_dst])
|
||||||
lutinMultiprocess.RunCommand(cmdLineStrip)
|
lutinMultiprocess.RunCommand(cmdLineStrip)
|
||||||
|
# get the stip size of the binary
|
||||||
|
stripSize = lutinTools.FileSize(file_dst)
|
||||||
|
debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko")
|
||||||
# write cmd line only after to prevent errors ...
|
# write cmd line only after to prevent errors ...
|
||||||
lutinMultiprocess.StoreCommand(cmdLine, file_cmd)
|
lutinMultiprocess.StoreCommand(cmdLine, file_cmd)
|
||||||
#debug.printElement("SharedLib", self.name, "==>", tmpList[1])
|
#debug.printElement("SharedLib", self.name, "==>", tmpList[1])
|
||||||
@ -317,11 +322,16 @@ class module:
|
|||||||
lutinMultiprocess.RunCommand(cmdLine)
|
lutinMultiprocess.RunCommand(cmdLine)
|
||||||
if "release"==target.buildMode \
|
if "release"==target.buildMode \
|
||||||
or lutinEnv.GetForceStripMode()==True:
|
or lutinEnv.GetForceStripMode()==True:
|
||||||
|
# get the file size of the non strip file
|
||||||
|
originSize = lutinTools.FileSize(file_dst);
|
||||||
debug.printElement("Executable(strip)", self.name, "", "")
|
debug.printElement("Executable(strip)", self.name, "", "")
|
||||||
cmdLineStrip=lutinTools.ListToStr([
|
cmdLineStrip=lutinTools.ListToStr([
|
||||||
target.strip,
|
target.strip,
|
||||||
file_dst])
|
file_dst])
|
||||||
lutinMultiprocess.RunCommand(cmdLineStrip)
|
lutinMultiprocess.RunCommand(cmdLineStrip)
|
||||||
|
# get the stip size of the binary
|
||||||
|
stripSize = lutinTools.FileSize(file_dst)
|
||||||
|
debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko")
|
||||||
# write cmd line only after to prevent errors ...
|
# write cmd line only after to prevent errors ...
|
||||||
lutinMultiprocess.StoreCommand(cmdLine, file_cmd)
|
lutinMultiprocess.StoreCommand(cmdLine, file_cmd)
|
||||||
|
|
||||||
|
@ -35,6 +35,12 @@ def RemoveFile(path):
|
|||||||
if os.path.isfile(path):
|
if os.path.isfile(path):
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
|
|
||||||
|
def FileSize(path):
|
||||||
|
if not os.path.isfile(path):
|
||||||
|
return 0
|
||||||
|
statinfo = os.stat(path)
|
||||||
|
return statinfo.st_size
|
||||||
|
|
||||||
|
|
||||||
def ListToStr(list):
|
def ListToStr(list):
|
||||||
if type(list) == type(str()):
|
if type(list) == type(str()):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user