diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-15 17:51:20 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-15 17:51:20 +0000 |
commit | 6417f0b7a24856edba82bd8385a55e940af875c9 (patch) | |
tree | 4d4c99c6475d412010b9f99d851f618c4acb831f | |
parent | 607beb06f7d1e6c065f8f018fbde437045589735 (diff) | |
download | chromium_src-6417f0b7a24856edba82bd8385a55e940af875c9.zip chromium_src-6417f0b7a24856edba82bd8385a55e940af875c9.tar.gz chromium_src-6417f0b7a24856edba82bd8385a55e940af875c9.tar.bz2 |
Revert 101326 - 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
TBR=dmaclach@chromium.org
Review URL: http://codereview.chromium.org/7894002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101328 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, 61 insertions, 58 deletions
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp index 184297a..8d9444b 100644 --- a/remoting/remoting.gyp +++ b/remoting/remoting.gyp @@ -20,22 +20,42 @@ 'mac_creator': 'Cr24', }], # branding ], # conditions - 'host_plugin_extension': 'plugin', - 'host_plugin_prefix': '', + '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', }], - ['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==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 == "x64"', { - # linux 64 bit - 'host_plugin_extension': 'x64.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=="win"', { - 'host_plugin_extension': 'dll', - 'host_plugin_prefix': '', + 'plugin_extension': 'dll', + 'plugin_prefix': '', + 'name_suffix': '- Windows', + 'remoting_it2me_os_files': [ + # Empty for now, may be used in future. + ], }], ['branding=="Chrome"', { 'remoting_it2me_locale_files': [ @@ -184,8 +204,6 @@ { '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)', ], @@ -225,6 +243,7 @@ '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 @@ -264,6 +283,7 @@ '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 @@ -300,12 +320,13 @@ { 'action_name': 'Build It2Me WebApp', 'output_dir': '<(PRODUCT_DIR)/remoting/it2me.webapp', - 'plugin_path': '<(PRODUCT_DIR)/<(host_plugin_prefix)remoting_host_plugin.<(host_plugin_extension)', + 'plugin_path': '<(PRODUCT_DIR)/<(plugin_prefix)remoting_host_plugin.<(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': [ @@ -314,12 +335,13 @@ ], '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 66a28e7..cca8c44 100644 --- a/remoting/webapp/build-webapp.py +++ b/remoting/webapp/build-webapp.py @@ -18,7 +18,6 @@ import os import platform import re import shutil -import subprocess import sys import time import zipfile @@ -47,18 +46,18 @@ def createZip(zip_path, directory): zip.close() -def buildWebApp(linux_strip, mimetype, destination, zip_path, plugin, files, +def buildWebApp(mimetype, destination, zip_path, plugin, name_suffix, 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 @@ -78,9 +77,9 @@ def buildWebApp(linux_strip, mimetype, destination, zip_path, plugin, 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 @@ -124,24 +123,6 @@ def buildWebApp(linux_strip, mimetype, destination, zip_path, plugin, 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) @@ -151,9 +132,15 @@ def buildWebApp(linux_strip, mimetype, destination, zip_path, plugin, files, else: shutil.copy2(plugin, newPluginPath) - # Strip the linux build. - if ((platform.system() == 'Linux') and (linux_strip != '0')): - subprocess.call(["strip", 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) # Add unique build numbers to manifest version. # For now, this is based on the system clock (seconds since 1/1/1970), since @@ -181,8 +168,8 @@ def buildWebApp(linux_strip, mimetype, destination, zip_path, plugin, files, def main(): if len(sys.argv) < 6: print ('Usage: build-webapp.py ' - '<linux-strip> <mime-type> <dst> <zip-path> <plugin> ' - '<other files...> --locales <locales...>') + '<mime-type> <dst> <zip-path> <plugin> <other files...> ' + '--locales <locales...>') sys.exit(1) reading_locales = False @@ -196,8 +183,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 21066ee..df672cc 100644 --- a/remoting/webapp/me2mom/manifest.json +++ b/remoting/webapp/me2mom/manifest.json @@ -1,5 +1,5 @@ { - "name": "__MSG_PRODUCT_NAME_AND_VERSION__", + "name": "__MSG_PRODUCT_NAME_AND_VERSION__ NAME_SUFFIX", "version": "1.0.UNIQUE_VERSION", "description": "__MSG_PRODUCT_DESCRIPTION__", "default_locale": "en", @@ -15,23 +15,17 @@ "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://talkgadget.google.com/talkgadget/*" + "https://www.googleapis.com/chromoting/*" ], - "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 } - ] + "PLUGINS": "PLACEHOLDER" } |