Skip to content

Commit

Permalink
[AppRemoting] Break out AppRemoting shared module.
Browse files Browse the repository at this point in the history
This is a reland of crrev.com/1179873005 with the following fixes:
  Added GYP build of shared module
  Updated build-webapp.py script to not check env for shared module
    This fixes the GN Release build problem

This cl breaks out the shared AppRemoting code into a shared module so
that it does not need to be duplicated in each individual app.

This version has the following limitations which will be addressed in
follow-up cls:
(1) The apps have a hard-coded reference to the dev shared module
(2) The apps have a hard-coded reference to the dev orchestrator
(3) The resources in the app stub should be replaced with empty stub
    resources rather than a copy of all the shared resources.

BUG=

Review URL: https://codereview.chromium.org/1188253009

Cr-Commit-Position: refs/heads/master@{#337487}
  • Loading branch information
garykac authored and Commit bot committed Jul 6, 2015
1 parent 990d54c commit 7d47f7a
Show file tree
Hide file tree
Showing 33 changed files with 675 additions and 322 deletions.
215 changes: 215 additions & 0 deletions remoting/app_remoting_shared_module.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
# Copyright 2015 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.

{
'includes': [
'remoting_version.gypi',
'remoting_locales.gypi',
'remoting_options.gypi',
'remoting_webapp_files.gypi',
'app_remoting_webapp_files.gypi',
],
'targets': [
{
# GN version: //remoting/webapp:ar_shared_module
'target_name': 'ar_shared_module',
'type': 'none',


'variables': {
'app_key': 'Sample_App',
'app_id': 'ljacajndfccfgnfohlgkdphmbnpkjflk',
'app_client_id': 'sample_client_id',
'app_name': 'App Remoting Client',
'app_description': 'App Remoting client',

'ar_shared_module_manifest': 'webapp/app_remoting/shared_module/manifest.json',

'ar_generated_html_files': [
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/ar_background.html',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
'<(SHARED_INTERMEDIATE_DIR)/remoting/credits.html',
],
'ar_shared_module_files': [
'<@(ar_shared_resource_files)',
'<@(ar_all_js_files)',
'<@(ar_generated_html_files)',
],
'output_dir': '<(PRODUCT_DIR)/app_streaming/>(_target_name)',
'zip_path': '<(PRODUCT_DIR)/app_streaming/>(_target_name).zip',

'ar_shared_module_locales_listfile': '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)_locales.txt',

},


'actions': [
{
'action_name': 'Build ar_shared_module locales listfile',
'inputs': [
'<(remoting_localize_path)',
],
'outputs': [
'<(ar_shared_module_locales_listfile)',
],
'action': [
'python', '<(remoting_localize_path)',
'--locale_output',
'"<(webapp_locale_dir)/@{json_suffix}/messages.json"',
'--locales_listfile',
'<(ar_shared_module_locales_listfile)',
'<@(remoting_locales)',
],
},
{
'action_name': 'Build ar_shared_module application stub',
'inputs': [
'<(DEPTH)/remoting/webapp/build-webapp.py',
'<(chrome_version_path)',
'<(remoting_version_path)',
'<@(ar_shared_module_files)',
'<@(remoting_webapp_locale_files)',
'<(ar_shared_module_manifest)',
'<(ar_shared_module_locales_listfile)',
],
'outputs': [
'<(output_dir)',
'<(zip_path)',
],
'action': [
'python', '<(DEPTH)/remoting/webapp/build-webapp.py',
'<(buildtype)',
'<(version_full)',
'<(output_dir)',
'<(zip_path)',
'<(ar_shared_module_manifest)',
'shared_module', # Web app type
'<@(ar_shared_module_files)',
'--locales_listfile',
'<(ar_shared_module_locales_listfile)',
],
},

{
'action_name': 'Build ar_shared_module main.html',
'inputs': [
'<(DEPTH)/remoting/webapp/build-html.py',
'<(ar_main_template)',
'<@(ar_main_template_files)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
],
'action': [
'python', '<(DEPTH)/remoting/webapp/build-html.py',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
'<(ar_main_template)',
'--template-dir',
'<(DEPTH)/remoting',
'--templates',
'<@(ar_main_template_files)',
'--js',
'<@(ar_main_js_files)',
],
},
{
'action_name': 'Build ar_shared_module ar_background.html',
'inputs': [
'<(DEPTH)/remoting/webapp/build-html.py',
'<(ar_background_template)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/ar_background.html',
],
'action': [
'python', '<(DEPTH)/remoting/webapp/build-html.py',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/ar_background.html',
'<(ar_background_template)',
'--template-dir',
'<(DEPTH)/remoting',
'--js',
'<@(ar_background_html_js_files)',
],
},
{
'action_name': 'Build ar_shared_module wcs_sandbox.html',
'inputs': [
'<(DEPTH)/remoting/webapp/build-html.py',
'<(remoting_webapp_template_wcs_sandbox)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
],
'action': [
'python', '<(DEPTH)/remoting/webapp/build-html.py',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
'<(remoting_webapp_template_wcs_sandbox)',
'--js',
'<@(remoting_webapp_wcs_sandbox_html_all_js_files)',
],
},
{
'action_name': 'Build ar_shared_module loading_window.html',
'inputs': [
'<(DEPTH)/remoting/webapp/build-html.py',
'<(ar_loading_window_template)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html',
],
'action': [
'python', '<(DEPTH)/remoting/webapp/build-html.py',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html',
'<(ar_loading_window_template)',
# The loading window is just a reskin of the message window--all
# JS code is shared.
'--js', '<@(remoting_webapp_message_window_html_all_js_files)',
],
},
{
'action_name': 'Build ar_shared_module message_window.html',
'inputs': [
'<(DEPTH)/remoting/webapp/build-html.py',
'<(remoting_webapp_template_message_window)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html',
],
'action': [
'python', '<(DEPTH)/remoting/webapp/build-html.py',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html',
'<(remoting_webapp_template_message_window)',
'--js', '<@(remoting_webapp_message_window_html_all_js_files)',
],
},
{
'action_name': 'Build ar_shared_module feedback_consent.html',
'inputs': [
'<(DEPTH)/remoting/webapp/build-html.py',
'<(ar_feedback_consent_template)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
],
'action': [
'python', '<(DEPTH)/remoting/webapp/build-html.py',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
'<(ar_feedback_consent_template)',
'--template-dir',
'<(DEPTH)/remoting',
'--js',
'<@(ar_feedback_consent_html_all_js_files)',
],
},
], # actions


}, # end of ar_shared_module

], # end of targets
}
106 changes: 2 additions & 104 deletions remoting/app_remoting_webapp_build.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,10 @@
'>(ar_app_path)/icon128.png',
'>(ar_app_path)/loading_splash.png',
],
'ar_generated_html_files': [
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
'<(SHARED_INTERMEDIATE_DIR)/remoting/credits.html',
],
'ar_webapp_files': [
'<@(ar_app_specific_files)',
'<@(ar_shared_resource_files)',
'<@(ar_all_js_files)',
'<@(ar_generated_html_files)',
'<@(ar_vendor_js_files)',
'<@(ar_vendor_html_files)',
],
'output_dir': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name)',
'zip_path': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name).zip',
Expand Down Expand Up @@ -103,7 +94,6 @@
'<(remoting_version_path)',
'<@(ar_webapp_files)',
'<@(remoting_webapp_locale_files)',
'<@(ar_generated_html_files)',
'<(ar_app_manifest_app)',
'<(DEPTH)/remoting/<(ar_app_manifest_common)',
'<(ar_webapp_locales_listfile)',
Expand Down Expand Up @@ -140,98 +130,6 @@
'>@(_app_client_id)',
],
},
{
'action_name': 'Build ">(ar_app_name)" main.html',
'inputs': [
'<(DEPTH)/remoting/webapp/build-html.py',
'<(ar_main_template)',
'<@(ar_main_template_files)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
],
'action': [
'python', '<(DEPTH)/remoting/webapp/build-html.py',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
'<(ar_main_template)',
'--template-dir',
'<(DEPTH)/remoting',
'--templates',
'<@(ar_main_template_files)',
'--js',
'<@(ar_main_js_files)',
],
},
{
'action_name': 'Build ">(ar_app_name)" wcs_sandbox.html',
'inputs': [
'<(DEPTH)/remoting/webapp/build-html.py',
'<(remoting_webapp_template_wcs_sandbox)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
],
'action': [
'python', '<(DEPTH)/remoting/webapp/build-html.py',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
'<(remoting_webapp_template_wcs_sandbox)',
'--js',
'<@(remoting_webapp_wcs_sandbox_html_all_js_files)',
],
},
{
'action_name': 'Build ">(ar_app_name)" loading_window.html',
'inputs': [
'<(DEPTH)/remoting/webapp/build-html.py',
'<(ar_loading_window_template)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html',
],
'action': [
'python', '<(DEPTH)/remoting/webapp/build-html.py',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html',
'<(ar_loading_window_template)',
# The loading window is just a reskin of the message window--all
# JS code is shared.
'--js', '<@(remoting_webapp_message_window_html_all_js_files)',
],
},
{
'action_name': 'Build ">(ar_app_name)" message_window.html',
'inputs': [
'<(DEPTH)/remoting/webapp/build-html.py',
'<(remoting_webapp_template_message_window)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html',
],
'action': [
'python', '<(DEPTH)/remoting/webapp/build-html.py',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html',
'<(remoting_webapp_template_message_window)',
'--js', '<@(remoting_webapp_message_window_html_all_js_files)',
],
},
{
'action_name': 'Build ">(ar_app_name)" feedback_consent.html',
'inputs': [
'<(DEPTH)/remoting/webapp/build-html.py',
'<(ar_feedback_consent_template)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
],
'action': [
'python', '<(DEPTH)/remoting/webapp/build-html.py',
'<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
'<(ar_feedback_consent_template)',
'--template-dir',
'<(DEPTH)/remoting',
'--js',
'<@(ar_feedback_consent_html_all_js_files)',
],
},
], # actions
'conditions': [
['buildtype == "Dev"', {
Expand Down
4 changes: 2 additions & 2 deletions remoting/app_remoting_webapp_compile.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
'target_name': 'verify_background.js',
'variables': {
'source_files': [
'<@(ar_background_js_files)',
'<@(ar_background_html_js_files)',
'<@(remoting_webapp_js_proto_files)',
],
'out_file': '<(PRODUCT_DIR)/>(_target_name)_background_jscompile.stamp',
Expand All @@ -42,4 +42,4 @@
'includes': ['compile_js.gypi'],
},
], # targets
}
}
Loading

0 comments on commit 7d47f7a

Please sign in to comment.