Flutter Engine
The Flutter Engine
Functions | Variables
win_toolchain.create Namespace Reference

Functions

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

Variables

string ENV_VAR = 'WIN_TOOLCHAIN_SRC_DIR'
 
list IGNORE_LIST
 

Function Documentation

◆ filter_toolchain_files()

def 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
def print(*args, **kwargs)
Definition: run_tests.py:49
def filter_toolchain_files(dirname, files)
Definition: create.py:56

◆ getenv()

def 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
def getenv(key)
Definition: create.py:47

◆ main()

def 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

Variable Documentation

◆ ENV_VAR

string 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.