message=("invalid platform: {0!r} (choose from {1})".format(value,', '.join([repr(platform)forplatforminplatforms])))
raiseargparse.ArgumentError(self,message)
setattr(namespace,self.dest,values)
defhandle_remove_read_only(func,path,exc):
ifnotos.access(path,os.W_OK):
os.chmod(path,stat.S_IWUSR)
func(path)
else:
raise
defmain(argv=None):
ifargvisNone:
argv=sys.argv
argparser=argparse.ArgumentParser(
description="Generate nuget package of Linphone SDK.")
argparser.add_argument(
'-s','--sdk_dir',default="OUTPUT",help="The path where to find the built SDK",dest='sdk_dir')
argparser.add_argument(
'-t','--target',default="Linphone",help="The target to package (the windows runtime whose metadata will be exported)",dest='target')
argparser.add_argument(
'-w','--work_dir',default="WORK/nuget",help="The path where the work will be done to generate the nuget package",dest='work_dir')
argparser.add_argument(
'platform',nargs='*',action=PlatformListAction,default=['ARM','x64','x86'],help="The platform to build for (default is 'all'). Space separated architectures in list: {0}.".format(', '.join([repr(platform)forplatforminplatforms])))