Beispiel #1
0
class AppArgument(cli.Argument):
    APPLICATION_ID_RESOURCE_ID = cli.ArgumentProperties(
        key='application_id',
        type=ResourceId,
        description=
        'Application Apple ID. An automatically generated ID assigned to your app',
    )
    APPLICATION_ID_RESOURCE_ID_OPTIONAL = cli.ArgumentProperties(
        key='application_id',
        flags=('--app-id', '--application-id'),
        type=ResourceId,
        description=
        'Application Apple ID. An automatically generated ID assigned to your app',
        argparse_kwargs={'required': False},
    )
    APPLICATION_NAME = cli.ArgumentProperties(
        key='application_name',
        flags=('--app-name', '--application-name'),
        description='The name of your app as it will appear in the App Store',
        argparse_kwargs={'required': False},
    )
    APPLICATION_SKU = cli.ArgumentProperties(
        key='application_sku',
        flags=('--app-sku', '--application-sku'),
        description=
        'A unique ID for your app that is not visible on the App Store.',
        argparse_kwargs={'required': False},
    )
class DeviceArgument(cli.Argument):
    DEVICE_RESOURCE_IDS = cli.ArgumentProperties(
        key='device_resource_ids',
        flags=('--device-ids',),
        type=ResourceId,
        description='Alphanumeric ID value of the Device',
        argparse_kwargs={
            'required': True,
            'nargs': '+',
            'metavar': 'device-id'
        }
    )
    DEVICE_NAME = cli.ArgumentProperties(
        key='device_name',
        flags=('--name',),
        description='Name of the Device',
        argparse_kwargs={'required': False}
    )
    DEVICE_STATUS = cli.ArgumentProperties(
        key='device_status',
        flags=('--status',),
        type=DeviceStatus,
        description='Status of the Device',
        argparse_kwargs={
            'required': False,
            'choices': list(DeviceStatus),
        }
    )
class CommonArgument(cli.Argument):
    CREATE_RESOURCE = cli.ArgumentProperties(
        key='create_resource',
        flags=('--create',),
        type=bool,
        description='Whether to create the resource if it does not exist yet',
        argparse_kwargs={'required': False, 'action': 'store_true'},
    )
    IGNORE_NOT_FOUND = cli.ArgumentProperties(
        key='ignore_not_found',
        flags=('--ignore-not-found',),
        type=bool,
        description='Do not raise exceptions if the specified resource does not exist.',
        argparse_kwargs={'required': False, 'action': 'store_true'},
    )
    SAVE = cli.ArgumentProperties(
        key='save',
        flags=('--save',),
        type=bool,
        description=(
            f'Whether to save the resources to disk. See '
            f'{Colors.CYAN(AppStoreConnectArgument.PROFILES_DIRECTORY.key.upper())} and '
            f'{Colors.CYAN(AppStoreConnectArgument.CERTIFICATES_DIRECTORY.key.upper())} '
            f'for more information.'
        ),
        argparse_kwargs={'required': False, 'action': 'store_true'},
    )
class _TestArgument(cli.Argument):
    TYPED_ARGUMENT = cli.ArgumentProperties(key='typed_argument',
                                            type=_TypedArgument,
                                            description='typed argument')
    PATH_ARGUMENT = cli.ArgumentProperties(key='path_argument',
                                           type=pathlib.Path,
                                           description='path')
    INT_ARGUMENT = cli.ArgumentProperties(key='int_argument',
                                          type=integer_converter,
                                          description='integer')
Beispiel #5
0
class TestResultArgument(cli.Argument):
    XCRESULT_PATTERNS = cli.ArgumentProperties(
        key='xcresult_patterns',
        flags=('-p', '--xcresult'),
        type=cli.CommonArgumentTypes.existing_dir,
        description=
        ('Path to Xcode Test result (*.xcresult) to be be converted. '
         'Can be either a path literal, or a glob pattern to match xcresults '
         'in working directory. '
         'If no search paths are provided, look for *.xcresults from current directory.'
         ),
        argparse_kwargs={
            'required': False,
            'default': None,
            'nargs': '+',
            'metavar': 'xcresult-pattern',
        },
    )
    XCRESULT_DIRS = cli.ArgumentProperties(
        key='xcresult_dirs',
        flags=('-d', '--dir'),
        type=cli.CommonArgumentTypes.existing_dir,
        description=
        ('Directory where Xcode Test results (*.xcresult) should be converted. '
         'If no search paths are provided, look for *.xcresults from current directory.'
         ),
        argparse_kwargs={
            'required': False,
            'default': [],
            'nargs': '+',
            'metavar': 'xcresult-dir',
        },
    )
    OUTPUT_DIRECTORY = cli.ArgumentProperties(
        key='output_dir',
        flags=('-o', '--output-dir'),
        type=cli.CommonArgumentTypes.existing_dir,
        description='Directory where the Junit XML results will be saved.',
        argparse_kwargs={
            'required': False,
            'default': pathlib.Path('build/ios/test'),
        },
    )
    OUTPUT_EXTENSION = cli.ArgumentProperties(
        key='output_extension',
        flags=('-e', '--output-extension'),
        type=str,
        description=
        'Extension for the created Junit XML file. For example `xml` or `junit`.',
        argparse_kwargs={
            'required': False,
            'default': 'xml',
        },
    )
