Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: build/android/gyp/copy_ex.py

Issue 456493002: Add native libraries to gn apks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/base.gyp ('k') | build/android/gyp/create_device_library_links.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 #
3 # Copyright 2014 The Chromium 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 files to a directory."""
8
9 import optparse
10 import shutil
11 import sys
12
13 from util import build_utils
14
15
16 def main(args):
17 args = build_utils.ExpandFileArgs(args)
18
19 parser = optparse.OptionParser()
20 build_utils.AddDepfileOption(parser)
21
22 parser.add_option('--dest', help='Directory to copy files to.')
23 parser.add_option('--files', action='append',
24 help='List of files to copy.')
25 parser.add_option('--clear', action='store_true',
26 help='If set, the destination directory will be deleted '
27 'before copying files to it. This is highly recommended to '
28 'ensure that no stale files are left in the directory.')
29 parser.add_option('--stamp', help='Path to touch on success.')
30
31 options, _ = parser.parse_args(args)
32
33 if options.clear:
34 build_utils.DeleteDirectory(options.dest)
35 build_utils.MakeDirectory(options.dest)
36
37 files = []
38 for file_arg in options.files:
39 files += build_utils.ParseGypList(file_arg)
40
41 for f in files:
42 shutil.copy(f, options.dest)
43
44 if options.depfile:
45 build_utils.WriteDepfile(
46 options.depfile,
47 options.files + build_utils.GetPythonDependencies())
48
49 if options.stamp:
50 build_utils.Touch(options.stamp)
51
52
53 if __name__ == '__main__':
54 sys.exit(main(sys.argv[1:]))
55
OLDNEW
« no previous file with comments | « base/base.gyp ('k') | build/android/gyp/create_device_library_links.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698