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 | |
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
-rw-r--r-- | remoting/remoting.gyp | 54 | ||||
-rw-r--r-- | remoting/webapp/build-webapp.py | 47 | ||||
-rw-r--r-- | remoting/webapp/me2mom/manifest.json | 18 |
3 files changed, 58 insertions, 61 deletions
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp index 8d9444b..184297a 100644 --- a/remoting/remoting.gyp +++ b/remoting/remoting.gyp @@ -20,42 +20,22 @@ 'mac_creator': 'Cr24', }], # branding ], # conditions - 'plugin_extension': 'plugin', - 'plugin_prefix': '', - 'name_suffix': '- Mac', - 'remoting_it2me_os_files': [ - # Empty for now, may be used in future. - ], - }], - ['os_posix == 1 and OS != "mac"', { - 'plugin_extension': 'so', - 'plugin_prefix': 'lib', + 'host_plugin_extension': 'plugin', + 'host_plugin_prefix': '', }], - ['OS=="linux" and chromeos==1', { - 'name_suffix': '- Chromebook', - 'remoting_it2me_os_files': [ - # Empty for now, may be used in future. - ], + ['os_posix == 1 and OS != "mac" and target_arch == "ia32"', { + # linux 32 bit + 'host_plugin_extension': 'ia32.so', + 'host_plugin_prefix': 'lib', }], - ['OS=="linux" and chromeos==0 and target_arch=="x64"', { - 'name_suffix': '- Linux - 64', - 'remoting_it2me_os_files': [ - # Empty for now, may be used in future. - ], - }], - ['OS=="linux" and chromeos==0 and target_arch!="x64"', { - 'name_suffix': '- Linux', - 'remoting_it2me_os_files': [ - # Empty for now, may be used in future. - ], + ['os_posix == 1 and OS != "mac" and target_arch == "x64"', { + # linux 64 bit + 'host_plugin_extension': 'x64.so', + 'host_plugin_prefix': 'lib', }], ['OS=="win"', { - 'plugin_extension': 'dll', - 'plugin_prefix': '', - 'name_suffix': '- Windows', - 'remoting_it2me_os_files': [ - # Empty for now, may be used in future. - ], + 'host_plugin_extension': 'dll', + 'host_plugin_prefix': '', }], ['branding=="Chrome"', { 'remoting_it2me_locale_files': [ @@ -204,6 +184,8 @@ { 'target_name': 'remoting_host_plugin', 'type': 'loadable_module', + 'product_extension': '<(host_plugin_extension)', + 'product_prefix': '<(host_plugin_prefix)', 'defines': [ 'HOST_PLUGIN_MIME_TYPE=<(host_plugin_mime_type)', ], @@ -243,7 +225,6 @@ 'INFOPLIST_FILE': 'host/plugin/host_plugin-Info.plist', 'INFOPLIST_PREPROCESS': 'YES', 'INFOPLIST_PREPROCESSOR_DEFINITIONS': 'HOST_PLUGIN_MIME_TYPE=<(host_plugin_mime_type)', - 'WRAPPER_EXTENSION': '<(plugin_extension)', }, # TODO(mark): Come up with a fancier way to do this. It should # only be necessary to list host_plugin-Info.plist once, not the @@ -283,7 +264,6 @@ 'webapp/build-webapp.py', 'webapp/verify-webapp.py', '<@(remoting_it2me_files)', - '<@(remoting_it2me_os_files)', '<@(remoting_it2me_locale_files)', ], # Can't use a 'copies' because we need to manipulate @@ -320,13 +300,12 @@ { 'action_name': 'Build It2Me WebApp', 'output_dir': '<(PRODUCT_DIR)/remoting/it2me.webapp', - 'plugin_path': '<(PRODUCT_DIR)/<(plugin_prefix)remoting_host_plugin.<(plugin_extension)', + 'plugin_path': '<(PRODUCT_DIR)/<(host_plugin_prefix)remoting_host_plugin.<(host_plugin_extension)', 'zip_path': '<(PRODUCT_DIR)/remoting-it2me.zip', 'inputs': [ 'webapp/build-webapp.py', '<(_plugin_path)', '<@(remoting_it2me_files)', - '<@(remoting_it2me_os_files)', '<@(remoting_it2me_locale_files)', ], 'outputs': [ @@ -335,13 +314,12 @@ ], 'action': [ 'python', 'webapp/build-webapp.py', + '<(linux_strip_binary)', '<(host_plugin_mime_type)', '<(_output_dir)', '<(_zip_path)', '<(_plugin_path)', - '<(name_suffix)', '<@(remoting_it2me_files)', - '<@(remoting_it2me_os_files)', '--locales', '<@(remoting_it2me_locale_files)', ], 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 } + ] } |