Skip to content

Commit

Permalink
Copy debug PNaCl plugin in Dev builds of the chromoting webapp.
Browse files Browse the repository at this point in the history
With this change the Debug version of the PNaCl plugin will be copied to
the webapp directory allowing to debug PNaCl plugin (using nacl-gdb).

Also updated build-webapp.py to process all *.jinja2 input files as jinja2
templates.

This patch was previously reverted because of a problem that should be
fixed now by https://codereview.chromium.org/872673006/ .

BUG=451643

Review URL: https://codereview.chromium.org/872633006

Cr-Commit-Position: refs/heads/master@{#314873}
  • Loading branch information
SergeyUlanov authored and Commit bot committed Feb 5, 2015
1 parent 566c432 commit a0f6662
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
11 changes: 10 additions & 1 deletion remoting/remoting_client.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,22 @@
'zip_path': '<(PRODUCT_DIR)/remoting-webapp.v2_pnacl.zip',
'webapp_type': 'v2_pnacl',
'extra_files': [
'webapp/crd/remoting_client_pnacl.nmf',
'webapp/crd/remoting_client_pnacl.nmf.jinja2',
'<(PRODUCT_DIR)/remoting_client_plugin_newlib.pexe',
],
},
'dependencies': [
'remoting_nacl.gyp:remoting_client_plugin_nacl',
],
'conditions': [
['buildtype == "Dev"', {
'variables': {
'extra_files': [
'<(PRODUCT_DIR)/remoting_client_plugin_newlib.pexe.debug',
],
},
}],
],
'includes': [ 'remoting_webapp.gypi', ],
}, # end of target 'remoting_webapp_v2_pnacl'
],
Expand Down
29 changes: 10 additions & 19 deletions remoting/webapp/build-webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,29 +118,20 @@ def buildWebApp(buildtype, version, destination, zip_path,
if buildtype != 'Official' and buildtype != 'Release' and buildtype != 'Dev':
raise Exception('Unknown 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
jinja_context = {
'webapp_type': webapp_type,
'buildtype': buildtype,
}

# Copy all the files.
for current_file in files:
destination_file = os.path.join(destination, os.path.basename(current_file))
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)

# 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)
else:
shutil.copy2(current_file, destination_file)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"url": "remoting_client_plugin_newlib.pexe",
"optlevel": 2
}
{% if buildtype == 'Dev' %}
, "pnacl-debug": {
"url": "remoting_client_plugin_newlib.pexe.debug",
"optlevel": 0
}
{% endif %}
}
}
}

0 comments on commit a0f6662

Please sign in to comment.