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