class KeychainArgument(cli.Argument):
    PATH = cli.ArgumentProperties(
        flags=('-p', '--path'),
        key='path',
        type=pathlib.Path,
        description=(
            'Keychain path. If not provided, the system default '
            'keychain will be used instead'
        ),
        argparse_kwargs={'required': False}
    )
    PASSWORD = cli.ArgumentProperties(
        flags=('-pw', '--password'),
        key='password',
        type=Password,
        description='Keychain password',
        argparse_kwargs={'required': False, 'default': ''},
    )
    TIMEOUT = cli.ArgumentProperties(
        flags=('-t', '--timeout'),
        key='timeout',
        type=Seconds,
        description='Keychain timeout in seconds, defaults to no timeout',
        argparse_kwargs={'required': False, 'default': None},
    )
    CERTIFICATE_PATHS = cli.ArgumentProperties(
        flags=('-c', '--certificate'),
        key='certificate_path_patterns',
        type=pathlib.Path,
        description=(
            'Path to pkcs12 certificate. Can be either a path literal, or '
            'a glob pattern to match certificates.'
        ),
        argparse_kwargs={
            'required': False,
            'nargs': '+',
            'metavar': 'certificate-path',
            'default': (Certificate.DEFAULT_LOCATION / '*.p12',),
        }
    )
    CERTIFICATE_PASSWORD = cli.ArgumentProperties(
        flags=('--certificate-password',),
        key='certificate_password',
        type=Password,
        description='Encrypted p12 certificate password',
        argparse_kwargs={'required': False, 'default': ''},
    )
Beispiel #7
0
class PublishArgument(cli.Argument):
    APPLICATION_PACKAGE_PATH_PATTERNS = cli.ArgumentProperties(
        key='application_package_path_patterns',
        flags=('--path', ),
        type=pathlib.Path,
        description=
        ('Path to artifact (*.ipa or *.pkg). Can be either a path literal, or '
         'a glob pattern to match projects in working directory.'),
        argparse_kwargs={
            'required': False,
            'default': (pathlib.Path('**/*.ipa'), pathlib.Path('**/*.pkg')),
            'nargs': '+',
            'metavar': 'artifact-path',
        },
    )
    SUBMIT_TO_TESTFLIGHT = cli.ArgumentProperties(
        key='submit_to_testflight',
        flags=('-t', '--testflight'),
        type=bool,
        description=
        'Submit an app for Testflight beta app review to allow external testing',
        argparse_kwargs={
            'required': False,
            'action': 'store_true',
        },
    )
    APPLE_ID = cli.ArgumentProperties(
        key='apple_id',
        flags=('-u', '--apple-id'),
        description=
        ('App Store Connect username used for application package validation '
         'and upload if App Store Connect API key is not specified'),
        argparse_kwargs={'required': False},
    )
    APP_SPECIFIC_PASSWORD = cli.ArgumentProperties(
        key='app_specific_password',
        flags=('-p', '--password'),
        type=Types.AppSpecificPassword,
        description=
        ('App-specific password used for application package validation '
         'and upload if App Store Connect API Key is not specified. '
         f'Used together with {Colors.BRIGHT_BLUE("--apple-id")} '
         'and should match pattern "abcd-abcd-abcd-abcd". '
         'Create an app-specific password in the Security section of your Apple ID account. '
         'Learn more from https://support.apple.com/en-us/HT204397'),
        argparse_kwargs={'required': False},
    )
Beispiel #8
0
class XcprettyArgument(cli.Argument):
    DISABLE = cli.ArgumentProperties(
        key='disable_xcpretty',
        flags=('--disable-xcpretty',),
        type=bool,
        description='Do not use XCPretty formatter to process log output',
        argparse_kwargs={'required': False, 'action': 'store_true'},
    )
    OPTIONS = cli.ArgumentProperties(
        key='xcpretty_options',
        flags=('--xcpretty-options',),
        description=(
            'Command line options for xcpretty formatter. '
            'For example "--no-color" or "--simple  --no-utf".'
        ),
        argparse_kwargs={'required': False, 'default': '--color'},
    )
class ProfileArgument(cli.Argument):
    PROFILE_RESOURCE_ID = cli.ArgumentProperties(
        key='profile_resource_id',
        type=ResourceId,
        description='Alphanumeric ID value of the Profile',
    )
    PROFILE_TYPE = cli.ArgumentProperties(
        key='profile_type',
        flags=('--type',),
        type=ProfileType,
        description='Type of the provisioning profile',
        argparse_kwargs={
            'required': False,
            'choices': list(ProfileType),
            'default': ProfileType.IOS_APP_DEVELOPMENT
        }
    )
    PROFILE_TYPE_OPTIONAL = cli.ArgumentProperties(
        key='profile_type',
        flags=('--type',),
        type=ProfileType,
        description='Type of the provisioning profile',
        argparse_kwargs={
            'required': False,
            'choices': list(ProfileType),
        }
    )
    PROFILE_STATE_OPTIONAL = cli.ArgumentProperties(
        key='profile_state',
        flags=('--state',),
        type=ProfileState,
        description='State of the provisioning profile',
        argparse_kwargs={
            'required': False,
            'choices': list(ProfileState),
        }
    )
    PROFILE_NAME = cli.ArgumentProperties(
        key='profile_name',
        flags=('--name',),
        description='Name of the provisioning profile',
        argparse_kwargs={'required': False}
    )
class BundleIdArgument(cli.Argument):
    BUNDLE_ID_IDENTIFIER = cli.ArgumentProperties(
        key='bundle_id_identifier',
        description='Identifier of the Bundle ID',
    )
    BUNDLE_ID_IDENTIFIER_OPTIONAL = cli.ArgumentProperties(
        key='bundle_id_identifier',
        flags=('--bundle-id-identifier',),
        description='Identifier of the Bundle ID',
        argparse_kwargs={'required': False}
    )
    BUNDLE_ID_NAME = cli.ArgumentProperties(
        key='bundle_id_name',
        flags=('--name',),
        description=(
            'Name of the Bundle ID. If the resource is being created, '
            'the default will be deduced from given Bundle ID identifier.'
        ),
        argparse_kwargs={'required': False},
    )
    BUNDLE_ID_RESOURCE_ID = cli.ArgumentProperties(
        key='bundle_id_resource_id',
        type=ResourceId,
        description='Alphanumeric ID value of the Bundle ID',
    )
    BUNDLE_ID_RESOURCE_IDS = cli.ArgumentProperties(
        key='bundle_id_resource_ids',
        flags=('--bundle-ids',),
        type=ResourceId,
        description='Alphanumeric ID value of the Bundle ID',
        argparse_kwargs={
            'required': True,
            'nargs': '+',
            'metavar': 'bundle-identifier-id'
        }
    )
    PLATFORM = cli.ArgumentProperties(
        key='platform',
        flags=('--platform',),
        type=BundleIdPlatform,
        description='Bundle ID platform',
        argparse_kwargs={
            'required': False,
            'choices': list(BundleIdPlatform),
            'default': BundleIdPlatform.IOS,
        },
    )
    PLATFORM_OPTIONAL = cli.ArgumentProperties(
        key='platform',
        flags=('--platform',),
        type=BundleIdPlatform,
        description='Bundle ID platform',
        argparse_kwargs={
            'required': False,
            'choices': list(BundleIdPlatform),
        },
    )
