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

Side by Side Diff: build/android/gyp/create_native_libraries_header.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 | « build/android/gyp/create_device_library_links.py ('k') | build/android/gyp/gcc_preprocess.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 2013 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 """Writes .h files for NativeLibraries.template
8
9 The native library list header should contain the list of native libraries to
10 load in the form:
11 = { "lib1", "lib2" }
12 The version header should contain a version name string of the form
13 = "version_name"
14 """
15
16 import json
17 import optparse
18 import os
19 import sys
20
21 from util import build_utils
22
23
24 def main():
25 parser = optparse.OptionParser()
26
27 parser.add_option('--native-library-list',
28 help='Path to generated .java file containing library list')
29 parser.add_option('--version-output',
30 help='Path to generated .java file containing version name')
31 parser.add_option('--ordered-libraries',
32 help='Path to json file containing list of ordered libraries')
33 parser.add_option('--version-name',
34 help='expected version name of native library')
35
36 # args should be the list of libraries in dependency order.
37 options, _ = parser.parse_args()
38
39 build_utils.MakeDirectory(os.path.dirname(options.native_library_list))
40
41 with open(options.ordered_libraries, 'r') as libfile:
42 libraries = json.load(libfile)
43 # Generates string of the form '= { "base", "net",
44 # "content_shell_content_view" }' from a list of the form ["libbase.so",
45 # libnet.so", "libcontent_shell_content_view.so"]
46 libraries = ['"' + lib[3:-3] + '"' for lib in libraries]
47 array = '= { ' + ', '.join(libraries) + '}'
48
49 with open(options.native_library_list, 'w') as header:
50 header.write(array)
51
52 with open(options.version_output, 'w') as header:
53 header.write('= "%s"' % options.version_name)
54
55 if __name__ == '__main__':
56 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/gyp/create_device_library_links.py ('k') | build/android/gyp/gcc_preprocess.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698