Flutter Engine
The Flutter Engine
android_artifacts.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"""Copies and renames android artifacts."""
8
9import argparse
10import os
11import shutil
12import sys
13
14
15def cp_files(args):
16 """Copies files from source to destination.
17
18 It creates the destination folder if it does not exists yet.
19 """
20 for src, dst in args.input_pairs:
21 os.makedirs(os.path.dirname(dst), exist_ok=True)
22 shutil.copyfile(src, dst)
23
24
25def main():
26 parser = argparse.ArgumentParser()
27 parser.add_argument(
28 '-i',
29 dest='input_pairs',
30 nargs=2,
31 action='append',
32 help='The input file and its destination.'
33 )
34 cp_files(parser.parse_args())
35 return 0
36
37
38if __name__ == '__main__':
39 sys.exit(main())
Definition: main.py:1