Beispiel #11
0
class AppStoreVersionArgument(cli.Argument):
    APP_STORE_VERSION = cli.ArgumentProperties(
        key='app_store_version',
        flags=('--app-store-version', ),
        description=
        ('Version of the build published to App Store '
         'that identifies an iteration of the bundle. '
         'The string can only contain one to three groups of numeric characters (0-9) '
         'separated by period in the format [Major].[Minor].[Patch]. '
         'For example `3.2.46`'),
        argparse_kwargs={'required': False},
    )
class AppStoreConnectArgument(cli.Argument):
    LOG_REQUESTS = cli.ArgumentProperties(
        key='log_requests',
        flags=('--log-api-calls',),
        type=bool,
        description='Turn on logging for App Store Connect API HTTP requests',
        argparse_kwargs={'required': False, 'action': 'store_true'},
    )
    JSON_OUTPUT = cli.ArgumentProperties(
        key='json_output',
        flags=('--json',),
        type=bool,
        description='Whether to show the resource in JSON format',
        argparse_kwargs={'required': False, 'action': 'store_true'},
    )
    ISSUER_ID = cli.ArgumentProperties(
        key='issuer_id',
        flags=('--issuer-id',),
        type=Types.IssuerIdArgument,
        description=(
            f'App Store Connect API Key Issuer ID. Identifies the issuer '
            f'who created the authentication token. {_API_DOCS_REFERENCE}'
        ),
        argparse_kwargs={'required': False},
    )
    KEY_IDENTIFIER = cli.ArgumentProperties(
        key='key_identifier',
        flags=('--key-id',),
        type=Types.KeyIdentifierArgument,
        description=f'App Store Connect API Key ID. {_API_DOCS_REFERENCE}',
        argparse_kwargs={'required': False},
    )
    PRIVATE_KEY = cli.ArgumentProperties(
        key='private_key',
        flags=('--private-key',),
        type=Types.PrivateKeyArgument,
        description=f'App Store Connect API private key. {_API_DOCS_REFERENCE}',
        argparse_kwargs={'required': False},
    )
    CERTIFICATES_DIRECTORY = cli.ArgumentProperties(
        key='certificates_directory',
        flags=('--certificates-dir',),
        type=pathlib.Path,
        description='Directory where the code signing certificates will be saved',
        argparse_kwargs={'required': False, 'default': Certificate.DEFAULT_LOCATION},
    )
    PROFILES_DIRECTORY = cli.ArgumentProperties(
        key='profiles_directory',
        flags=('--profiles-dir',),
        type=pathlib.Path,
        description='Directory where the provisioning profiles will be saved',
        argparse_kwargs={'required': False, 'default': ProvisioningProfile.DEFAULT_LOCATION},
    )
Beispiel #13
0
class ExportIpaArgument(cli.Argument):
    ARCHIVE_DIRECTORY = cli.ArgumentProperties(
        key='archive_directory',
        flags=('--archive-directory',),
        type=pathlib.Path,
        description='Directory where the created archive is stored',
        argparse_kwargs={
            'required': False,
            'default': pathlib.Path('build/ios/xcarchive')
        }
    )
    CUSTOM_EXPORT_OPTIONS = cli.ArgumentProperties(
        key='custom_export_options',
        flags=('--custom-export-options',),
        type=cli.CommonArgumentTypes.json_dict,
        description=(
            'Custom options for generated export options as JSON string. '
            'For example \'{"uploadBitcode": false, "uploadSymbols": false}\'.'
        ),
        argparse_kwargs={'required': False}
    )
    EXPORT_OPTIONS_PATH = cli.ArgumentProperties(
        key='export_options_plist',
        flags=('--export-options-plist',),
        type=pathlib.Path,
        description='Path to the generated export options plist',
        argparse_kwargs={
            'required': False,
            'default': pathlib.Path('~/export_options.plist').expanduser()
        }
    )
    EXPORT_OPTIONS_PATH_EXISTING = cli.ArgumentProperties(
        key='export_options_plist',
        flags=('--export-options-plist',),
        type=cli.CommonArgumentTypes.existing_path,
        description='Path to the generated export options plist',
        argparse_kwargs={
            'required': False,
            'default': pathlib.Path('~/export_options.plist').expanduser()
        }
    )
    IPA_DIRECTORY = cli.ArgumentProperties(
        key='ipa_directory',
        flags=('--ipa-directory',),
        type=pathlib.Path,
        description='Directory where the built ipa is stored',
        argparse_kwargs={
            'required': False,
            'default': pathlib.Path('build/ios/ipa')
        }
    )
    REMOVE_XCARCHIVE = cli.ArgumentProperties(
        key='remove_xcarchive',
        flags=('--remove-xcarchive',),
        type=bool,
        description='Remove generated xcarchive container while building ipa',
        argparse_kwargs={'required': False, 'action': 'store_true'},
    )
