summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--remoting/remoting.gyp208
-rw-r--r--remoting/remoting_client.gypi85
-rw-r--r--remoting/remoting_webapp.gypi103
-rwxr-xr-xremoting/webapp/build-webapp.py14
4 files changed, 198 insertions, 212 deletions
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index e0f45f4..478ccdf 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -79,7 +79,7 @@
'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'th', 'tr', 'uk', 'vi',
'zh-CN', 'zh-TW',
],
- 'remoting_locale_files': [
+ 'remoting_host_locale_files': [
# Build the list of .pak files generated from remoting_strings.grd.
'<!@pymod_do_main(remoting_copy_locales -o -p <(OS) -x '
'<(PRODUCT_DIR) <(remoting_locales))',
@@ -171,212 +171,6 @@
],
}, # end of target 'remoting_breakpad'
- # TODO(garykac): This target should be moved into remoting_client.gypi.
- # It can't currently because of an issue with GYP where initialized
- # path variables in gypi includes cause a GYP failure.
- # See crrev.com/15968005 and crrev.com/15972007 for context.
- {
- 'target_name': 'remoting_webapp',
- 'type': 'none',
- 'variables': {
- 'remoting_webapp_patch_files': [
- 'webapp/appsv2.patch',
- ],
- 'remoting_webapp_apps_v2_js_files': [
- 'webapp/background.js',
- ],
- 'output_dir': '<(PRODUCT_DIR)/remoting/remoting.webapp',
- 'zip_path': '<(PRODUCT_DIR)/remoting-webapp.zip',
- 'generated_html_files': [
- '<(SHARED_INTERMEDIATE_DIR)/main.html',
- '<(SHARED_INTERMEDIATE_DIR)/wcs_sandbox.html',
- ],
- },
- 'dependencies': [
- 'remoting_resources',
- 'remoting_host_plugin',
- 'remoting_webapp_html',
- ],
- 'locale_files': [
- '<@(remoting_webapp_locale_files)',
- ],
- 'conditions': [
- ['enable_remoting_host==1', {
- 'locale_files': [
- '<@(remoting_locale_files)',
- ],
- 'variables': {
- 'plugin_path': '<(PRODUCT_DIR)/<(host_plugin_prefix)remoting_host_plugin.<(host_plugin_extension)',
- },
- }, {
- 'variables': {
- 'plugin_path': '',
- },
- 'dependencies!': [
- 'remoting_host_plugin',
- ],
- }],
- ['run_jscompile != 0', {
- 'variables': {
- 'success_stamp': '<(PRODUCT_DIR)/remoting_webapp_jscompile.stamp',
- },
- 'actions': [
- {
- 'action_name': 'Verify remoting webapp',
- 'inputs': [
- '<@(remoting_webapp_all_js_files)',
- '<@(remoting_webapp_js_proto_files)',
- ],
- 'outputs': [
- '<(success_stamp)',
- ],
- 'action': [
- 'python', 'tools/jscompile.py',
- '<@(remoting_webapp_all_js_files)',
- '<@(remoting_webapp_js_proto_files)',
- '--success-stamp',
- '<(success_stamp)'
- ],
- },
- ], # actions
- }],
- ],
- 'actions': [
- {
- 'action_name': 'Build Remoting WebApp',
- 'inputs': [
- 'webapp/build-webapp.py',
- '<(chrome_version_path)',
- '<(remoting_version_path)',
- '<@(generated_html_files)',
- '<@(remoting_webapp_files)',
- '<@(_locale_files)',
- ],
- 'conditions': [
- ['enable_remoting_host==1', {
- 'inputs': [
- '<(plugin_path)',
- ],
- }],
- ],
- 'outputs': [
- '<(output_dir)',
- '<(zip_path)',
- ],
- 'action': [
- 'python', 'webapp/build-webapp.py',
- '<(buildtype)',
- '<(version_full)',
- '<(host_plugin_mime_type)',
- '<(output_dir)',
- '<(zip_path)',
- '<(plugin_path)',
- '<@(generated_html_files)',
- '<@(remoting_webapp_files)',
- '--locales',
- '<@(_locale_files)',
- ],
- },
- ],
- 'target_conditions': [
- # We cannot currently build the appsv2 version of WebApp on Windows as
- # there isn't a version of the "patch" tool available on windows. We
- # should remove this condition when we remove the reliance on patch.
-
- # We define this in a 'target_conditions' section because 'plugin_path'
- # is defined in a 'conditions' section so its value is not available
- # when gyp processes the 'actions' in a 'conditions" section.
- ['OS != "win"', {
- 'actions': [
- {
- 'action_name': 'Build Remoting WebApp V2',
- 'output_dir': '<(PRODUCT_DIR)/remoting/remoting.webapp.v2',
- 'zip_path': '<(PRODUCT_DIR)/remoting-webapp.v2.zip',
- 'inputs': [
- 'webapp/build-webapp.py',
- '<(chrome_version_path)',
- '<(remoting_version_path)',
- '<@(remoting_webapp_apps_v2_js_files)',
- '<@(remoting_webapp_files)',
- '<@(remoting_webapp_locale_files)',
- '<@(remoting_webapp_patch_files)',
- ],
- 'conditions': [
- ['enable_remoting_host==1', {
- 'inputs': [
- '<(plugin_path)',
- ],
- }],
- ],
- 'outputs': [
- '<(_output_dir)',
- '<(_zip_path)',
- ],
- 'action': [
- 'python', 'webapp/build-webapp.py',
- '<(buildtype)',
- '<(version_full)',
- '<(host_plugin_mime_type)',
- '<(_output_dir)',
- '<(_zip_path)',
- '<(plugin_path)',
- '<@(remoting_webapp_apps_v2_js_files)',
- '<@(remoting_webapp_files)',
- '--locales',
- '<@(remoting_webapp_locale_files)',
- '--patches',
- '<@(remoting_webapp_patch_files)',
- ],
- },
- ],
- }],
- ],
- }, # end of target 'remoting_webapp'
-
- {
- 'target_name': 'remoting_webapp_html',
- 'type': 'none',
- 'actions': [
- {
- 'action_name': 'Build Remoting Webapp main.html',
- 'inputs': [
- 'webapp/build-html.py',
- '<(remoting_webapp_template_main)',
- '<@(remoting_webapp_template_files)',
- ],
- 'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/main.html',
- ],
- 'action': [
- 'python', 'webapp/build-html.py',
- '<(SHARED_INTERMEDIATE_DIR)/main.html',
- '<(remoting_webapp_template_main)',
- '--template',
- '<@(remoting_webapp_template_files)',
- '--js',
- '<@(remoting_webapp_main_html_js_files)',
- ],
- },
- {
- 'action_name': 'Build Remoting Webapp wcs_sandbox.html',
- 'inputs': [
- 'webapp/build-html.py',
- '<(remoting_webapp_template_wcs_sandbox)',
- ],
- 'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/wcs_sandbox.html',
- ],
- 'action': [
- 'python', 'webapp/build-html.py',
- '<(SHARED_INTERMEDIATE_DIR)/wcs_sandbox.html',
- '<(remoting_webapp_template_wcs_sandbox)',
- '--js',
- '<@(remoting_webapp_wcs_sandbox_html_js_files)',
- ],
- },
- ],
- }, # end of target 'remoting_webapp_html'
-
{
'target_name': 'remoting_resources',
'type': 'none',
diff --git a/remoting/remoting_client.gypi b/remoting/remoting_client.gypi
index 9581b0c..9f5b712 100644
--- a/remoting/remoting_client.gypi
+++ b/remoting/remoting_client.gypi
@@ -50,5 +50,90 @@
],
}, # end of target 'remoting_client'
+ {
+ 'target_name': 'remoting_webapp_html',
+ 'type': 'none',
+ 'actions': [
+ {
+ 'action_name': 'Build Remoting Webapp main.html',
+ 'inputs': [
+ 'webapp/build-html.py',
+ '<(remoting_webapp_template_main)',
+ '<@(remoting_webapp_template_files)',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/main.html',
+ ],
+ 'action': [
+ 'python', 'webapp/build-html.py',
+ '<(SHARED_INTERMEDIATE_DIR)/main.html',
+ '<(remoting_webapp_template_main)',
+ '--template', '<@(remoting_webapp_template_files)',
+ '--js', '<@(remoting_webapp_main_html_js_files)',
+ ],
+ },
+ {
+ 'action_name': 'Build Remoting Webapp wcs_sandbox.html',
+ 'inputs': [
+ 'webapp/build-html.py',
+ '<(remoting_webapp_template_wcs_sandbox)',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/wcs_sandbox.html',
+ ],
+ 'action': [
+ 'python', 'webapp/build-html.py',
+ '<(SHARED_INTERMEDIATE_DIR)/wcs_sandbox.html',
+ '<(remoting_webapp_template_wcs_sandbox)',
+ '--js', '<@(remoting_webapp_wcs_sandbox_html_js_files)',
+ ],
+ },
+ ],
+ }, # end of target 'remoting_webapp_html'
+
+ {
+ 'target_name': 'remoting_webapp',
+ 'type': 'none',
+ 'dependencies': [
+ 'remoting_webapp_v1',
+ ],
+ 'conditions': [
+ ['OS != "win"', {
+ 'dependencies': [
+ 'remoting_webapp_v2',
+ ],
+ }],
+ ],
+ }, # end of target 'remoting_webapp'
+
+ {
+ 'target_name': 'remoting_webapp_v1',
+ 'type': 'none',
+ 'variables': {
+ 'include_host_plugin': '<(enable_remoting_host)',
+ 'output_dir': '<(PRODUCT_DIR)/remoting/remoting.webapp',
+ 'zip_path': '<(PRODUCT_DIR)/remoting-webapp.zip',
+ },
+ 'includes': [ 'remoting_webapp.gypi', ],
+ }, # end of target 'remoting_webapp_v1'
+
], # end of targets
+
+ 'conditions': [
+ ['OS != "win"', {
+ 'targets': [
+ {
+ 'target_name': 'remoting_webapp_v2',
+ 'type': 'none',
+ 'variables': {
+ 'output_dir': '<(PRODUCT_DIR)/remoting/remoting.webapp.v2',
+ 'zip_path': '<(PRODUCT_DIR)/remoting-webapp-v2.zip',
+ 'patch_files': [ 'webapp/appsv2.patch' ],
+ 'extra_files': [ 'webapp/background.js' ],
+ },
+ 'includes': [ 'remoting_webapp.gypi', ],
+ }, # end of target 'remoting_webapp_v2'
+ ],
+ }],
+ ],
}
diff --git a/remoting/remoting_webapp.gypi b/remoting/remoting_webapp.gypi
new file mode 100644
index 0000000..1b81873
--- /dev/null
+++ b/remoting/remoting_webapp.gypi
@@ -0,0 +1,103 @@
+# Copyright 2014 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.
+#
+# File included in remoting_webapp_* targets in remoting_client.gypi
+
+{
+ 'type': 'none',
+ 'variables': {
+ 'include_host_plugin%': 0,
+ 'patch_files%': [],
+ 'extra_files%': [],
+ 'generated_html_files': [
+ '<(SHARED_INTERMEDIATE_DIR)/main.html',
+ '<(SHARED_INTERMEDIATE_DIR)/wcs_sandbox.html',
+ ],
+ },
+ 'dependencies': [
+ 'remoting_resources',
+ 'remoting_webapp_html',
+ ],
+ 'conditions': [
+ ['include_host_plugin==1', {
+ 'dependencies': [
+ 'remoting_host_plugin',
+ ],
+ 'variables': {
+ 'plugin_path': '<(PRODUCT_DIR)/<(host_plugin_prefix)remoting_host_plugin.<(host_plugin_extension)',
+ 'plugin_args': [
+ '--locales', '<@(remoting_host_locale_files)',
+ '--plugin', '<(plugin_path)',
+ ],
+ },
+ }, {
+ 'variables': {
+ 'plugin_args': [],
+ },
+ }],
+ ['run_jscompile != 0', {
+ 'variables': {
+ 'success_stamp': '<(PRODUCT_DIR)/remoting_webapp_jscompile.stamp',
+ },
+ 'actions': [
+ {
+ 'action_name': 'Verify remoting webapp',
+ 'inputs': [
+ '<@(remoting_webapp_all_js_files)',
+ '<@(remoting_webapp_js_proto_files)',
+ ],
+ 'outputs': [
+ '<(success_stamp)',
+ ],
+ 'action': [
+ 'python', 'tools/jscompile.py',
+ '<@(remoting_webapp_all_js_files)',
+ '<@(remoting_webapp_js_proto_files)',
+ '--success-stamp', '<(success_stamp)'
+ ],
+ },
+ ], # actions
+ }],
+ ],
+ 'actions': [
+ {
+ 'action_name': 'Build Remoting WebApp',
+ 'inputs': [
+ 'webapp/build-webapp.py',
+ '<(chrome_version_path)',
+ '<(remoting_version_path)',
+ '<@(generated_html_files)',
+ '<@(remoting_webapp_files)',
+ '<@(remoting_webapp_locale_files)',
+ '<@(extra_files)',
+ ],
+ 'conditions': [
+ ['include_host_plugin==1', {
+ 'inputs': [
+ '<(plugin_path)',
+ '<@(remoting_host_locale_files)',
+ ],
+ }],
+ ],
+ 'outputs': [
+ '<(output_dir)',
+ '<(zip_path)',
+ ],
+ 'action': [
+ 'python', 'webapp/build-webapp.py',
+ '<(buildtype)',
+ '<(version_full)',
+ '<(host_plugin_mime_type)',
+ '<(output_dir)',
+ '<(zip_path)',
+ '<@(generated_html_files)',
+ '<@(remoting_webapp_files)',
+ '<@(extra_files)',
+ '<@(plugin_args)',
+ '--locales', '<@(remoting_webapp_locale_files)',
+ '--patches', '<@(patch_files)',
+ ],
+ },
+ ],
+}
diff --git a/remoting/webapp/build-webapp.py b/remoting/webapp/build-webapp.py
index 42e941c..df4c56f 100755
--- a/remoting/webapp/build-webapp.py
+++ b/remoting/webapp/build-webapp.py
@@ -306,10 +306,10 @@ def buildWebApp(buildtype, version, mimetype, destination, zip_path, plugin,
def main():
- if len(sys.argv) < 7:
+ if len(sys.argv) < 6:
print ('Usage: build-webapp.py '
- '<build-type> <version> <mime-type> <dst> <zip-path> <plugin> '
- '<other files...> [--patches <patches...>] '
+ '<build-type> <version> <mime-type> <dst> <zip-path> '
+ '<other files...> [--plugin <plugin>] [--patches <patches...>] '
'[--locales <locales...>]')
return 1
@@ -317,18 +317,22 @@ def main():
files = []
locales = []
patches = []
+ plugin = ""
for arg in sys.argv[7:]:
- if arg == '--locales' or arg == '--patches':
+ if arg in ['--locales', '--patches', '--plugin']:
arg_type = arg
elif arg_type == '--locales':
locales.append(arg)
elif arg_type == '--patches':
patches.append(arg)
+ elif arg_type == '--plugin':
+ plugin = arg
+ arg_type = ''
else:
files.append(arg)
return buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4],
- sys.argv[5], sys.argv[6], files, locales, patches)
+ sys.argv[5], plugin, files, locales, patches)
if __name__ == '__main__':