10Create an updated VS toolchain
12Before you can run this script, you need a collated VC toolchain + Windows SDK.
13To generate that, run depot_tools/win_toolchain/package_from_installed.py
14That script pulls all of the compiler and SDK bits from your locally installed
15version of Visual Studio. The comments in that script include instructions on
16which components need to be installed (C++, ARM64, etc...)
18That script produces a .zip file with a SHA filename. Unzip that file, then
19pass the unzipped directory as the src_dir to this script.
23from __future__
import print_function
32ENV_VAR =
'WIN_TOOLCHAIN_SRC_DIR'
39 'App Certification Kit',
48 val = os.environ.get(key)
50 print((
'Environment variable %s not set; you should run this via '
51 'create_and_upload.py.' % key), file=sys.stderr)
57 """Callback for shutil.copytree. Return lists of files to skip."""
58 split = dirname.split(os.path.sep)
59 for ign
in IGNORE_LIST:
61 print(
'Ignoring dir %s' % dirname)
67 if sys.platform !=
'win32':
68 print(
'This script only runs on Windows.', file=sys.stderr)
71 parser = argparse.ArgumentParser()
72 parser.add_argument(
'--target_dir',
'-t', required=
True)
73 args = parser.parse_args()
79 target_dir = os.path.abspath(args.target_dir)
80 shutil.rmtree(target_dir)
81 shutil.copytree(src_dir, target_dir, ignore=filter_toolchain_files)
84if __name__ ==
'__main__':
def print(*args, **kwargs)