class UniversalApkGeneratorArgument(cli.Argument):
    PATTERN = cli.ArgumentProperties(
        flags=('--pattern',),
        key='pattern',
        type=pathlib.Path,
        description='glob pattern to parse files, relative to current folder',
        argparse_kwargs={'required': False, 'default': '**/*.aab'},
    )

    KEYSTORE_PATH = cli.ArgumentProperties(
        flags=('--ks',),
        key='keystore_path',
        type=pathlib.Path,
        description='path to the keystore to sign the apk files with',
        argparse_kwargs={'required': False, 'default': None},
    )

    KEYSTORE_PASSWORD = cli.ArgumentProperties(
        flags=('--ks-pass',),
        key='keystore_password',
        description='keystore password',
        argparse_kwargs={'required': False, 'default': None},
    )

    KEY_ALIAS = cli.ArgumentProperties(
        flags=('--ks-key-alias',),
        key='key_alias',
        description='keystore key alias',
        argparse_kwargs={'required': False, 'default': None},
    )

    KEY_PASSWORD = cli.ArgumentProperties(
        flags=('--key-pass',),
        key='key_password',
        description='keystore key password',
        argparse_kwargs={'required': False, 'default': None},
    )
Beispiel #15
0
class GooglePlayArgument(cli.Argument):
    GCLOUD_SERVICE_ACCOUNT_CREDENTIALS = cli.ArgumentProperties(
        key='credentials',
        flags=('--credentials', ),
        type=Types.CredentialsArgument,
        description=('Gcloud service account credentials with `JSON` key type '
                     'to access Google Play Developer API'),
        argparse_kwargs={'required': False},
    )
    PACKAGE_NAME = cli.ArgumentProperties(
        key='package_name',
        flags=('--package-name', ),
        type=Types.PackageName,
        description=
        'Package name of the app in Google Play Console (Ex: com.google.example)',
        argparse_kwargs={'required': True},
    )
    LOG_REQUESTS = cli.ArgumentProperties(
        key='log_requests',
        flags=('--log-api-calls', ),
        type=bool,
        description='Turn on logging for Google Play Developer API requests',
        argparse_kwargs={
            'required': False,
            'action': 'store_true'
        },
    )
    JSON_OUTPUT = cli.ArgumentProperties(
        key='json_output',
        flags=('--json', ),
        type=bool,
        description='Whether to show the request response in JSON format',
        argparse_kwargs={
            'required': False,
            'action': 'store_true'
        },
    )
Beispiel #16
0
class BuildNumberArgument(cli.Argument):
    TRACKS = cli.ArgumentProperties(
        key='tracks',
        flags=('--tracks', ),
        type=TrackName,
        description=(
            'Get the build number from the specified track(s). '
            'If not specified, the highest build number across all tracks '
            f'({", ".join(list(map(str, TrackName)))}) is returned'),
        argparse_kwargs={
            'required': False,
            'nargs': '+',
            'choices': list(TrackName),
        },
    )
Beispiel #17
0
class AppStoreVersionArgument(cli.Argument):
    APP_STORE_STATE = cli.ArgumentProperties(
        key='app_store_state',
        flags=('--state', '--app-store-version-state'),
        type=AppStoreState,
        description='State of App Store Version',
        argparse_kwargs={
            'required': False,
            'choices': list(AppStoreState),
        },
    )
    APP_STORE_VERSION_ID = cli.ArgumentProperties(
        key='app_store_version_id',
        type=ResourceId,
        description='UUID value of the App Store Version',
    )
    APP_STORE_VERSION_ID_OPTIONAL = cli.ArgumentProperties(
        key='app_store_version_id',
        flags=('--version-id', '--app-store-version-id'),
        type=ResourceId,
        description='UUID value of the App Store Version',
        argparse_kwargs={'required': False},
    )
    APP_STORE_VERSION_SUBMISSION_ID = cli.ArgumentProperties(
        key='app_store_version_submission_id',
        type=ResourceId,
        description='UUID value of the App Store Version Submission',
    )
    PLATFORM = cli.ArgumentProperties(
        key='platform',
        flags=('--platform', '--app-store-version-platform'),
        type=Platform,
        description='App Store Version platform',
        argparse_kwargs={
            'required': False,
            'choices': list(Platform),
        },
    )
    VERSION_STRING = cli.ArgumentProperties(
        key='version_string',
        flags=('--version-string', '--app-store-version'),
        description=
        ('Version of the build published to App Store '
         'that identifies an iteration of the bundle. '
         'The string can only contain one to three groups of numeric characters (0-9) '
         'separated by period in the format [Major].[Minor].[Patch]. '
         'For example `3.2.46`'),
        argparse_kwargs={'required': False},
    )
class CertificateArgument(cli.Argument):
    CERTIFICATE_RESOURCE_ID = cli.ArgumentProperties(
        key='certificate_resource_id',
        type=ResourceId,
        description='Alphanumeric ID value of the Signing Certificate',
    )
    CERTIFICATE_RESOURCE_IDS = cli.ArgumentProperties(
        key='certificate_resource_ids',
        flags=('--certificate-ids',),
        type=ResourceId,
        description='Alphanumeric ID value of the Signing Certificate',
        argparse_kwargs={
            'required': True,
            'nargs': '+',
            'metavar': 'certificate-id'
        }
    )
    CERTIFICATE_TYPE = cli.ArgumentProperties(
        key='certificate_type',
        flags=('--type',),
        type=CertificateType,
        description='Type of the certificate',
        argparse_kwargs={
            'required': False,
            'choices': list(CertificateType),
            'default': CertificateType.IOS_DEVELOPMENT,
        }
    )
    CERTIFICATE_TYPE_OPTIONAL = cli.ArgumentProperties(
        key='certificate_type',
        flags=('--type',),
        type=CertificateType,
        description='Type of the certificate',
        argparse_kwargs={
            'required': False,
            'choices': list(CertificateType),
        }
    )
    PROFILE_TYPE_OPTIONAL = cli.ArgumentProperties(
        key='profile_type',
        flags=('--profile-type',),
        type=ProfileType,
        description='Type of the provisioning profile that the certificate is used with',
        argparse_kwargs={
            'required': False,
            'choices': list(ProfileType),
        }
    )
    DISPLAY_NAME = cli.ArgumentProperties(
        key='display_name',
        flags=('--display-name',),
        description='Code signing certificate display name',
        argparse_kwargs={'required': False}
    )
    PRIVATE_KEY = cli.ArgumentProperties(
        key='certificate_key',
        flags=('--certificate-key',),
        type=Types.CertificateKeyArgument,
        description=(
            f'Private key used to generate the certificate. '
            f'Used together with {Colors.BRIGHT_BLUE("--save")} '
            f'or {Colors.BRIGHT_BLUE("--create")} options.'
        ),
        argparse_kwargs={'required': False},
    )
    PRIVATE_KEY_PASSWORD = cli.ArgumentProperties(
        key='certificate_key_password',
        flags=('--certificate-key-password',),
        type=Types.CertificateKeyPasswordArgument,
        description=(
            f'Password of the private key used to generate the certificate. '
            f'Used together with {Colors.BRIGHT_BLUE("--certificate-key")} '
            f'or {Colors.BRIGHT_BLUE("--certificate-key-path")} options '
            f'if the provided key is encrypted.'
        ),
        argparse_kwargs={'required': False},
    )
    P12_CONTAINER_PASSWORD = cli.ArgumentProperties(
        key='p12_container_password',
        flags=('--p12-password',),
        description=(
            'If provided, the saved p12 container will be encrypted using this password. '
            f'Used together with {Colors.BRIGHT_BLUE("--save")} option.'
        ),
        argparse_kwargs={'required': False, 'default': ''},
    )
Beispiel #19
0
class BundleIdArgument(cli.Argument):
    BUNDLE_ID_IDENTIFIER = cli.ArgumentProperties(
        key='bundle_id_identifier',
        description='Identifier of the Bundle ID',
    )
    BUNDLE_ID_IDENTIFIER_OPTIONAL = cli.ArgumentProperties(
        key='bundle_id_identifier',
        flags=('--bundle-id-identifier', ),
        description='Identifier of the Bundle ID',
        argparse_kwargs={'required': False},
    )
    BUNDLE_ID_NAME = cli.ArgumentProperties(
        key='bundle_id_name',
        flags=('--name', ),
        description=(
            'Name of the Bundle ID. If the resource is being created, '
            'the default will be deduced from given Bundle ID identifier.'),
        argparse_kwargs={'required': False},
    )
    BUNDLE_ID_RESOURCE_ID = cli.ArgumentProperties(
        key='bundle_id_resource_id',
        type=ResourceId,
        description='Alphanumeric ID value of the Bundle ID',
    )
    BUNDLE_ID_RESOURCE_IDS = cli.ArgumentProperties(
        key='bundle_id_resource_ids',
        flags=('--bundle-ids', ),
        type=ResourceId,
        description='Alphanumeric ID value of the Bundle ID',
        argparse_kwargs={
            'required': True,
            'nargs': '+',
            'metavar': 'bundle-identifier-id',
        },
    )
    PLATFORM = cli.ArgumentProperties(
        key='platform',
        flags=('--platform', ),
        type=BundleIdPlatform,
        description='Bundle ID platform',
        argparse_kwargs={
            'required': False,
            'choices': list(BundleIdPlatform),
            'default': BundleIdPlatform.IOS,
        },
    )
    PLATFORM_OPTIONAL = cli.ArgumentProperties(
        key='platform',
        flags=('--platform', ),
        type=BundleIdPlatform,
        description='Bundle ID platform',
        argparse_kwargs={
            'required': False,
            'choices': list(BundleIdPlatform),
        },
    )
    IDENTIFIER_STRICT_MATCH = cli.ArgumentProperties(
        key='bundle_id_identifier_strict_match',
        flags=('--strict-match-identifier', ),
        type=bool,
        description=
        ('Only match Bundle IDs that have exactly the same identifier specified by '
         '`BUNDLE_ID_IDENTIFIER`. By default identifier `com.example.app` also matches '
         'Bundle IDs with identifier such as `com.example.app.extension`'),
        argparse_kwargs={
            'required': False,
            'action': 'store_true'
        },
    )
Beispiel #20
0
class BuildArgument(cli.Argument):
    APPLICATION_ID_RESOURCE_ID = cli.ArgumentProperties(
        key='application_id',
        type=ResourceId,
        description=
        'Application Apple ID. An automatically generated ID assigned to your app',
    )
    APPLICATION_ID_RESOURCE_ID_OPTIONAL = cli.ArgumentProperties(
        key='application_id',
        flags=('--application-id', ),
        type=ResourceId,
        description=
        'Application Apple ID. An automatically generated ID assigned to your app',
        argparse_kwargs={'required': False},
    )
    EXPIRED = cli.ArgumentProperties(
        key='expired',
        flags=('--expired', ),
        type=bool,
        description='List only expired builds',
        argparse_kwargs={
            'required': False,
            'action': 'store_true',
        },
    )
    NOT_EXPIRED = cli.ArgumentProperties(
        key='not_expired',
        flags=('--not-expired', ),
        type=bool,
        description='List only not expired builds',
        argparse_kwargs={
            'required': False,
            'action': 'store_true',
        },
    )
    BUILD_ID_RESOURCE_ID = cli.ArgumentProperties(
        key='build_id',
        flags=('--build-id', ),
        type=ResourceId,
        description='Alphanumeric ID value of the Build',
        argparse_kwargs={'required': False},
    )
    PRE_RELEASE_VERSION = cli.ArgumentProperties(
        key='pre_release_version',
        flags=('--pre-release-version', ),
        description=
        ('Version of the build published to Testflight '
         'that identifies an iteration of the bundle. '
         'The string can only contain one to three groups of numeric characters (0-9) '
         'separated by period in the format [Major].[Minor].[Patch]. '
         'For example `3.2.46`'),
        argparse_kwargs={'required': False},
    )
    PROCESSING_STATE = cli.ArgumentProperties(
        key='processing_state',
        flags=('--processing-state', ),
        type=BuildProcessingState,
        description='Build processing state',
        argparse_kwargs={
            'required': False,
            'choices': list(BuildProcessingState),
        },
    )
    BUILD_VERSION_NUMBER = cli.ArgumentProperties(
        key='build_version_number',
        flags=('--build-version-number', ),
        type=int,
        description=(
            'Build version number is the version number of the uploaded build. '
            'For example `46`'),
        argparse_kwargs={'required': False},
    )
