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

Unified Diff: runtime/tools/gen_library_src_paths.py

Issue 1449163003: - Include sources in gen_snapshot and dart_no_snapshot to allow (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Simplify logic. Created 5 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 | « runtime/lib/libgen_in.cc ('k') | runtime/vm/bootstrap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/tools/gen_library_src_paths.py
diff --git a/runtime/tools/gen_library_src_paths.py b/runtime/tools/gen_library_src_paths.py
index 27512150115c32de51e946546b2de1e0dd0d44cb..749c9d1d9b97eb1da2e862c8bf9b4d5c0e76ede4 100644
--- a/runtime/tools/gen_library_src_paths.py
+++ b/runtime/tools/gen_library_src_paths.py
@@ -13,6 +13,20 @@ from os.path import join
from optparse import OptionParser
+def makeString(input_file):
+ result = '"'
+ fileHandle = open(input_file, 'rb')
+ lineCounter = 0
+ for byte in fileHandle.read():
+ result += '\\x%02x' % ord(byte)
+ lineCounter += 1
+ if lineCounter == 19:
+ result += '"\n "'
+ lineCounter = 0
+ result += '"'
+ return result
+
+
def makeFile(output_file, input_cc_file, include, var_name, lib_name, in_files):
part_index = [ ]
bootstrap_cc_text = open(input_cc_file).read()
@@ -29,15 +43,17 @@ def makeFile(output_file, input_cc_file, include, var_name, lib_name, in_files):
main_file_found = True
bootstrap_cc_text = bootstrap_cc_text.replace(
"{{LIBRARY_SOURCE_MAP}}",
- ' "' + lib_name + '", "' +
- os.path.abspath(string_file).replace('\\', '\\\\') + '", \n')
+ ' "' + lib_name + '",\n "' +
+ os.path.abspath(string_file).replace('\\', '\\\\') + '",\n' +
+ ' ' + makeString(string_file) + ',\n')
inpt.close()
if (main_file_found):
continue
part_index.append(' "' +
- os.path.basename(string_file).replace('\\', '\\\\') + '", ')
- part_index.append('"' +
- os.path.abspath(string_file).replace('\\', '\\\\') + '", \n')
+ os.path.basename(string_file).replace('\\', '\\\\') + '",\n')
+ part_index.append(' "' +
+ os.path.abspath(string_file).replace('\\', '\\\\') + '",\n')
+ part_index.append(' ' + makeString(string_file) + ',\n\n')
bootstrap_cc_text = bootstrap_cc_text.replace("{{LIBRARY_SOURCE_MAP}}", '')
bootstrap_cc_text = bootstrap_cc_text.replace("{{PART_SOURCE_MAP}}",
''.join(part_index))
« no previous file with comments | « runtime/lib/libgen_in.cc ('k') | runtime/vm/bootstrap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698