[DEV] add --force-strip parameter

This commit is contained in:
Edouard DUPIN 2013-08-27 21:11:03 +02:00
parent 683e80d103
commit fbdf561438
4 changed files with 57 additions and 6 deletions

View File

@ -18,6 +18,7 @@ mylutinArg.Add(lutinArg.argDefine("c", "color", desc="Display makefile output in
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("j", "jobs", haveParam=True, desc="Specifies the number of jobs (commands) to run simultaneously"))
mylutinArg.Add(lutinArg.argDefine("s", "force-strip", desc="Force the stripping of the compile elements"))
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"))
@ -74,6 +75,10 @@ def parseGenericArg(argument,active):
if active==True:
lutinEnv.SetPrintPrettyMode(True)
return True
elif argument.GetOptionName() == "force-strip":
if active==True:
lutinEnv.SetForceStripMode(True)
return True
return False
# parse default unique argument:

View File

@ -54,3 +54,17 @@ def PrintPretty(myString):
return tmpcmdLine
else:
return myString
forceStripMode=False
def SetForceStripMode(val):
global forceStripMode
if val==True:
forceStripMode = True
else:
forceStripMode = False
def GetForceStripMode():
global forceStripMode
return forceStripMode

View File

@ -10,6 +10,7 @@ import lutinDebug as debug
import lutinHeritage as heritage
import lutinDepend as dependency
import lutinMultiprocess
import lutinEnv
"""
@ -279,7 +280,8 @@ class module:
lutinTools.CreateDirectoryOfFile(file_dst)
debug.printElement("SharedLib", libName, "==>", file_dst)
lutinMultiprocess.RunCommand(cmdLine)
if "release"==target.buildMode:
if "release"==target.buildMode \
or lutinEnv.GetForceStripMode()==True:
debug.printElement("SharedLib(strip)", libName, "", "")
cmdLineStrip=lutinTools.ListToStr([
target.strip,
@ -313,7 +315,8 @@ class module:
debug.printElement("Executable", self.name, "==>", file_dst)
lutinMultiprocess.RunCommand(cmdLine)
if "release"==target.buildMode:
if "release"==target.buildMode \
or lutinEnv.GetForceStripMode()==True:
debug.printElement("Executable(strip)", self.name, "", "")
cmdLineStrip=lutinTools.ListToStr([
target.strip,

View File

@ -4,6 +4,7 @@ import lutinTarget
import lutinTools
import os
import stat
import lutinMultiprocess
class Target(lutinTarget.Target):
def __init__(self, typeCompilator, debugMode, generatePackage):
@ -57,10 +58,38 @@ class Target(lutinTarget.Target):
tmpFile.close()
## Enable Execution in script
os.chmod(finalFilepostRm, stat.S_IRWXU + stat.S_IRGRP + stat.S_IXGRP + stat.S_IROTH + stat.S_IXOTH);
# copy licence and information :
lutinTools.CopyFile("os-Linux/README", self.GetStagingFolder(pkgName) + "/usr/share/doc/"+ pkgName + "/README")
lutinTools.CopyFile("license.txt", self.GetStagingFolder(pkgName) + "/usr/share/doc/"+ pkgName + "/copyright")
lutinTools.CopyFile("changelog", self.GetStagingFolder(pkgName) + "/usr/share/doc/"+ pkgName + "/changelog")
## Readme donumentation
readmeFileDest = self.GetStagingFolder(pkgName) + "/usr/share/doc/"+ pkgName + "/README"
if os.path.exists("os-Linux/README")==True:
lutinTools.CopyFile("os-Linux/README", readmeFileDest)
elif os.path.exists("README")==True:
lutinTools.CopyFile("README", readmeFileDest)
elif os.path.exists("README.md")==True:
lutinTools.CopyFile("README.md", readmeFileDest)
else:
debug.info("no file 'README', 'README.md' or 'os-Linux/README' ==> generate an empty one")
tmpFile = open(readmeFileDest, 'w')
tmpFile.write("No documentation for " + pkgName + "\n")
tmpFile.flush()
tmpFile.close()
## licence file
licenseFileDest = self.GetStagingFolder(pkgName) + "/usr/share/doc/"+ pkgName + "/copyright"
if os.path.exists("license.txt")==True:
lutinTools.CopyFile("license.txt", licenseFileDest)
else:
debug.info("no file 'license.txt' ==> generate an empty one")
tmpFile = open(licenseFileDest, 'w')
tmpFile.write("No license define by the developper for " + pkgName + "\n")
tmpFile.flush()
tmpFile.close()
##changeLog file
changeLogFileDest = self.GetStagingFolder(pkgName) + "/usr/share/doc/"+ pkgName + "/changelog"
if os.path.exists("changelog")==True:
lutinTools.CopyFile("changelog", changeLogFileDest)
else:
debug.info("no file 'changelog' ==> generate an empty one")
lutinMultiprocess.RunCommand("git log > " + changeLogFileDest)
## create the package :
debug.debug("pachage : " + self.GetStagingFolder(pkgName) + "/" + pkgName + ".deb")
os.system("cd " + self.GetStagingFolder("") + " ; dpkg-deb --build " + pkgName)
lutinTools.CreateDirectoryOfFile(self.GetFinalFolder())