diff options
author | Paul Rouget <me@paulrouget.com> | 2020-04-08 13:18:42 +0200 |
---|---|---|
committer | Paul Rouget <me@paulrouget.com> | 2020-04-08 13:18:42 +0200 |
commit | 3efa8406749aeab78668d64ee803782316f4e3e2 (patch) | |
tree | 3b47133619579109491d7cd4a5eeab88b6acec98 /python/servo/build_commands.py | |
parent | ef2b9863d158d79edf277b3681468e85acca593f (diff) | |
download | servo-3efa8406749aeab78668d64ee803782316f4e3e2.tar.gz servo-3efa8406749aeab78668d64ee803782316f4e3e2.zip |
implement mach clean-uwp
Diffstat (limited to 'python/servo/build_commands.py')
-rw-r--r-- | python/servo/build_commands.py | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 76082522de8..cb54497377a 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -766,6 +766,18 @@ class MachCommands(CommandBase): print('Removing virtualenv directory: %s' % virtualenv_path) shutil.rmtree(virtualenv_path) + self.clean_uwp() + + opts = ["--manifest-path", manifest_path or path.join(self.context.topdir, "Cargo.toml")] + if verbose: + opts += ["-v"] + opts += params + return check_call(["cargo", "clean"] + opts, env=self.build_env(), verbose=verbose) + + @Command('clean-uwp', + description='Clean the support/hololens/ directory.', + category='build') + def clean_uwp(self): uwp_artifacts = [ "support/hololens/x64/", "support/hololens/ARM/", @@ -780,18 +792,16 @@ class MachCommands(CommandBase): "support/hololens/ServoApp/Release/", "support/hololens/packages/", "support/hololens/AppPackages/", + "support/hololens/ServoApp/ServoApp.vcxproj.user", ] for uwp_artifact in uwp_artifacts: - dir_path = path.join(self.get_top_dir(), uwp_artifact) - if path.exists(dir_path): - shutil.rmtree(dir_path) - - opts = ["--manifest-path", manifest_path or path.join(self.context.topdir, "Cargo.toml")] - if verbose: - opts += ["-v"] - opts += params - return check_call(["cargo", "clean"] + opts, env=self.build_env(), verbose=verbose) + artifact = path.join(self.get_top_dir(), uwp_artifact) + if path.exists(artifact): + if path.isdir(artifact): + shutil.rmtree(artifact) + else: + os.remove(artifact) def angle_root(target, nuget_env): |