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 .
This commit is contained in:
John McCutchan 2015-08-27 11:14:13 -07:00
parent 42f32322cb
commit 021d7c0aa5
3 changed files with 22 additions and 5 deletions

View file

@ -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)',

View file

@ -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

View file

@ -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):