OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2015 The Chromium Authors. All rights reserved. | 3 # Copyright 2015 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 # Generates a Java file with API keys. | 7 # Generates a Java file with API keys. |
8 | 8 |
9 import argparse | 9 import argparse |
10 import os | 10 import os |
11 import string | 11 import string |
12 import sys | 12 import sys |
13 import zipfile | 13 import zipfile |
14 | 14 |
15 from util import build_utils | 15 from util import build_utils |
16 | 16 |
17 sys.path.append( | 17 sys.path.append( |
18 os.path.abspath(os.path.join(sys.path[0], '../../../google_apis'))) | 18 os.path.abspath(os.path.join(sys.path[0], '../../../google_apis'))) |
19 import google_api_keys | 19 import google_api_keys |
20 | 20 |
21 sys.path.append(os.path.abspath(os.path.join( | 21 sys.path.append(os.path.abspath(os.path.join( |
22 os.path.dirname(__file__), os.pardir))) | 22 os.path.dirname(__file__), os.pardir))) |
23 from pylib import constants | 23 from pylib.constants import host_paths |
24 | 24 |
25 | 25 |
26 PACKAGE = 'org.chromium.chrome' | 26 PACKAGE = 'org.chromium.chrome' |
27 CLASSNAME = 'GoogleAPIKeys' | 27 CLASSNAME = 'GoogleAPIKeys' |
28 | 28 |
29 | 29 |
30 def GetScriptName(): | 30 def GetScriptName(): |
31 return os.path.relpath(__file__, constants.DIR_SOURCE_ROOT) | 31 return os.path.relpath(__file__, host_paths.DIR_SOURCE_ROOT) |
32 | 32 |
33 | 33 |
34 def GenerateOutput(constant_definitions): | 34 def GenerateOutput(constant_definitions): |
35 template = string.Template(""" | 35 template = string.Template(""" |
36 // Copyright 2015 The Chromium Authors. All rights reserved. | 36 // Copyright 2015 The Chromium Authors. All rights reserved. |
37 // Use of this source code is governed by a BSD-style license that can be | 37 // Use of this source code is governed by a BSD-style license that can be |
38 // found in the LICENSE file. | 38 // found in the LICENSE file. |
39 | 39 |
40 // This file is autogenerated by | 40 // This file is autogenerated by |
41 // ${SCRIPT_NAME} | 41 // ${SCRIPT_NAME} |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 if options.out: | 121 if options.out: |
122 _DoWriteJavaOutput(options.out, values) | 122 _DoWriteJavaOutput(options.out, values) |
123 if options.srcjar: | 123 if options.srcjar: |
124 _DoWriteJarOutput(options.srcjar, values) | 124 _DoWriteJarOutput(options.srcjar, values) |
125 | 125 |
126 | 126 |
127 if __name__ == '__main__': | 127 if __name__ == '__main__': |
128 _DoMain(sys.argv[1:]) | 128 _DoMain(sys.argv[1:]) |
129 | 129 |
OLD | NEW |