From 021d7c0aa539c47d868749f6cf1a8aa538f8b19f Mon Sep 17 00:00:00 2001 From: John McCutchan Date: Thu, 27 Aug 2015 11:14:13 -0700 Subject: [PATCH] Make build incremental - Make sure observatory's index.html is touched. - Switch generate_snapshot_bin to have only one output (a timestamp file) Fixes #24220 R=iposva@google.com, ricow@google.com Review URL: https://codereview.chromium.org//1304953004 . --- runtime/bin/bin.gypi | 10 +++++----- runtime/tools/create_snapshot_bin.py | 15 +++++++++++++++ tools/observatory_tool.py | 2 ++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/runtime/bin/bin.gypi b/runtime/bin/bin.gypi index 3637a4f40ef..dfe9a74698b 100644 --- a/runtime/bin/bin.gypi +++ b/runtime/bin/bin.gypi @@ -13,6 +13,7 @@ 'snapshot_in_cc_file': 'snapshot_in.cc', 'vm_isolate_snapshot_bin_file': '<(gen_source_dir)/vm_isolate_snapshot_gen.bin', 'isolate_snapshot_bin_file': '<(gen_source_dir)/isolate_snapshot_gen.bin', + 'gen_snapshot_stamp_file': '<(gen_source_dir)/gen_snapshot.stamp', 'resources_cc_file': '<(gen_source_dir)/resources_gen.cc', 'bootstrap_resources_cc_file': '<(gen_source_dir)/bootstrap_resources_gen.cc', @@ -420,8 +421,7 @@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen_snapshot<(EXECUTABLE_SUFFIX)', ], 'outputs': [ - '<(vm_isolate_snapshot_bin_file)', - '<(isolate_snapshot_bin_file)', + '<(gen_snapshot_stamp_file)', ], 'action': [ 'python', @@ -430,7 +430,8 @@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen_snapshot<(EXECUTABLE_SUFFIX)', '--vm_output_bin', '<(vm_isolate_snapshot_bin_file)', '--output_bin', '<(isolate_snapshot_bin_file)', - '--target_os', '<(OS)' + '--target_os', '<(OS)', + '--timestamp_file', '<(gen_snapshot_stamp_file)', ], 'message': 'Generating ''<(vm_isolate_snapshot_bin_file)'' ''<(isolate_snapshot_bin_file)'' files.' }, @@ -449,9 +450,8 @@ 'action_name': 'generate_snapshot_file', 'inputs': [ '../tools/create_snapshot_file.py', + '<(gen_snapshot_stamp_file)', '<(snapshot_in_cc_file)', - '<(vm_isolate_snapshot_bin_file)', - '<(isolate_snapshot_bin_file)', ], 'outputs': [ '<(snapshot_cc_file)', diff --git a/runtime/tools/create_snapshot_bin.py b/runtime/tools/create_snapshot_bin.py index 19c29434b77..b91de38e863 100755 --- a/runtime/tools/create_snapshot_bin.py +++ b/runtime/tools/create_snapshot_bin.py @@ -52,6 +52,10 @@ def BuildOptions(): result.add_option("--abi", action="store", type="string", help="Desired ABI for android target OS. armeabi-v7a or x86") + result.add_option("--timestamp_file", + action="store", type="string", + help="Path to timestamp file that will be written", + default="") return result @@ -71,6 +75,14 @@ def ProcessOptions(options): return True +def CreateTimestampFile(options): + if options.timestamp_file != '': + dir_name = os.path.dirname(options.timestamp_file) + if not os.path.exists(dir_name): + os.mkdir(dir_name) + open(options.timestamp_file, 'w').close() + + def Main(): # Parse options. parser = BuildOptions() @@ -113,6 +125,9 @@ def Main(): except Exception as e: return -1 + # Success, update timestamp file. + CreateTimestampFile(options) + return 0 diff --git a/tools/observatory_tool.py b/tools/observatory_tool.py index fab21834b42..66261438f1c 100755 --- a/tools/observatory_tool.py +++ b/tools/observatory_tool.py @@ -96,6 +96,8 @@ def PubBuild(dart_executable, pub_executable, pkg_root, silent, output_dir): def Deploy(input_dir, output_dir): shutil.rmtree(output_dir) shutil.copytree(input_dir, output_dir, ignore=IGNORE_PATTERNS) + index_file = os.path.join(output_dir, 'web', 'index.html') + os.utime(index_file, None) return 0 def RewritePubSpec(input_path, output_path, search, replace):