in project_future.py [0:0]
def add_arguments(parser):
"""Add common arguments to parser."""
parser.register('type', 'bool', str2bool)
parser.add_argument('--verbose',
action='store_true')
# TODO: remove Linux sandbox hack
if platform.system() == 'Darwin':
parser.add_argument('--swiftc',
metavar='PATH',
help='swiftc executable',
required=True,
type=os.path.abspath)
parser.add_argument('--override-swift-exec',
metavar='PATH',
help='override the SWIFT_EXEC that is used to build the projects',
type=os.path.abspath)
else:
parser.add_argument('--swiftc',
metavar='PATH',
help='swiftc executable',
required=True)
parser.add_argument('--override-swift-exec',
metavar='PATH',
help='override the SWIFT_EXEC that is used to build the projects')
parser.add_argument('--projects',
metavar='PATH',
required=True,
help='JSON project file',
type=os.path.abspath)
parser.add_argument('--swift-version',
metavar='VERS',
help='Swift version mode (default: None)')
parser.add_argument('--include-repos',
metavar='PREDICATE',
default=[],
action='append',
help='a Python predicate to determine '
'whether to include a repo '
'(example: \'path == "Alamofire"\')')
parser.add_argument('--exclude-repos',
metavar='PREDICATE',
default=[],
action='append',
help='a Python predicate to determine '
'whether to exclude a repo '
'(example: \'path == "Alamofire"\')')
parser.add_argument('--include-versions',
metavar='PREDICATE',
default=[],
action='append',
help='a Python predicate to determine '
'whether to include a Swift version '
'(example: '
'\'version == "3.0"\')')
parser.add_argument('--exclude-versions',
metavar='PREDICATE',
default=[],
action='append',
help='a Python predicate to determine '
'whether to exclude a Swift version '
'(example: '
'\'version == "3.0"\')')
parser.add_argument('--include-actions',
metavar='PREDICATE',
default=[],
action='append',
help='a Python predicate to determine '
'whether to include an action '
'(example: '
'\'action == "BuildXcodeWorkspaceScheme"\')')
parser.add_argument('--exclude-actions',
metavar='PREDICATE',
default=[],
action='append',
help='a Python predicate to determine '
'whether to exclude an action '
'(example: '
'\'action == "BuildXcodeWorkspaceScheme"\')')
parser.add_argument('--swift-branch',
metavar='BRANCH',
help='Swift branch configuration to use',
default='main')
parser.add_argument('--sandbox-profile-xcodebuild',
metavar='FILE',
help='sandbox xcodebuild build and test operations '
'with profile',
type=os.path.abspath)
parser.add_argument('--sandbox-profile-package',
metavar='FILE',
help='sandbox package build and test operations with '
'profile',
type=os.path.abspath)
parser.add_argument("--test-incremental",
help='test incremental-mode over multiple commits',
action='store_true')
parser.add_argument("--add-swift-flags",
metavar="FLAGS",
help='add flags to each Swift invocation (note: field '
'names from projects.json enclosed in {} will be '
'replaced with their value)',
default='')
parser.add_argument("--add-xcodebuild-flags",
metavar="FLAGS",
help='add flags to each xcodebuild invocation (note: field '
'names from projects.json enclosed in {} will be '
'replaced with their value)',
default='')
parser.add_argument("--skip-clean",
help='skip all git and build clean steps before '
'building projects',
action='store_true'),
parser.add_argument("--build-config",
metavar="NAME",
choices=['debug', 'release'],
dest='build_config',
help='specify "debug" or "release" to override '
'the build configuration in the projects.json file')
parser.add_argument("--strip-resource-phases",
help='strip all resource phases from project file '
'before building (default: true)',
metavar='BOOL',
type='bool',
nargs='?',
const=True,
default=True)
parser.add_argument("--project-cache-path",
help='Path of the dir where all the project binaries will be placed',
metavar='PATH',
type=os.path.abspath,
default='project_cache')
parser.add_argument("--report-time-path",
help='export time for building each xcode build target to the specified json file',
type=os.path.abspath)
parser.add_argument("--clang",
help='clang executable to build Xcode projects',
type=os.path.abspath)
parser.add_argument("--job-type",
help="The type of job to run. This influences which projects are XFailed, for example the stress tester tracks its XFails under a different job type. Defaults to 'source-compat'.",
default='source-compat')