Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
dist_dart_pkg.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2#
3# Copyright 2013 The Flutter Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7"""Copy a Dart package into a directory suitable for release."""
8
9import argparse
10import os
11import shutil
12import sys
13
14
15def main():
16 parser = argparse.ArgumentParser(description='Copy a Dart package')
17
18 parser.add_argument('--source', type=str, help='Source directory assembled by dart_pkg.py')
19 parser.add_argument('--dest', type=str, help='Destination directory for the package')
20
21 args = parser.parse_args()
22
23 if os.path.exists(args.dest):
24 shutil.rmtree(args.dest)
25
26 # dart_pkg.py will create a packages directory within the package.
27 # Do not copy this into the release output.
28 shutil.copytree(args.source, args.dest, ignore=shutil.ignore_patterns('packages'))
29
30
31if __name__ == '__main__':
32 sys.exit(main())
Definition main.py:1