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

Side by Side Diff: frog/tip/create_fftip.py

Issue 8889031: move tip to utils so it can be picked up in the SDK (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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 | « frog/tip/copy_libs.py ('k') | frog/tip/dart128.png » ('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 #!/usr/local/evn python
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file.
5
6 # This is a first stab at creating a Firefox extension which can run Dart
7 # code by using frog's in-browser compilation. This is a minimal attempt,
8 # with a UI that needs a total gutting, but it gets things start in Firefox.
9 # Over time, I hope that Dart in FF becomes a really nice development path.
10
11 # This script first calls copy_libs.py to get the libs staged correctly.
12
13 import os
14 import shutil
15 import fileinput
16 import re
17 import subprocess
18 import sys
19
20 TIP_PATH = os.path.dirname(os.path.abspath(__file__))
21 FROG_PATH = os.path.dirname(TIP_PATH)
22 LIB_PATH = os.path.join(FROG_PATH, 'lib')
23 FFTIP_PATH = os.path.join(TIP_PATH, 'fftip')
24 FFTIP_CONTENT_PATH = os.path.join(FFTIP_PATH, 'chrome', 'content')
25 FFTIP_LIB_PATH = os.path.join(FFTIP_CONTENT_PATH, 'lib')
26 FFTIP_XPI = os.path.join(TIP_PATH, 'fftip.xpi')
27
28 def main():
29 subprocess.call([sys.executable, './copy_libs.py'])
30 if (os.path.exists(FFTIP_LIB_PATH)):
31 shutil.rmtree(FFTIP_LIB_PATH)
32 if (os.path.exists(FFTIP_XPI)):
33 os.remove(FFTIP_XPI)
34 shutil.copytree(LIB_PATH, FFTIP_LIB_PATH,
35 ignore=shutil.ignore_patterns('.svn'))
36
37 for file in os.listdir(TIP_PATH):
38 if (file.endswith('.css') or file.endswith('.gif') or
39 file.endswith('.html') or file.endswith('.js')):
40 shutil.copy(file, FFTIP_CONTENT_PATH)
41
42 os.system('cd %s; zip --exclude=*/.svn* -r %s *' % (FFTIP_PATH, FFTIP_XPI))
43 print('Generated Firefox extension at %s' % FFTIP_XPI)
44
45 if __name__ == '__main__':
46 sys.exit(main())
OLDNEW
« no previous file with comments | « frog/tip/copy_libs.py ('k') | frog/tip/dart128.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698