mirror of
https://github.com/dart-lang/sdk
synced 2024-07-21 02:14:37 +00:00
Add timestamp to AppCache manifest.
R=kustermann@google.com Review URL: https://codereview.chromium.org//139513003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31888 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
0756822812
commit
72f491a131
22
site/try/add_time_stamp.py
Normal file
22
site/try/add_time_stamp.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env python
|
||||
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
||||
# for details. All rights reserved. Use of this source code is governed by a
|
||||
# BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import datetime
|
||||
import sys
|
||||
|
||||
def Main():
|
||||
(_, input_file_name, output_file_name) = sys.argv
|
||||
if not input_file_name or not output_file_name:
|
||||
raise Exception('Missing argument')
|
||||
|
||||
timestamp = str(datetime.datetime.now())
|
||||
|
||||
with open(input_file_name, 'r') as input_file:
|
||||
with open(output_file_name, 'w') as output_file:
|
||||
output_file.write(input_file.read().replace('@@TIMESTAMP@@', timestamp))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(Main())
|
|
@ -12,6 +12,24 @@
|
|||
# Concern: there should really be a dependency on
|
||||
# ../../dart.gyp:create_sdk, but this is reported as a cycle by GYP.
|
||||
],
|
||||
'variables': {
|
||||
'try_dart_static_files': [
|
||||
'index.html',
|
||||
'dartlang-style.css',
|
||||
'iframe.html',
|
||||
'iframe.js',
|
||||
'dart-icon.png',
|
||||
'dart-iphone5.png',
|
||||
|
||||
'../../third_party/font-awesome/font-awesome-4.0.3/'
|
||||
'fonts/fontawesome-webfont.woff',
|
||||
|
||||
'../../sdk/lib/_internal/dartdoc/static/favicon.ico',
|
||||
|
||||
'<(SHARED_INTERMEDIATE_DIR)/leap.dart.js',
|
||||
'<(SHARED_INTERMEDIATE_DIR)/sdk.json',
|
||||
],
|
||||
},
|
||||
'actions': [
|
||||
{
|
||||
'action_name': 'sdk_json',
|
||||
|
@ -62,6 +80,26 @@
|
|||
'-o<(SHARED_INTERMEDIATE_DIR)/leap.dart.js',
|
||||
],
|
||||
},
|
||||
{
|
||||
'action_name': 'nossl_appcache',
|
||||
'message': 'Creating nossl.appcache',
|
||||
'inputs': [
|
||||
'add_time_stamp.py',
|
||||
'nossl.appcache',
|
||||
'<@(try_dart_static_files)',
|
||||
],
|
||||
'outputs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/nossl.appcache',
|
||||
],
|
||||
# Try Dart! uses AppCache. Cached files are only validated when the
|
||||
# manifest changes (not its timestamp, but its actual contents).
|
||||
'action': [
|
||||
'python',
|
||||
'add_time_stamp.py',
|
||||
'nossl.appcache',
|
||||
'<(SHARED_INTERMEDIATE_DIR)/nossl.appcache',
|
||||
],
|
||||
},
|
||||
],
|
||||
'copies': [
|
||||
{
|
||||
|
@ -70,22 +108,8 @@
|
|||
# List of files to be copied (creates implicit build dependencies).
|
||||
'files': [
|
||||
'app.yaml',
|
||||
|
||||
'nossl.appcache',
|
||||
'index.html',
|
||||
'dartlang-style.css',
|
||||
'iframe.html',
|
||||
'iframe.js',
|
||||
'dart-icon.png',
|
||||
'dart-iphone5.png',
|
||||
|
||||
'../../third_party/font-awesome/font-awesome-4.0.3/'
|
||||
'fonts/fontawesome-webfont.woff',
|
||||
|
||||
'../../sdk/lib/_internal/dartdoc/static/favicon.ico',
|
||||
|
||||
'<(SHARED_INTERMEDIATE_DIR)/leap.dart.js',
|
||||
'<(SHARED_INTERMEDIATE_DIR)/sdk.json',
|
||||
'<@(try_dart_static_files)',
|
||||
'<(SHARED_INTERMEDIATE_DIR)/nossl.appcache',
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
|
@ -3,7 +3,7 @@ CACHE MANIFEST
|
|||
# for details. All rights reserved. Use of this source code is governed by a
|
||||
# BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
# Version 7.1 <-- CHANGE THIS when you have a new version
|
||||
# @@TIMESTAMP@@
|
||||
|
||||
CACHE:
|
||||
index.html
|
||||
|
|
Loading…
Reference in a new issue