Simplify clean option of prepare.py.

This commit is contained in:
Ghislain MARY 2015-05-27 15:18:15 +02:00
parent 1039959cd3
commit d93fc2332a

View file

@ -44,9 +44,10 @@ class IOSTarget(prepare.Target):
]
def clean(self):
prepare.Target.clean(self)
if os.path.isdir('liblinphone-sdk/apple-darwin'):
shutil.rmtree('liblinphone-sdk/apple-darwin', ignore_errors=False, onerror=self.handle_remove_read_only)
if os.path.isdir('WORK'):
shutil.rmtree('WORK', ignore_errors=False, onerror=self.handle_remove_read_only)
if os.path.isdir('liblinphone-sdk'):
shutil.rmtree('liblinphone-sdk', ignore_errors=False, onerror=self.handle_remove_read_only)
class IOSi386Target(IOSTarget):
@ -120,8 +121,7 @@ def main(argv = None):
if argv is None:
argv = sys.argv
argparser = argparse.ArgumentParser(description="Prepare build of Linphone and its dependencies.")
argparser.add_argument('-c', '--clean', help="Clean a previous build instead of preparing a build.", action='store_true')
argparser.add_argument('-C', '--veryclean', help="Clean a previous build and its installation directory.", action='store_true')
argparser.add_argument('-c', '-C', '--clean', help="Clean a previous build instead of preparing a build.", action='store_true')
argparser.add_argument('-d', '--debug', help="Prepare a debug build.", action='store_true')
argparser.add_argument('-f', '--force', help="Force preparation, even if working directory already exist.", action='store_true')
argparser.add_argument('-L', '--list-cmake-variables', help="List non-advanced CMake cache variables.", action='store_true', dest='list_cmake_variables')
@ -145,9 +145,7 @@ def main(argv = None):
for platform in selected_platforms:
target = targets[platform]
if args.veryclean:
target.veryclean()
elif args.clean:
if args.clean:
target.clean()
else:
retcode = prepare.run(target, args.debug, False, args.list_cmake_variables, args.force, additional_args)