Implement nacl_irt_memory for non-sfi mode.
[chromium-blink-merge.git] / chrome / test / chromedriver / embed_version_in_cpp.py
blob2c452b8d11142d1a95139a3f1cf00b49befee273
1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 """Embeds Chrome user data files in C++ code."""
8 import optparse
9 import os
10 import sys
12 import chrome_paths
13 import cpp_source
15 sys.path.insert(0, os.path.join(chrome_paths.GetSrc(), 'build', 'util'))
16 import lastchange
19 def main():
20 parser = optparse.OptionParser()
21 parser.add_option('', '--version-file')
22 parser.add_option(
23 '', '--directory', type='string', default='.',
24 help='Path to directory where the cc/h file should be created')
25 options, args = parser.parse_args()
27 version = open(options.version_file, 'r').read().strip()
28 revision = lastchange.FetchVersionInfo(None).revision
29 if revision:
30 version += '.' + revision.strip()
32 global_string_map = {
33 'kChromeDriverVersion': version
35 cpp_source.WriteSource('version',
36 'chrome/test/chromedriver',
37 options.directory, global_string_map)
40 if __name__ == '__main__':
41 sys.exit(main())