summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authordmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-10 20:46:06 +0000
committerdmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-10 20:46:06 +0000
commit03415f19c918a122cbb4aa696317570598cb4617 (patch)
tree809e311c9e3f0eb87dae4a7cee0f9c81b1396a61 /remoting
parent852711914fec9474ae81d698e4eae526425f0dc0 (diff)
downloadchromium_src-03415f19c918a122cbb4aa696317570598cb4617.zip
chromium_src-03415f19c918a122cbb4aa696317570598cb4617.tar.gz
chromium_src-03415f19c918a122cbb4aa696317570598cb4617.tar.bz2
Build a "real" webapp deliverable and add plugin to it.
BUG=NONE TEST=BUILD Review URL: http://codereview.chromium.org/6998009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84843 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/remoting.gyp49
-rw-r--r--remoting/webapp/build-webapp.py47
-rw-r--r--remoting/webapp/me2mom/manifest.json.template (renamed from remoting/webapp/me2mom/manifest.json)5
3 files changed, 98 insertions, 3 deletions
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index 980a260..61480da 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -18,7 +18,16 @@
'mac_creator': 'Cr24',
}], # branding
], # conditions
-
+ 'plugin_extension': 'plugin',
+ 'plugin_prefix': '',
+ }],
+ ['OS=="linux"', {
+ 'plugin_extension': 'so',
+ 'plugin_prefix': 'lib',
+ }],
+ ['OS=="win"', {
+ 'plugin_extension': 'dll',
+ 'plugin_prefix': '',
}],
],
},
@@ -143,7 +152,7 @@
'xcode_settings': {
'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)',
'INFOPLIST_FILE': 'host/host_plugin-Info.plist',
- 'WRAPPER_EXTENSION': 'plugin',
+ 'WRAPPER_EXTENSION': '<(plugin_extension)',
},
# TODO(mark): Come up with a fancier way to do this. It should
# only be necessary to list framework-Info.plist once, not the
@@ -158,6 +167,42 @@
],
}, # end of target 'chromoting_host_plugin'
{
+ 'target_name': 'webapp_me2mom',
+ 'type': 'none',
+ 'dependencies': [
+ 'chromoting_host_plugin',
+ ],
+ 'sources': [
+ 'webapp/build-webapp.py',
+ ],
+ 'sources!': [
+ 'webapp/build-webapp.py',
+ ],
+ # Can't use a copies because we need to manipulate
+ # the manifest file to get the right plugin name.
+ # Also we need to move the plugin into the me2mom
+ # folder, which means 2 copies, and gyp doesn't
+ # seem to guarantee the ordering of 2 copies statements
+ # when the actual project is generated.
+ 'actions': [
+ {
+ 'action_name': 'Build Me2Mom WebApp',
+ 'inputs': [
+ 'webapp/me2mom/',
+ '<(PRODUCT_DIR)/<(plugin_prefix)chromoting_host_plugin.<(plugin_extension)',
+ ],
+ 'outputs': [
+ '<(PRODUCT_DIR)/remoting/remoting-me2mom.webapp',
+ ],
+ 'action': [
+ 'python', 'webapp/build-webapp.py',
+ '<@(_inputs)',
+ '<@(_outputs)'
+ ],
+ },
+ ],
+ }, # end of target 'webapp_me2mom'
+ {
'target_name': 'chromoting_base',
'type': '<(library)',
'dependencies': [
diff --git a/remoting/webapp/build-webapp.py b/remoting/webapp/build-webapp.py
new file mode 100644
index 0000000..d6e8996
--- /dev/null
+++ b/remoting/webapp/build-webapp.py
@@ -0,0 +1,47 @@
+#!/usr/bin/python
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Copies the remoting webapp resources and host plugin into a single directory.
+
+import os
+import shutil
+import sys
+
+if len(sys.argv) != 4:
+ print 'Usage: build-webapp.py <webapp-resource-dir> <host-plugin> <dst>'
+ sys.exit(1)
+
+resources = sys.argv[1]
+plugin = sys.argv[2]
+destination = sys.argv[3]
+
+try:
+ shutil.rmtree(destination)
+except OSError:
+ if os.path.exists(destination):
+ raise
+ else:
+ pass
+
+shutil.copytree(resources, destination)
+pluginName = os.path.basename(plugin)
+newPluginPath = os.path.join(destination, pluginName)
+
+# On Mac we have a directory
+if os.path.isdir(plugin):
+ shutil.copytree(plugin, newPluginPath)
+else:
+ shutil.copy2(plugin, newPluginPath)
+
+# Now massage the manifest to the right plugin name
+templatePath = os.path.join(destination, 'manifest.json.template')
+manifestPath = os.path.join(destination, 'manifest.json')
+input = open(templatePath)
+output = open(manifestPath, 'w')
+for s in input:
+ output.write(s.replace('HOST_PLUGIN_NAME', pluginName))
+input.close()
+output.close()
+os.remove(templatePath)
diff --git a/remoting/webapp/me2mom/manifest.json b/remoting/webapp/me2mom/manifest.json.template
index 9fd63edb..dbd423d 100644
--- a/remoting/webapp/me2mom/manifest.json
+++ b/remoting/webapp/me2mom/manifest.json.template
@@ -1,5 +1,5 @@
{
- "name": "Chromoting Me2Mom",
+ "name": "Remoting Me2Mom",
"version": "1.0",
"description": "Me2Mom-style remote support in Chrome.",
"app": {
@@ -10,4 +10,7 @@
"icons": {
"128": "chromoting128.png"
}
+ "plugins": [
+ { "path": "HOST_PLUGIN_NAME" },
+ ],
}