From 33ec97ea4bdfcb1dd0e8da7c6f1cf5a707a5c51d Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 5 Dec 2020 12:40:10 +0200 Subject: [PATCH] build script: add clean special target --- build.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build.py b/build.py index 0ecc0023..39baa370 100755 --- a/build.py +++ b/build.py @@ -862,6 +862,15 @@ class ZlibTarget(ConfigureMakeDependencyTarget): return os.path.exists(builder.source_path + 'zlib.pc.in') +class CleanTarget(BaseTarget): + def __init__(self, name='clean'): + super().__init__(name) + + def build(self, builder: 'Builder'): + args = ('git', 'clean', '-dfX') + subprocess.check_call(args, cwd=builder.root_path) + + # Case insensitive dictionary class from # https://github.com/psf/requests/blob/v2.25.0/requests/structures.py @@ -1064,6 +1073,9 @@ class Builder(object): SndFileTarget(), VorbisTarget(), ZlibTarget(), + + # Special + CleanTarget(), ) self.targets = CaseInsensitiveDict({target.name: target for target in targets})