def AddCustomArguments(self, parser: argparse.ArgumentParser, toolConfig: ToolConfig, userTag: Optional[object]) -> None: packageTypes = PackageType.AllStrings() packageTypes.sort() #parser.add_argument('--graph', action='store_true', help='Generate a dependency graph using dot (requires the graphviz dot executable in path)') parser.add_argument( '--IgnoreNotSupported', action='store_true', help='try to build things that are marked as not supported') parser.add_argument('--ListBuildVariants', action='store_true', help='List all build-variants') parser.add_argument('--ListExtensions', action='store_true', help='List all extensions') parser.add_argument('--ListFeatures', action='store_true', help='List all features supported by build') parser.add_argument('--ListVariants', action='store_true', help='List all used variants') parser.add_argument('--ListRecipes', action='store_true', help='List all known recipes') parser.add_argument('--ListRequirements', action='store_true', help='List all requirements') parser.add_argument('--stats', action='store_true', help='Show stats') parser.add_argument('-t', '--type', default=DefaultValue.PackageConfigurationType, choices=[PluginSharedValues.TYPE_DEFAULT, 'sdk'], help='Select generator type') parser.add_argument( '--SaveJson', default=DefaultValue.SaveJson, help='Save package information to the given json output file') parser.add_argument( '--IncludeGeneratorReport', action='store_true', help= 'If set we include the generator report if available when saving to json' ) # filtering parser.add_argument( '--PackageType', default=DefaultValue.PackageTypeList, help= "The list of package types that will be saved [{0}]. For example [Executable] to save all packages of the 'Executable' type." .format(', '.join(packageTypes)))
def ParsePackageTypeList(strPackageTypeList: str) -> List[str]: parsedList = ParseList(strPackageTypeList, "packageType", True) if not '*' in parsedList: validPackageTypes = PackageType.AllStrings() for entry in parsedList: if entry not in validPackageTypes: raise Exception( "The package type list must be valid, the package type '{0}' is not, valid types {1}" .format(entry, validPackageTypes)) return parsedList