class AndroidAppBundleArgument(cli.Argument):
    BUNDLE_PATTERN = cli.ArgumentProperties(
        flags=('--bundle', ),
        key='aab_pattern',
        type=pathlib.Path,
        description='Glob pattern to parse files, relative to current folder',
        argparse_kwargs={
            'default': '**/*.aab',
            'required': False,
        },
    )
    BUNDLE_PATH = cli.ArgumentProperties(
        flags=('--bundle', ),
        key='aab_path',
        type=cli.CommonArgumentTypes.existing_path,
        description='Path to Android app bundle file',
        argparse_kwargs={
            'required': True,
        },
    )
    KEYSTORE_PATH = cli.ArgumentProperties(
        flags=('--ks', ),
        key='keystore_path',
        type=cli.CommonArgumentTypes.existing_path,
        description='Path to the keystore to sign the apk files with',
        argparse_kwargs={
            'default': None,
            'required': False,
        },
    )
    KEYSTORE_PATH_REQUIRED = KEYSTORE_PATH.duplicate(
        argparse_kwargs={'required': True})
    KEYSTORE_PASSWORD = cli.ArgumentProperties(
        flags=('--ks-pass', ),
        key='keystore_password',
        type=AndroidAppBundleTypes.KeystorePassword,
        description='Keystore password',
        argparse_kwargs={
            'default': None,
            'required': False,
        },
    )
    KEYSTORE_PASSWORD_REQUIRED = KEYSTORE_PASSWORD.duplicate(
        argparse_kwargs={'required': True})
    KEY_ALIAS = cli.ArgumentProperties(
        flags=('--ks-key-alias', ),
        key='key_alias',
        type=AndroidAppBundleTypes.KeyAlias,
        description='Keystore key alias',
        argparse_kwargs={
            'default': None,
            'required': False,
        },
    )
    KEY_ALIAS_REQUIRED = KEY_ALIAS.duplicate(
        argparse_kwargs={'required': True})
    KEY_PASSWORD = cli.ArgumentProperties(
        flags=('--key-pass', ),
        key='key_password',
        type=AndroidAppBundleTypes.KeyPassword,
        description='Keystore key password',
        argparse_kwargs={
            'default': None,
            'required': False,
        },
    )
    KEY_PASSWORD_REQUIRED = KEY_PASSWORD.duplicate(
        argparse_kwargs={'required': True})
    BUILD_APKS_MODE = cli.ArgumentProperties(
        flags=('--mode', ),
        key='mode',
        description=
        ('Set the mode to universal if you want bundletool to build only a single APK '
         "that includes all of your app's code and resources such that the APK is "
         'compatible with all device configurations your app supports.'),
        argparse_kwargs={
            'default': None,
            'required': False,
            'choices': ['universal'],
        },
    )
    DUMP_TARGET = cli.ArgumentProperties(
        key='target',
        description='Target of the dump',
        argparse_kwargs={
            'choices': ['manifest', 'resources', 'config'],
        },
    )
    DUMP_XPATH = cli.ArgumentProperties(
        flags=('--xpath', ),
        key='xpath',
        description=
        ('XML path to specific attribute in the target. '
         'For example "/manifest/@android:versionCode" to obtain the version code from manifest. '
         'If not given, the full target will be dumped.'),
        argparse_kwargs={
            'required': False,
        },
    )
Beispiel #22
0
class AppStoreConnectArgument(cli.Argument):
    LOG_REQUESTS = cli.ArgumentProperties(
        key='log_requests',
        flags=('--log-api-calls', ),
        type=bool,
        description='Turn on logging for App Store Connect API HTTP requests',
        argparse_kwargs={
            'required': False,
            'action': 'store_true'
        },
    )
    JSON_OUTPUT = cli.ArgumentProperties(
        key='json_output',
        flags=('--json', ),
        type=bool,
        description='Whether to show the resource in JSON format',
        argparse_kwargs={
            'required': False,
            'action': 'store_true'
        },
    )
    ISSUER_ID = cli.ArgumentProperties(
        key='issuer_id',
        flags=('--issuer-id', ),
        type=Types.IssuerIdArgument,
        description=(
            f'App Store Connect API Key Issuer ID. Identifies the issuer '
            f'who created the authentication token. {_API_DOCS_REFERENCE}'),
        argparse_kwargs={'required': False},
    )
    KEY_IDENTIFIER = cli.ArgumentProperties(
        key='key_identifier',
        flags=('--key-id', ),
        type=Types.KeyIdentifierArgument,
        description=f'App Store Connect API Key ID. {_API_DOCS_REFERENCE}',
        argparse_kwargs={'required': False},
    )
    PRIVATE_KEY = cli.ArgumentProperties(
        key='private_key',
        flags=('--private-key', ),
        type=Types.PrivateKeyArgument,
        description=
        (f'App Store Connect API private key used for JWT authentication to communicate with Apple services. '
         f'{_API_DOCS_REFERENCE} '
         f'If not provided, the key will be searched from the following directories '
         f'in sequence for a private key file with the name "AuthKey_<key_identifier>.p8": '
         f'{", ".join(map(str, Types.PrivateKeyArgument.PRIVATE_KEY_LOCATIONS))}, where '
         f'<key_identifier> is the value of {Colors.BRIGHT_BLUE("--key-id")}'),
        argparse_kwargs={'required': False},
    )
    CERTIFICATES_DIRECTORY = cli.ArgumentProperties(
        key='certificates_directory',
        flags=('--certificates-dir', ),
        type=pathlib.Path,
        description=
        'Directory where the code signing certificates will be saved',
        argparse_kwargs={
            'required': False,
            'default': Certificate.DEFAULT_LOCATION
        },
    )
    PROFILES_DIRECTORY = cli.ArgumentProperties(
        key='profiles_directory',
        flags=('--profiles-dir', ),
        type=pathlib.Path,
        description='Directory where the provisioning profiles will be saved',
        argparse_kwargs={
            'required': False,
            'default': ProvisioningProfile.DEFAULT_LOCATION
        },
    )
