From 5c7fe6b9a74dcfb0e8698ecef74a517137db9824 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 19 Jul 2013 18:36:09 +0000 Subject: [PATCH] Add an automate.py option to clean the artifacts output directory (issue #1022). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1318 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- tools/automate/automate.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/automate/automate.py b/tools/automate/automate.py index c03644ccd..93f0ac38f 100644 --- a/tools/automate/automate.py +++ b/tools/automate/automate.py @@ -142,6 +142,9 @@ parser.add_option('--no-distrib-archive', parser.add_option('--ninja-build', action='store_true', dest='ninjabuild', default=False, help="build using ninja") +parser.add_option('--clean-artifacts', + action='store_true', dest='cleanartifacts', default=False, + help='clean the artifacts output directory') parser.add_option('--dry-run', action='store_true', dest='dryrun', default=False, help="output commands without executing them") @@ -438,6 +441,12 @@ if any_changed or options.forcebuild: run(path+' Release', cef_tools_dir, depot_tools_dir) if (any_changed or options.forcedistrib) and not options.nodistrib: + if not options.forceclean and options.cleanartifacts: + # clean the artifacts output directory + artifacts_path = os.path.join(cef_src_dir, 'binary_distrib') + if os.path.exists(artifacts_path): + shutil.rmtree(artifacts_path, onerror=onerror) + # determine the requested distribution types distrib_types = [] if options.minimaldistribonly: