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

Unified Diff: build/android/gyp/create_native_libraries_header.py

Issue 59533009: Check library version and handle library load errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix BrowserStartupControllerTest Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/findbugs_filter/findbugs_exclude.xml ('k') | build/java_apk.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/create_native_libraries_header.py
diff --git a/build/android/gyp/create_native_libraries_header.py b/build/android/gyp/create_native_libraries_header.py
index 5c1bf1b6a333f4197698e5abd4a41e635f26c879..a906439ad183e029169df9d3c8eff65b2dfda7d6 100755
--- a/build/android/gyp/create_native_libraries_header.py
+++ b/build/android/gyp/create_native_libraries_header.py
@@ -4,10 +4,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Writes .h file for NativeLibraries.template
+"""Writes .h files for NativeLibraries.template
-This header should contain the list of native libraries to load in the form:
+The native library list header should contain the list of native libraries to
+load in the form:
= { "lib1", "lib2" }
+The version header should contain a version name string of the form
+ = "version_name"
"""
import json
@@ -21,15 +24,19 @@ from util import build_utils
def main(argv):
parser = optparse.OptionParser()
- parser.add_option('--output', help='Path to generated .java file')
+ parser.add_option('--native-library-list',
+ help='Path to generated .java file containing library list')
+ parser.add_option('--version-output',
+ help='Path to generated .java file containing version name')
parser.add_option('--ordered-libraries',
help='Path to json file containing list of ordered libraries')
- parser.add_option('--stamp', help='Path to touch on success')
+ parser.add_option('--version-name',
+ help='expected version name of native library')
# args should be the list of libraries in dependency order.
options, _ = parser.parse_args()
- build_utils.MakeDirectory(os.path.dirname(options.output))
+ build_utils.MakeDirectory(os.path.dirname(options.native_library_list))
with open(options.ordered_libraries, 'r') as libfile:
libraries = json.load(libfile)
@@ -39,12 +46,11 @@ def main(argv):
libraries = ['"' + lib[3:-3] + '"' for lib in libraries]
array = '= { ' + ', '.join(libraries) + '}';
- with open(options.output, 'w') as header:
+ with open(options.native_library_list, 'w') as header:
header.write(array)
- if options.stamp:
- build_utils.Touch(options.stamp)
-
+ with open(options.version_output, 'w') as header:
+ header.write('= "%s"' % options.version_name)
if __name__ == '__main__':
sys.exit(main(sys.argv))
« no previous file with comments | « build/android/findbugs_filter/findbugs_exclude.xml ('k') | build/java_apk.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698