Mercurial > vim-crosoft
view scripts/build_sln_cache.py @ 15:cfcac4ed7d21 default tip
Improve loading of solution files
- New argument to force a rebuild of the cache
- Gracefully handle missing projects in a solution
- Handle more different xml namespaces
- Support more edge cases
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 29 Aug 2023 12:59:54 -0700 |
parents | 5d2c0db51914 |
children |
line wrap: on
line source
import os.path import logging import argparse from vsutil import SolutionCache def main(): parser = argparse.ArgumentParser() parser.add_argument('solution', help="The path to the solution file") parser.add_argument('cache', help="The path to the cache file") parser.add_argument('-v', '--verbose', action='store_true') args = parser.parse_args() loglevel = logging.INFO if args.verbose: loglevel = logging.DEBUG logging.basicConfig(level=loglevel) logger = logging.getLogger() cache, loaded = SolutionCache.load_or_rebuild(args.solution, args.cache) if not loaded: total_items = sum([len(i) for i in cache.index.values()]) logger.debug(f"Built cache with {total_items} items.") if __name__ == '__main__': main()