Beispiel #23
0
class TestArgument(cli.Argument):
    DISABLE_CODE_COVERAGE = cli.ArgumentProperties(
        key='disable_code_coverage',
        flags=('--disable-coverage',),
        type=bool,
        description='Turn code coverage off when testing',
        argparse_kwargs={'required': False, 'action': 'store_true'},
    )
    GRACEFUL_EXIT = cli.ArgumentProperties(
        key='graceful_exit',
        flags=('--graceful-exit',),
        type=bool,
        description=(
            'In case of failed tests or unsuccessful test run exit '
            'the program with status code 0'
        ),
        argparse_kwargs={'required': False, 'action': 'store_true'},
    )
    INCLUDE_UNAVAILABLE = cli.ArgumentProperties(
        key='include_unavailable',
        flags=('-u', '--include-unavailable',),
        type=bool,
        description='Whether to include unavailable devices in output',
        argparse_kwargs={'required': False, 'action': 'store_true'},
    )
    MAX_CONCURRENT_DEVICES = cli.ArgumentProperties(
        key='max_concurrent_devices',
        flags=('--max-concurrent-devices',),
        type=int,
        description='The maximum number of device destinations to test on concurrently.',
        argparse_kwargs={'required': False, 'default': None},
    )
    MAX_CONCURRENT_SIMULATORS = cli.ArgumentProperties(
        key='max_concurrent_simulators',
        flags=('--max-concurrent-simulators',),
        type=int,
        description='The maximum number of simulator destinations to test on concurrently.',
        argparse_kwargs={'required': False, 'default': None},
    )
    RUNTIMES = cli.ArgumentProperties(
        key='runtimes',
        flags=('-r', '--runtime'),
        type=Runtime,
        description='Runtime name. For example "iOS 14.1", "tvOS 14", "watchOS 7".',
        argparse_kwargs={
            'required': False,
            'nargs': '+',
            'metavar': 'runtime',
        },
    )
    SIMULATOR_NAME = cli.ArgumentProperties(
        key='simulator_name',
        flags=('-n', '--name'),
        type=re.compile,
        description='Regex pattern to filter simulators by name. For example "iPad Air 2", "iPhone 11".',
        argparse_kwargs={'required': False, 'default': None},
    )
    TEST_DEVICES = cli.ArgumentProperties(
        key='devices',
        flags=('-d', '--device'),
        type=str,
        description=(
            'Test destination description. Either a UDID value of the device, or device name and '
            'runtime combination. If runtime is not specified, the latest available runtime for '
            'given device name will be chosen. For example '
            '"iOS 14.0 iPhone SE (2nd generation)", '
            '"iPad Pro (9.7-inch)", '
            '"tvOS 14.1 Apple TV 4K (at 1080p)", '
            '"Apple TV 4K". '
            'If no devices are specified, then the default destination will be chosen (see '
            '`xcode-project default-test-destination` for more information about default destination).'
        ),
        argparse_kwargs={
            'required': False,
            'nargs': '+',
            'metavar': 'device_description',
        },
    )
    TEST_ONLY = cli.ArgumentProperties(
        key='test_only',
        flags=('--test-only',),
        type=str,
        description='Limit test run to execute only specified tests, and exclude all other tests',
        argparse_kwargs={'required': False, 'default': None},
    )
    TEST_SDK = cli.ArgumentProperties(
        key='test_sdk',
        flags=('--sdk',),
        type=str,
        description='Name of the SDK that should be used for building the application for testing.',
        argparse_kwargs={'required': False, 'default': 'iphonesimulator'},
    )
Beispiel #24
0
class XcodeArgument(cli.Argument):
    ARCHIVE_FLAGS = cli.ArgumentProperties(
        key='archive_flags',
        flags=('--archive-flags',),
        type=str,
        description=(
            'Pass additional command line options to xcodebuild for the archive phase. '
            'For example `-derivedDataPath=$HOME/myDerivedData -quiet`.'
        ),
        argparse_kwargs={'required': False, 'default': ''},
    )
    ARCHIVE_XCARGS = cli.ArgumentProperties(
        key='archive_xcargs',
        flags=('--archive-xcargs',),
        type=str,
        description=(
            'Pass additional arguments to xcodebuild for the archive phase. '
            'For example `COMPILER_INDEX_STORE_ENABLE=NO OTHER_LDFLAGS="-ObjC -lstdc++`.'
        ),
        argparse_kwargs={'required': False, 'default': 'COMPILER_INDEX_STORE_ENABLE=NO'},
    )
    EXPORT_FLAGS = cli.ArgumentProperties(
        key='export_flags',
        flags=('--export-flags',),
        type=str,
        description=(
            'Pass additional command line options to xcodebuild for the exportArchive phase. '
            'For example `-derivedDataPath=$HOME/myDerivedData -quiet`.'
        ),
        argparse_kwargs={'required': False, 'default': ''},
    )
    EXPORT_XCARGS = cli.ArgumentProperties(
        key='export_xcargs',
        flags=('--export-xcargs',),
        type=str,
        description=(
            'Pass additional arguments to xcodebuild for the exportArchive phase. '
            'For example `COMPILER_INDEX_STORE_ENABLE=NO OTHER_LDFLAGS="-ObjC -lstdc++`.'
        ),
        argparse_kwargs={'required': False, 'default': 'COMPILER_INDEX_STORE_ENABLE=NO'},
    )
    TEST_FLAGS = cli.ArgumentProperties(
        key='test_flags',
        flags=('--test-flags',),
        type=str,
        description=(
            'Pass additional command line options to xcodebuild for the test phase. '
            'For example `-derivedDataPath=$HOME/myDerivedData -quiet`.'
        ),
        argparse_kwargs={'required': False, 'default': ''},
    )
    TEST_XCARGS = cli.ArgumentProperties(
        key='test_xcargs',
        flags=('--test-xcargs',),
        type=str,
        description=(
            'Pass additional arguments to xcodebuild for the test phase. '
            'For example `COMPILER_INDEX_STORE_ENABLE=NO OTHER_LDFLAGS="-ObjC -lstdc++`.'
        ),
        argparse_kwargs={'required': False, 'default': ''},
    )
