mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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__(
|
||||
|
||||
Reference in New Issue
Block a user