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

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

Issue 197693002: [Android] Lint build/android/gyp/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: now using extra_paths_list to avoid F0401s Created 6 years, 9 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Writes .h files for NativeLibraries.template 7 """Writes .h files for NativeLibraries.template
8 8
9 The native library list header should contain the list of native libraries to 9 The native library list header should contain the list of native libraries to
10 load in the form: 10 load in the form:
11 = { "lib1", "lib2" } 11 = { "lib1", "lib2" }
12 The version header should contain a version name string of the form 12 The version header should contain a version name string of the form
13 = "version_name" 13 = "version_name"
14 """ 14 """
15 15
16 import json 16 import json
17 import optparse 17 import optparse
18 import os 18 import os
19 import sys 19 import sys
20 20
21 from util import build_utils 21 from util import build_utils
22 22
23 23
24 def main(argv): 24 def main():
25 parser = optparse.OptionParser() 25 parser = optparse.OptionParser()
26 26
27 parser.add_option('--native-library-list', 27 parser.add_option('--native-library-list',
28 help='Path to generated .java file containing library list') 28 help='Path to generated .java file containing library list')
29 parser.add_option('--version-output', 29 parser.add_option('--version-output',
30 help='Path to generated .java file containing version name') 30 help='Path to generated .java file containing version name')
31 parser.add_option('--ordered-libraries', 31 parser.add_option('--ordered-libraries',
32 help='Path to json file containing list of ordered libraries') 32 help='Path to json file containing list of ordered libraries')
33 parser.add_option('--version-name', 33 parser.add_option('--version-name',
34 help='expected version name of native library') 34 help='expected version name of native library')
35 35
36 # args should be the list of libraries in dependency order. 36 # args should be the list of libraries in dependency order.
37 options, _ = parser.parse_args() 37 options, _ = parser.parse_args()
38 38
39 build_utils.MakeDirectory(os.path.dirname(options.native_library_list)) 39 build_utils.MakeDirectory(os.path.dirname(options.native_library_list))
40 40
41 with open(options.ordered_libraries, 'r') as libfile: 41 with open(options.ordered_libraries, 'r') as libfile:
42 libraries = json.load(libfile) 42 libraries = json.load(libfile)
43 # Generates string of the form '= { "base", "net", 43 # Generates string of the form '= { "base", "net",
44 # "content_shell_content_view" }' from a list of the form ["libbase.so", 44 # "content_shell_content_view" }' from a list of the form ["libbase.so",
45 # libnet.so", "libcontent_shell_content_view.so"] 45 # libnet.so", "libcontent_shell_content_view.so"]
46 libraries = ['"' + lib[3:-3] + '"' for lib in libraries] 46 libraries = ['"' + lib[3:-3] + '"' for lib in libraries]
47 array = '= { ' + ', '.join(libraries) + '}'; 47 array = '= { ' + ', '.join(libraries) + '}'
48 48
49 with open(options.native_library_list, 'w') as header: 49 with open(options.native_library_list, 'w') as header:
50 header.write(array) 50 header.write(array)
51 51
52 with open(options.version_output, 'w') as header: 52 with open(options.version_output, 'w') as header:
53 header.write('= "%s"' % options.version_name) 53 header.write('= "%s"' % options.version_name)
54 54
55 if __name__ == '__main__': 55 if __name__ == '__main__':
56 sys.exit(main(sys.argv)) 56 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/gyp/create_device_library_links.py ('k') | build/android/gyp/create_standalone_apk.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698