Index: remoting/webapp/build-webapp.py |
diff --git a/remoting/webapp/build-webapp.py b/remoting/webapp/build-webapp.py |
index 3909316bf2e86ae44999cdf7be2d9104f1caf278..833e1f3ead52e6bde15223ae3576f37e9a90e5d0 100755 |
--- a/remoting/webapp/build-webapp.py |
+++ b/remoting/webapp/build-webapp.py |
@@ -117,20 +117,29 @@ |
if buildtype != 'Official' and buildtype != 'Release' and buildtype != 'Dev': |
raise Exception('Unknown buildtype: ' + buildtype) |
- jinja_context = { |
- 'webapp_type': webapp_type, |
- 'buildtype': buildtype, |
- } |
+ # Use symlinks on linux and mac for faster compile/edit cycle. |
+ # |
+ # On Windows Vista platform.system() can return 'Microsoft' with some |
+ # versions of Python, see http://bugs.python.org/issue1082 |
+ # should_symlink = platform.system() not in ['Windows', 'Microsoft'] |
+ # |
+ # TODO(ajwong): Pending decision on http://crbug.com/27185 we may not be |
+ # able to load symlinked resources. |
+ should_symlink = False |
# Copy all the files. |
for current_file in files: |
destination_file = os.path.join(destination, os.path.basename(current_file)) |
- |
- # Process *.jinja2 files as jinja2 templates |
- if current_file.endswith(".jinja2"): |
- destination_file = destination_file[:-len(".jinja2")] |
- processJinjaTemplate(current_file, jinja_paths, |
- destination_file, jinja_context) |
+ destination_dir = os.path.dirname(destination_file) |
+ if not os.path.exists(destination_dir): |
+ os.makedirs(destination_dir, 0775) |
+ |
+ if should_symlink: |
+ # TODO(ajwong): Detect if we're vista or higher. Then use win32file |
+ # to create a symlink in that case. |
+ targetname = os.path.relpath(os.path.realpath(current_file), |
+ os.path.realpath(destination_file)) |
+ os.symlink(targetname, destination_file) |
else: |
shutil.copy2(current_file, destination_file) |