mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-22 03:51:33 +00:00
build script: add target to clean dependencies directory
replace existing clean target with clean-all
This commit is contained in:
parent
d08c067888
commit
4279915d75
1 changed files with 19 additions and 3 deletions
22
build.py
22
build.py
|
@ -956,14 +956,29 @@ class ZlibTarget(ConfigureMakeDependencyTarget):
|
|||
|
||||
|
||||
class CleanTarget(BaseTarget):
|
||||
def __init__(self, name='clean'):
|
||||
def __init__(self, name=None):
|
||||
super().__init__(name)
|
||||
self.args = ()
|
||||
|
||||
def build(self, builder: 'Builder'):
|
||||
args = ('git', 'clean', '-dfX')
|
||||
args = ('git', 'clean') + self.args
|
||||
subprocess.check_call(args, cwd=builder.root_path)
|
||||
|
||||
|
||||
class CleanAllTarget(CleanTarget):
|
||||
def __init__(self, name='clean-all'):
|
||||
super().__init__(name)
|
||||
self.args = ('-dX', '--force')
|
||||
|
||||
|
||||
class CleanDepsTarget(CleanAllTarget):
|
||||
def __init__(self, name='clean-deps'):
|
||||
super().__init__(name)
|
||||
|
||||
def configure(self, builder: 'Builder'):
|
||||
self.args += (builder.deps_path,)
|
||||
|
||||
|
||||
# Case insensitive dictionary class from
|
||||
# https://github.com/psf/requests/blob/v2.25.0/requests/structures.py
|
||||
|
||||
|
@ -1171,7 +1186,8 @@ class Builder(object):
|
|||
ZlibTarget(),
|
||||
|
||||
# Special
|
||||
CleanTarget(),
|
||||
CleanAllTarget(),
|
||||
CleanDepsTarget()
|
||||
)
|
||||
|
||||
self.targets = CaseInsensitiveDict({target.name: target for target in targets})
|
||||
|
|
Loading…
Reference in a new issue