[build-script] Argument Builder DSL Conversion: Episode 3 (#13231)

* Updated the PathType and StorePathAction classes to allow for asserting if a path contains an executable.

* Converted the top-level argument group to use the new builder DSL.

* Updated tests for StorePathType to not actually test the functionality of the PathType class.

* Implemented a CompilerVersion type to mimic the existing wrapper in swift_build_support and return a more detailed object from ClangVersionType and SwiftVersionType.

* Updated action tests.

* Fixed a filter() mistake.

* Code review.
This commit is contained in:
Ross Bayer
2017-12-06 12:36:48 -08:00
committed by GitHub
parent 68a4b439e2
commit 5a8a25e59e
9 changed files with 384 additions and 301 deletions

View File

@@ -180,7 +180,7 @@ class StoreAction(Action):
if 'choices' in kwargs:
kwargs['nargs'] = Nargs.OPTIONAL
if 'const' in kwargs:
elif 'const' in kwargs:
kwargs['nargs'] = Nargs.ZERO
super(StoreAction, self).__init__(
@@ -242,8 +242,11 @@ class StorePathAction(StoreAction):
"""
def __init__(self, option_strings, **kwargs):
assert_exists = kwargs.pop('exists', False)
assert_executable = kwargs.pop('executable', False)
kwargs['nargs'] = Nargs.SINGLE
kwargs['type'] = PathType()
kwargs['type'] = PathType(assert_exists, assert_executable)
kwargs.setdefault('metavar', 'PATH')
super(StorePathAction, self).__init__(