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

Side by Side Diff: tools/dartium/generate_dart_vm_version.py

Issue 244643006: Migrate dartium_tools from chrome branch to dart repo (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « tools/dartium/fetch_reference_build.py ('k') | tools/dartium/get_chromium_build.py » ('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 import datetime
2 import imp
3 import os
4 import subprocess
5 import sys
6 import time
7
8 scriptpath = os.path.abspath(os.path.dirname(__file__))
9 utils = imp.load_source('utils', os.path.join(scriptpath, '..', 'utils.py'))
10
11 REVISION_FILE = 'src/chrome/browser/ui/webui/dartvm_revision.h'
12 EXPIRATION_FILE = 'src/third_party/WebKit/Source/bindings/dart/ExpirationTimeSec sSinceEpoch.time_t'
13
14 def updateFile(filename, content):
15 if os.path.exists(filename):
16 if file(filename, 'r').read() == content:
17 return
18 else:
19 dir = os.path.dirname(filename)
20 if not os.path.exists(dir):
21 os.makedirs(dir)
22 file(filename, 'w').write(content)
23
24 def main():
25 dart_version = utils.GetVersion()
26 version_string = '#define DART_VM_REVISION "%s"\n' % dart_version.strip()
27
28 updateFile(REVISION_FILE, version_string)
29
30 expiration_date = datetime.date.today() + datetime.timedelta(weeks=12)
31 updateFile(EXPIRATION_FILE,
32 "%dLL\n" % time.mktime(expiration_date.timetuple()))
33
34 if __name__ == '__main__':
35 main()
OLDNEW
« no previous file with comments | « tools/dartium/fetch_reference_build.py ('k') | tools/dartium/get_chromium_build.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698