Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions | Variables
win_toolchain.create Namespace Reference

Functions

 getenv (key)
 
 filter_toolchain_files (dirname, files)
 
 main ()
 

Variables

str ENV_VAR = 'WIN_TOOLCHAIN_SRC_DIR'
 
list IGNORE_LIST
 

Detailed Description

Create an updated VS toolchain

Before you can run this script, you need a collated VC toolchain + Windows SDK.
To generate that, run depot_tools/win_toolchain/package_from_installed.py
That script pulls all of the compiler and SDK bits from your locally installed
version of Visual Studio. The comments in that script include instructions on
which components need to be installed (C++, ARM64, etc...)

That script produces a .zip file with a SHA filename. Unzip that file, then
pass the unzipped directory as the src_dir to this script.

Function Documentation

◆ filter_toolchain_files()

win_toolchain.create.filter_toolchain_files (   dirname,
  files 
)
Callback for shutil.copytree. Return lists of files to skip.

Definition at line 56 of file create.py.

56def filter_toolchain_files(dirname, files):
57 """Callback for shutil.copytree. Return lists of files to skip."""
58 split = dirname.split(os.path.sep)
59 for ign in IGNORE_LIST:
60 if ign in split:
61 print('Ignoring dir %s' % dirname)
62 return files
63 return []
64
65
void print(void *str)
Definition bridge.cpp:126

◆ getenv()

win_toolchain.create.getenv (   key)

Definition at line 47 of file create.py.

47def getenv(key):
48 val = os.environ.get(key)
49 if not val:
50 print(('Environment variable %s not set; you should run this via '
51 'create_and_upload.py.' % key), file=sys.stderr)
52 sys.exit(1)
53 return val
54
55

◆ main()

win_toolchain.create.main ( )

Definition at line 66 of file create.py.

66def main():
67 if sys.platform != 'win32':
68 print('This script only runs on Windows.', file=sys.stderr)
69 sys.exit(1)
70
71 parser = argparse.ArgumentParser()
72 parser.add_argument('--target_dir', '-t', required=True)
73 args = parser.parse_args()
74
75 # Obtain src_dir from create_and_upload via an environment variable, since
76 # this script is called via `sk` and not directly.
77 src_dir = getenv(ENV_VAR)
78
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)
82
83
Definition main.py:1

Variable Documentation

◆ ENV_VAR

str win_toolchain.create.ENV_VAR = 'WIN_TOOLCHAIN_SRC_DIR'

Definition at line 32 of file create.py.

◆ IGNORE_LIST

list win_toolchain.create.IGNORE_LIST
Initial value:
1= [
2 'WindowsMobile',
3 'App Certification Kit',
4 'Debuggers',
5 'Extension SDKs',
6 'DesignTime',
7 'AccChecker',
8]

Definition at line 37 of file create.py.