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

Side by Side Diff: build_tools/write_res_index.py

Issue 1000163003: Generate the icu data binaries at compile time instead of checking in binaries Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: Fixed warnings in cross compiling Created 5 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
« no previous file with comments | « build_tools/write_icupkg_inc.py ('k') | gn_data_build_system/BUILD.gn » ('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 """Writes a res_index.txt file listing all locales (resources) that
2 are included. This matches a half dozen "echo" blocks in the
3 Makefiles."""
4
5 from __future__ import print_function
6
7 import argparse
8 import os
9
10 def change_ext(path, new_ext):
11 return os.path.splitext(path)[0] + new_ext
12
13 def main():
14 parser = argparse.ArgumentParser(
15 description=("Generates a resindex.txt file to be compiled by icu."))
16
17 parser.add_argument("--outfile",
18 required=True,
19 help="File that will contain the ICU resource text.")
20
21 parser.add_argument("--cldr-version",
22 help="The CLDR version. Optional")
23
24 parser.add_argument("files",
25 nargs='*',
26 help=("Files to be included in the list. " +
27 "Can include paths (that will be ignored)"))
28
29 args = parser.parse_args()
30
31 with open(args.outfile, "w") as out:
32 out.write("// Warning this file is automatically generated\n")
33 out.write("res_index:table(nofallback) {\n")
34 if args.cldr_version:
35 out.write(" CLDRVersion { \"%s\" }\n" % args.cldr_version)
36 out.write(" InstalledLocales {\n")
37 for filename in args.files:
38 out.write(" %s {\"\"}\n" %
39 change_ext(os.path.basename(filename), ""))
40 out.write(" }\n")
41 out.write("}\n")
42
43 if __name__ == "__main__":
44 main()
OLDNEW
« no previous file with comments | « build_tools/write_icupkg_inc.py ('k') | gn_data_build_system/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698