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

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

Issue 12939021: Make the build control what library(/ies) to load (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@antpy
Patch Set: Fix webview build Created 7 years, 8 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
(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
joth 2013/04/01 18:46:37 add either a file or main() function comment expla
cjhopman 2013/04/01 20:11:14 Done.
7 import json
8 import optparse
9 import os
10 import sys
11
12 from pylib import build_utils
13
14
15 def main(argv):
16 parser = optparse.OptionParser()
17
18 parser.add_option('--output', help='Path to generated .java file')
19 parser.add_option('--ordered-libraries',
20 help='Path to json file containing list of ordered libraries')
21 parser.add_option('--stamp', help='Path to touch on success')
22
23 # args should be the list of libraries in dependency order.
24 options, _ = parser.parse_args()
25
26 build_utils.MakeDirectory(os.path.dirname(options.output))
27
28 with open(options.ordered_libraries, 'r') as libfile:
29 libraries = json.load(libfile)
30 # Generates string of the form '= { "base", "net",
31 # "content_shell_content_view" }' from a list of the form ["libbase.so",
32 # libnet.so", "libcontent_shell_content_view.so"]
33 libraries = ['"' + lib[3:-3] + '"' for lib in libraries]
34 array = '= { ' + ', '.join(libraries) + '}';
35
36 with open(options.output, 'w') as header:
37 header.write(array)
38
39 if options.stamp:
40 build_utils.Touch(options.stamp)
41
42
43 if __name__ == '__main__':
44 sys.exit(main(sys.argv))
45
46
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698