diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-15 17:40:37 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-15 17:40:37 +0000 |
commit | 607beb06f7d1e6c065f8f018fbde437045589735 (patch) | |
tree | c4797b35a5cd377636f5ee2d7f41a03aa12c98f9 /remoting/webapp | |
parent | 52997b3fc24a0848fa52bacaf3c0a4cacda3a11b (diff) | |
download | chromium_src-607beb06f7d1e6c065f8f018fbde437045589735.zip chromium_src-607beb06f7d1e6c065f8f018fbde437045589735.tar.gz chromium_src-607beb06f7d1e6c065f8f018fbde437045589735.tar.bz2 |
Work towards single build of chromoting.
- Clean up gyp file
- Change manifest to single version
- Fix up extension on linux32 vs linux 64.
BUG=91840
TEST=Build
Review URL: http://codereview.chromium.org/7872004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101326 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp')
-rw-r--r-- | remoting/webapp/build-webapp.py | 47 | ||||
-rw-r--r-- | remoting/webapp/me2mom/manifest.json | 18 |
2 files changed, 42 insertions, 23 deletions
diff --git a/remoting/webapp/build-webapp.py b/remoting/webapp/build-webapp.py index cca8c44..66a28e7 100644 --- a/remoting/webapp/build-webapp.py +++ b/remoting/webapp/build-webapp.py @@ -18,6 +18,7 @@ import os import platform import re import shutil +import subprocess import sys import time import zipfile @@ -46,18 +47,18 @@ def createZip(zip_path, directory): zip.close() -def buildWebApp(mimetype, destination, zip_path, plugin, name_suffix, files, +def buildWebApp(linux_strip, mimetype, destination, zip_path, plugin, files, locales): """Does the main work of building the webapp directory and zipfile. Args: + linux_strip: should we strip the build on Linux (0 or !0). mimetype: A string with mimetype of plugin. destination: A string with path to directory where the webapp will be written. zipfile: A string with path to the zipfile to create containing the contents of |destination|. plugin: A string with path to the binary plugin for this webapp. - name_suffix: A string to append to the webapp's title. files: An array of strings listing the paths for resources to include in this webapp. locales: An array of strings listing locales, which are copied, along @@ -77,9 +78,9 @@ def buildWebApp(mimetype, destination, zip_path, plugin, name_suffix, files, # # 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'] + # should_symlink = platform.system() not in ['Windows', 'Microsoft'] # - # TODO(ajwong): Pending decision on http://crbug.com/27185, we may not be + # TODO(ajwong): Pending decision on http://crbug.com/27185 we may not be # able to load symlinked resources. should_symlink = False @@ -123,6 +124,24 @@ def buildWebApp(mimetype, destination, zip_path, plugin, name_suffix, files, os.mkdir(destination_dir, 0775) shutil.copy2(current_locale, destination_file) + # Create fake plugin files to appease the manifest checker. + # It requires that if there is a plugin listed in the manifest that + # there be a file in the plugin with that name. + names = [ + 'remoting_host_plugin.dll', # Windows + 'remoting_host_plugin.plugin', # Mac + 'libremoting_host_plugin.ia32.so', # Linux 32 + 'libremoting_host_plugin.x64.so' # Linux 64 + ] + pluginName = os.path.basename(plugin) + + for name in names: + if name != pluginName: + path = os.path.join(destination, name) + f = open(path, 'w') + f.write("placeholder for %s" % (name)) + f.close() + # Copy the plugin. pluginName = os.path.basename(plugin) newPluginPath = os.path.join(destination, pluginName) @@ -132,15 +151,9 @@ def buildWebApp(mimetype, destination, zip_path, plugin, name_suffix, files, else: shutil.copy2(plugin, newPluginPath) - # Now massage the manifest to the right plugin name. - findAndReplace(os.path.join(destination, 'manifest.json'), - '"PLUGINS": "PLACEHOLDER"', - '"plugins": [\n { "path": "' + pluginName +'" }\n ]') - - # Add the name suffix. - findAndReplace(os.path.join(destination, 'manifest.json'), - 'NAME_SUFFIX', - name_suffix) + # Strip the linux build. + if ((platform.system() == 'Linux') and (linux_strip != '0')): + subprocess.call(["strip", newPluginPath]) # Add unique build numbers to manifest version. # For now, this is based on the system clock (seconds since 1/1/1970), since @@ -168,8 +181,8 @@ def buildWebApp(mimetype, destination, zip_path, plugin, name_suffix, files, def main(): if len(sys.argv) < 6: print ('Usage: build-webapp.py ' - '<mime-type> <dst> <zip-path> <plugin> <other files...> ' - '--locales <locales...>') + '<linux-strip> <mime-type> <dst> <zip-path> <plugin> ' + '<other files...> --locales <locales...>') sys.exit(1) reading_locales = False @@ -183,8 +196,8 @@ def main(): else: files.append(arg) - buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], - sys.argv[5], files, locales) + buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], + files, locales) if __name__ == '__main__': diff --git a/remoting/webapp/me2mom/manifest.json b/remoting/webapp/me2mom/manifest.json index df672cc..21066ee 100644 --- a/remoting/webapp/me2mom/manifest.json +++ b/remoting/webapp/me2mom/manifest.json @@ -1,5 +1,5 @@ { - "name": "__MSG_PRODUCT_NAME_AND_VERSION__ NAME_SUFFIX", + "name": "__MSG_PRODUCT_NAME_AND_VERSION__", "version": "1.0.UNIQUE_VERSION", "description": "__MSG_PRODUCT_DESCRIPTION__", "default_locale": "en", @@ -15,17 +15,23 @@ "content_scripts": [ { "matches": [ - "https://talkgadget.google.com/talkgadget/blank", - "https://talkgadget.google.com/talkgadget/blank?*" + "https://talkgadget.google.com/talkgadget/blank", + "https://talkgadget.google.com/talkgadget/blank?*" ], - "js": ["cs_oauth2_trampoline.js"] + "js": [ "cs_oauth2_trampoline.js" ] } ], "permissions": [ "tabs", "https://accounts.google.com/o/oauth2/*", "https://www.google.com/accounts/*", - "https://www.googleapis.com/chromoting/*" + "https://www.googleapis.com/chromoting/*", + "https://talkgadget.google.com/talkgadget/*" ], - "PLUGINS": "PLACEHOLDER" + "plugins": [ + { "path": "remoting_host_plugin.dll", "public": false }, + { "path": "libremoting_host_plugin.ia32.so", "public": false }, + { "path": "libremoting_host_plugin.x64.so", "public": false }, + { "path": "remoting_host_plugin.plugin", "public": false } + ] } |