Beispiel #25
0
class XcodeProjectArgument(cli.Argument):
    CLEAN = cli.ArgumentProperties(
        key='clean',
        flags=('--clean',),
        type=bool,
        description='Whether to clean the project before building it',
        argparse_kwargs={'required': False, 'action': 'store_true'},
    )
    JSON_OUTPUT = cli.ArgumentProperties(
        key='json_output',
        flags=('--json',),
        type=bool,
        description='Whether to show the resource in JSON format',
        argparse_kwargs={'required': False, 'action': 'store_true'},
    )
    XCODE_PROJECT_PATTERN = cli.ArgumentProperties(
        key='xcode_project_patterns',
        flags=('--project',),
        type=pathlib.Path,
        description=(
            'Path to Xcode project (*.xcodeproj). Can be either a path literal, or '
            'a glob pattern to match projects in working directory.'
        ),
        argparse_kwargs={
            'required': False,
            'default': (pathlib.Path('**/*.xcodeproj'),),
            'nargs': '+',
            'metavar': 'project-path'
        },
    )
    XCODE_PROJECT_PATH = cli.ArgumentProperties(
        key='xcode_project_path',
        flags=('--project',),
        type=cli.CommonArgumentTypes.existing_path,
        description='Path to Xcode project (*.xcodeproj)',
        argparse_kwargs={'required': False}
    )
    XCODE_WORKSPACE_PATH = cli.ArgumentProperties(
        key='xcode_workspace_path',
        flags=('--workspace',),
        type=cli.CommonArgumentTypes.existing_path,
        description='Path to Xcode workspace (*.xcworkspace)',
        argparse_kwargs={'required': False}
    )
    SCHEME_NAME = cli.ArgumentProperties(
        key='scheme_name',
        flags=('--scheme',),
        description='Name of the Xcode Scheme',
        argparse_kwargs={'required': False},
    )
    TARGET_NAME = cli.ArgumentProperties(
        key='target_name',
        flags=('--target',),
        description='Name of the Xcode Target',
        argparse_kwargs={'required': False},
    )
    CONFIGURATION_NAME = cli.ArgumentProperties(
        key='configuration_name',
        flags=('--config',),
        description='Name of the Xcode build configuration',
        argparse_kwargs={'required': False},
    )
    PROFILE_PATHS = cli.ArgumentProperties(
        key='profile_path_patterns',
        flags=('--profile',),
        type=pathlib.Path,
        description=(
            'Path to provisioning profile. Can be either a path literal, or '
            'a glob pattern to match provisioning profiles.'
        ),
        argparse_kwargs={
            'required': False,
            'nargs': '+',
            'metavar': 'profile-path',
            'default': (ProvisioningProfile.DEFAULT_LOCATION / '*.mobileprovision',),
        }
    )
Beispiel #26
0
class KeychainArgument(cli.Argument):
    PATH = cli.ArgumentProperties(
        flags=('-p', '--path'),
        key='path',
        type=pathlib.Path,
        description=('Keychain path. If not provided, the system default '
                     'keychain will be used instead'),
        argparse_kwargs={'required': False},
    )
    PASSWORD = cli.ArgumentProperties(
        flags=('-pw', '--password'),
        key='password',
        type=Password,
        description='Keychain password',
        argparse_kwargs={
            'required': False,
            'default': ''
        },
    )
    TIMEOUT = cli.ArgumentProperties(
        flags=('-t', '--timeout'),
        key='timeout',
        type=Seconds,
        description='Keychain timeout in seconds, defaults to no timeout',
        argparse_kwargs={
            'required': False,
            'default': None
        },
    )
    CERTIFICATE_PATHS = cli.ArgumentProperties(
        flags=('-c', '--certificate'),
        key='certificate_path_patterns',
        type=pathlib.Path,
        description=(
            'Path to pkcs12 certificate. Can be either a path literal, or '
            'a glob pattern to match certificates.'),
        argparse_kwargs={
            'required': False,
            'nargs': '+',
            'metavar': 'certificate-path',
            'default': (Certificate.DEFAULT_LOCATION / '*.p12', ),
        },
    )
    CERTIFICATE_PASSWORD = cli.ArgumentProperties(
        flags=('--certificate-password', ),
        key='certificate_password',
        type=Password,
        description='Encrypted p12 certificate password',
        argparse_kwargs={
            'required': False,
            'default': ''
        },
    )
    ALLOWED_APPLICATIONS = cli.ArgumentProperties(
        flags=('-a', '--allow-app'),
        key='allowed_applications',
        description=
        'Specify an application which may access the imported key without warning',
        type=pathlib.Path,
        argparse_kwargs={
            'required': False,
            'default': (pathlib.Path('codesign'), pathlib.Path('productsign')),
            'nargs': '+',
            'metavar': 'allowed-app',
        },
    )
    ALLOW_ALL_APPLICATIONS = cli.ArgumentProperties(
        flags=('-A', '--allow-all-applications'),
        key='allow_all_applications',
        type=bool,
        description=
        'Allow any application to access the imported key without warning',
        argparse_kwargs={
            'required': False,
            'action': 'store_true'
        },
    )
    DISALLOW_ALL_APPLICATIONS = cli.ArgumentProperties(
        flags=('-D', '--disallow-all-applications'),
        key='disallow_all_applications',
        type=bool,
        description=
        'Do not allow any applications to access the imported key without warning',
        argparse_kwargs={
            'required': False,
            'action': 'store_true'
        },
    )
Beispiel #27
0
class _TestArgument(cli.Argument):
    ARG1 = cli.ArgumentProperties(key='arg1', description='')
    ARG2 = cli.ArgumentProperties(key='arg2', description='')
    ARG3 = cli.ArgumentProperties(key='arg3', description='')
    ARG4 = cli.ArgumentProperties(key='arg4', description='')