Commit c1fd3a3d authored by garykac's avatar garykac Committed by Commit bot

[Chromoting] Add GN build support for ar_sample_app target.

This adds GN build rules for the AppRemoting sample app.
Some DesktopRemoting build rules were prettified as part of this
process (to make the App- and Desktop- remoting build rules more
similar).

This re-re-lands crrev.com/1126393002 without any additional changes
required. The original issues with the GN clobber builds are fixed in
crrev.com/1137753002. The 2nd attempt to land was rejected due to
a merge race (fixed in this cl).

BUG=471916

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

Cr-Commit-Position: refs/heads/master@{#330243}
parent fc86d6bd
...@@ -92,6 +92,7 @@ ...@@ -92,6 +92,7 @@
'targets': [ 'targets': [
{ {
# GN version: //remoting/webapp:ar_sample_app
# Sample AppRemoting app. # Sample AppRemoting app.
'target_name': 'ar_sample_app', 'target_name': 'ar_sample_app',
'app_key': 'Sample_App', 'app_key': 'Sample_App',
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
'app_remoting_webapp_files.gypi', 'app_remoting_webapp_files.gypi',
], ],
# GN version: See remoting/webapp/build_template.gni
'target_defaults': { 'target_defaults': {
'type': 'none', 'type': 'none',
...@@ -119,7 +120,6 @@ ...@@ -119,7 +120,6 @@
'<(ar_app_manifest_app)', # Manifest template '<(ar_app_manifest_app)', # Manifest template
'app_remoting', # Web app type 'app_remoting', # Web app type
'<@(ar_webapp_files)', '<@(ar_webapp_files)',
'<@(ar_generated_html_files)',
'--locales_listfile', '--locales_listfile',
'<(ar_webapp_locales_listfile)', '<(ar_webapp_locales_listfile)',
'--jinja_paths', '--jinja_paths',
......
...@@ -49,12 +49,11 @@ ...@@ -49,12 +49,11 @@
}, # end of target 'remoting_client' }, # end of target 'remoting_client'
{ {
# GN version: //remoting/webapp:html # GN version: See remoting/webapp/build_template.gni
'target_name': 'remoting_webapp_html', 'target_name': 'remoting_webapp_html',
'type': 'none', 'type': 'none',
'actions': [ 'actions': [
{ {
# GN version: //remoting/webapp:main_html
'action_name': 'Build Remoting Webapp main.html', 'action_name': 'Build Remoting Webapp main.html',
'inputs': [ 'inputs': [
'webapp/build-html.py', 'webapp/build-html.py',
...@@ -75,7 +74,6 @@ ...@@ -75,7 +74,6 @@
], ],
}, },
{ {
# GN version: //remoting/webapp:wcs_sandbox_html
'action_name': 'Build Remoting Webapp wcs_sandbox.html', 'action_name': 'Build Remoting Webapp wcs_sandbox.html',
'inputs': [ 'inputs': [
'webapp/build-html.py', 'webapp/build-html.py',
...@@ -92,7 +90,6 @@ ...@@ -92,7 +90,6 @@
], ],
}, },
{ {
# GN version: //remoting/webapp:background_html
'action_name': 'Build Remoting Webapp background.html', 'action_name': 'Build Remoting Webapp background.html',
'inputs': [ 'inputs': [
'webapp/build-html.py', 'webapp/build-html.py',
...@@ -128,6 +125,7 @@ ...@@ -128,6 +125,7 @@
}, # end of target 'remoting_webapp_html' }, # end of target 'remoting_webapp_html'
{ {
# GN version: //remoting/webapp:webapp
'target_name': 'remoting_webapp', 'target_name': 'remoting_webapp',
'type': 'none', 'type': 'none',
'dependencies': [ 'dependencies': [
...@@ -143,6 +141,7 @@ ...@@ -143,6 +141,7 @@
}, # end of target 'remoting_webapp' }, # end of target 'remoting_webapp'
{ {
# GN version: //remoting/webapp:webapp_v1
'target_name': 'remoting_webapp_v1', 'target_name': 'remoting_webapp_v1',
'type': 'none', 'type': 'none',
'variables': { 'variables': {
...@@ -158,6 +157,7 @@ ...@@ -158,6 +157,7 @@
['disable_nacl==0 and disable_nacl_untrusted==0', { ['disable_nacl==0 and disable_nacl_untrusted==0', {
'targets': [ 'targets': [
{ {
# GN version: //remoting/webapp:webapp_v1
'target_name': 'remoting_webapp_v2', 'target_name': 'remoting_webapp_v2',
'type': 'none', 'type': 'none',
'variables': { 'variables': {
......
...@@ -15,7 +15,7 @@ if (is_chrome_branded) { ...@@ -15,7 +15,7 @@ if (is_chrome_branded) {
# Set these files as being input dependencies to the scripts, so the build will # Set these files as being input dependencies to the scripts, so the build will
# be re-run if the files change. # be re-run if the files change.
_script_deps = [ remoting_version_files = [
_remoting_version_abspath, _remoting_version_abspath,
_chrome_version_abspath, _chrome_version_abspath,
_remoting_branding_abspath, _remoting_branding_abspath,
...@@ -35,7 +35,7 @@ version_major = exec_script(_version_py_abspath, ...@@ -35,7 +35,7 @@ version_major = exec_script(_version_py_abspath,
"-t \"@MAJOR@\"", "-t \"@MAJOR@\"",
], ],
"value", "value",
_script_deps) remoting_version_files)
version_minor = exec_script(_version_py_abspath, version_minor = exec_script(_version_py_abspath,
[ [
...@@ -44,7 +44,7 @@ version_minor = exec_script(_version_py_abspath, ...@@ -44,7 +44,7 @@ version_minor = exec_script(_version_py_abspath,
"-t \"@REMOTING_PATCH@\"", "-t \"@REMOTING_PATCH@\"",
], ],
"value", "value",
_script_deps) remoting_version_files)
version_short = version_short =
"${version_major}.${version_minor}." + exec_script(_version_py_abspath, "${version_major}.${version_minor}." + exec_script(_version_py_abspath,
...@@ -56,7 +56,7 @@ version_short = ...@@ -56,7 +56,7 @@ version_short =
"-t \"@BUILD@\"", "-t \"@BUILD@\"",
], ],
"value", "value",
_script_deps) remoting_version_files)
version_full = "${version_short}." + exec_script(_version_py_abspath, version_full = "${version_short}." + exec_script(_version_py_abspath,
[ [
...@@ -67,7 +67,7 @@ version_full = "${version_short}." + exec_script(_version_py_abspath, ...@@ -67,7 +67,7 @@ version_full = "${version_short}." + exec_script(_version_py_abspath,
"-t \"@PATCH@\"", "-t \"@PATCH@\"",
], ],
"value", "value",
_script_deps) remoting_version_files)
prefpane_bundle_name = exec_script(_version_py_abspath, prefpane_bundle_name = exec_script(_version_py_abspath,
[ [
...@@ -76,7 +76,7 @@ prefpane_bundle_name = exec_script(_version_py_abspath, ...@@ -76,7 +76,7 @@ prefpane_bundle_name = exec_script(_version_py_abspath,
"-t \"@MAC_PREFPANE_BUNDLE_NAME@\"", "-t \"@MAC_PREFPANE_BUNDLE_NAME@\"",
], ],
"string", "string",
_script_deps) remoting_version_files)
host_bundle_name = exec_script(_version_py_abspath, host_bundle_name = exec_script(_version_py_abspath,
[ [
...@@ -85,4 +85,4 @@ host_bundle_name = exec_script(_version_py_abspath, ...@@ -85,4 +85,4 @@ host_bundle_name = exec_script(_version_py_abspath,
"-t \"@MAC_HOST_BUNDLE_NAME@\"", "-t \"@MAC_HOST_BUNDLE_NAME@\"",
], ],
"string", "string",
_script_deps) remoting_version_files)
...@@ -10,6 +10,7 @@ import("//remoting/webapp/build_template.gni") ...@@ -10,6 +10,7 @@ import("//remoting/webapp/build_template.gni")
group("webapp") { group("webapp") {
deps = [ deps = [
":webapp_v1", ":webapp_v1",
":ar_sample_app",
] ]
if (enable_nacl) { if (enable_nacl) {
...@@ -17,17 +18,17 @@ group("webapp") { ...@@ -17,17 +18,17 @@ group("webapp") {
} }
} }
remoting_webapp("webapp_v1") { desktop_remoting_webapp("webapp_v1") {
webapp_type = "v1" webapp_type = "v1"
output_dir = "remoting.webapp" output_dir = "remoting/remoting-webapp"
zip_path = "remoting-webapp.zip" zip_path = "remoting/remoting-webapp.zip"
extra_files = [] extra_files = []
} }
remoting_webapp("webapp_v2") { desktop_remoting_webapp("webapp_v2") {
webapp_type = "v2_pnacl" webapp_type = "v2_pnacl"
output_dir = "remoting.webapp.v2" output_dir = "remoting/remoting-webapp.v2"
zip_path = "remoting-webapp.v2.zip" zip_path = "remoting/remoting-webapp.v2.zip"
extra_files = [ extra_files = [
"crd/remoting_client_pnacl.nmf.jinja2", "crd/remoting_client_pnacl.nmf.jinja2",
# TODO(garykac): Get correct path to this. # TODO(garykac): Get correct path to this.
...@@ -35,91 +36,12 @@ remoting_webapp("webapp_v2") { ...@@ -35,91 +36,12 @@ remoting_webapp("webapp_v2") {
] ]
} }
group("html") { app_remoting_webapp("ar_sample_app") {
deps = [ app_key = "Sample_App"
":background_html", app_id = "ljacajndfccfgnfohlgkdphmbnpkjflk"
":main_html", app_client_id = "sample_client_id"
":message_window_html", app_name = "App Remoting Client"
":wcs_sandbox_html", app_description = "App Remoting client"
] app_capabilities = [ "GOOGLE_DRIVE" ]
} manifest_key = "remotingdevbuild"
action("main_html") {
script = "build-html.py"
inputs = [ remoting_webapp_template_main ] + remoting_webapp_template_files +
remoting_webapp_crd_main_html_all_js_files
outputs = [
"$target_gen_dir/main.html",
]
args = [
rebase_path("$target_gen_dir/main.html", root_build_dir),
rebase_path(remoting_webapp_template_main, root_build_dir),
]
args += [
"--template-dir",
rebase_path(remoting_dir, root_build_dir),
]
args += [ "--templates" ] +
rebase_path(remoting_webapp_template_files, remoting_dir)
args += [ "--js" ] +
rebase_path(remoting_webapp_crd_main_html_all_js_files, remoting_dir)
}
action("wcs_sandbox_html") {
script = "build-html.py"
inputs = [ remoting_webapp_template_wcs_sandbox ] +
remoting_webapp_wcs_sandbox_html_all_js_files
outputs = [
"$target_gen_dir/wcs_sandbox.html",
]
args = [
rebase_path("$target_gen_dir/wcs_sandbox.html", root_build_dir),
rebase_path(remoting_webapp_template_wcs_sandbox, root_build_dir),
]
args +=
[ "--js" ] +
rebase_path(remoting_webapp_wcs_sandbox_html_all_js_files, remoting_dir)
}
action("background_html") {
script = "build-html.py"
inputs = [ remoting_webapp_template_background ] +
remoting_webapp_background_html_all_js_files
outputs = [
"$target_gen_dir/background.html",
]
args = [
rebase_path("$target_gen_dir/background.html", root_build_dir),
rebase_path(remoting_webapp_template_background, root_build_dir),
]
args += [ "--js" ] + rebase_path(remoting_webapp_background_html_all_js_files,
remoting_dir)
}
action("message_window_html") {
script = "build-html.py"
inputs = [ remoting_webapp_template_message_window ] +
remoting_webapp_message_window_html_all_js_files
outputs = [
"$target_gen_dir/message_window.html",
]
args = [
rebase_path("$target_gen_dir/message_window.html", root_build_dir),
rebase_path(remoting_webapp_template_message_window, root_build_dir),
]
args +=
[ "--js" ] + rebase_path(remoting_webapp_message_window_html_all_js_files,
remoting_dir)
} }
...@@ -169,7 +169,7 @@ def buildWebApp(buildtype, version, destination, zip_path, ...@@ -169,7 +169,7 @@ def buildWebApp(buildtype, version, destination, zip_path,
raise raise
else: else:
pass pass
os.mkdir(destination, 0775) os.makedirs(destination, 0775)
if buildtype != 'Official' and buildtype != 'Release' and buildtype != 'Dev': if buildtype != 'Official' and buildtype != 'Release' and buildtype != 'Dev':
raise Exception('Unknown buildtype: ' + buildtype) raise Exception('Unknown buildtype: ' + buildtype)
......
This diff is collapsed.
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
# MM `Mb.YM. , 8M MM `Mb MM MM MM MM YM. , # MM `Mb.YM. , 8M MM `Mb MM MM MM MM YM. ,
# .JMML. .JMM.`Mbmmd' `Moo9^Yo.`Wbmd"MML..JMML JMML JMML.`Mbmmd' # .JMML. .JMM.`Mbmmd' `Moo9^Yo.`Wbmd"MML..JMML JMML JMML.`Mbmmd'
# #
# Please keep this file in sync with remoting/remoting_webapp_files.gypi. # Please keep this file in sync with remoting/remoting_webapp_files.gypi
# and remoting/app_remoting_webapp_files.gypi.
# Jscompile proto files. # Jscompile proto files.
# These provide type information for jscompile. # These provide type information for jscompile.
...@@ -235,13 +236,11 @@ remoting_webapp_js_auth_client2host_files = [ ...@@ -235,13 +236,11 @@ remoting_webapp_js_auth_client2host_files = [
remoting_webapp_js_cast_extension_files = [ "crd/js/cast_extension_handler.js" ] remoting_webapp_js_cast_extension_files = [ "crd/js/cast_extension_handler.js" ]
# Client JavaScript files. # Client JavaScript files.
remoting_webapp_js_client_files = [ "crd/js/video_frame_recorder.js" ] remoting_webapp_js_client_files = [
# Remoting core JavaScript files.
remoting_webapp_js_core_files = [
"crd/js/apps_v2_migration.js", "crd/js/apps_v2_migration.js",
"crd/js/event_handlers.js", "crd/js/event_handlers.js",
"crd/js/gcd_client.js", "crd/js/gcd_client.js",
"crd/js/video_frame_recorder.js",
] ]
# Gnubby authentication JavaScript files. # Gnubby authentication JavaScript files.
...@@ -278,7 +277,6 @@ remoting_webapp_crd_js_ui_files = [ ...@@ -278,7 +277,6 @@ remoting_webapp_crd_js_ui_files = [
"crd/js/crd_auth_dialog.js", "crd/js/crd_auth_dialog.js",
"crd/js/crd_event_handlers.js", "crd/js/crd_event_handlers.js",
"crd/js/crd_experimental.js", "crd/js/crd_experimental.js",
"crd/js/crd_main.js",
"crd/js/desktop_connected_view.js", "crd/js/desktop_connected_view.js",
"crd/js/desktop_remoting.js", "crd/js/desktop_remoting.js",
"crd/js/desktop_remoting_activity.js", "crd/js/desktop_remoting_activity.js",
...@@ -324,7 +322,8 @@ remoting_webapp_shared_main_html_js_files = ...@@ -324,7 +322,8 @@ remoting_webapp_shared_main_html_js_files =
# The CRD-specific JavaScript files required by main.html. # The CRD-specific JavaScript files required by main.html.
remoting_webapp_crd_main_html_all_js_files = remoting_webapp_crd_main_html_all_js_files =
remoting_webapp_shared_main_html_js_files + remoting_webapp_crd_js_ui_files remoting_webapp_shared_main_html_js_files +
remoting_webapp_crd_js_ui_files + [ "crd/js/crd_main.js" ]
# These template files are used to construct main.html. # These template files are used to construct main.html.
remoting_webapp_template_files = [ remoting_webapp_template_files = [
...@@ -353,7 +352,7 @@ remoting_webapp_template_files = [ ...@@ -353,7 +352,7 @@ remoting_webapp_template_files = [
] ]
# #
# Webapp background.html generation files. # DesktopRemoting background.html generation files.
# #
remoting_webapp_template_background = "crd/html/template_background.html" remoting_webapp_template_background = "crd/html/template_background.html"
...@@ -390,7 +389,7 @@ remoting_webapp_background_html_all_js_files += [ ...@@ -390,7 +389,7 @@ remoting_webapp_background_html_all_js_files += [
] ]
# #
# Webapp wcs_sandbox.html generation files. # DesktopRemoting wcs_sandbox.html generation files.
# #
remoting_webapp_template_wcs_sandbox = "base/html/template_wcs_sandbox.html" remoting_webapp_template_wcs_sandbox = "base/html/template_wcs_sandbox.html"
...@@ -413,7 +412,7 @@ remoting_webapp_wcs_sandbox_html_all_js_files += [ ...@@ -413,7 +412,7 @@ remoting_webapp_wcs_sandbox_html_all_js_files += [
] ]
# #
# Webapp message_window.html generation files. # DesktopRemoting message_window.html generation files.
# #
remoting_webapp_template_message_window = remoting_webapp_template_message_window =
...@@ -428,7 +427,7 @@ remoting_webapp_message_window_html_all_js_files = ...@@ -428,7 +427,7 @@ remoting_webapp_message_window_html_all_js_files =
remoting_webapp_message_window_html_js_files + [ "base/js/base.js" ] remoting_webapp_message_window_html_js_files + [ "base/js/base.js" ]
# #
# Complete webapp JS and resource files. # DesktopRemoting webapp JS and resource files.
# #
# All the JavaScript files that are shared by webapps. # All the JavaScript files that are shared by webapps.
...@@ -498,3 +497,114 @@ desktop_remoting_webapp_localizable_files = [ ...@@ -498,3 +497,114 @@ desktop_remoting_webapp_localizable_files = [
"<@(remoting_webapp_template_files)", "<@(remoting_webapp_template_files)",
"<@(remoting_webapp_crd_js_files)", "<@(remoting_webapp_crd_js_files)",
] ]
#
# AppRemoting Files
#
ar_shared_resource_files = [
"app_remoting/html/ar_dialog.css",
"app_remoting/html/ar_main.css",
"app_remoting/html/feedback_consent.css",
"app_remoting/html/loading_window.css",
"app_remoting/html/context_menu.css",
"../resources/drag.webp",
] + remoting_webapp_resource_files
#
# AppRemoting main.html generation files.
#
# These template files are used to construct the webapp html files.
ar_main_template = "app_remoting/html/template_lg.html"
ar_main_template_files = [
"base/html/client_plugin.html",
"app_remoting/html/context_menu.html",
"app_remoting/html/idle_dialog.html",
]
ar_main_js_files = [
"app_remoting/js/application_context_menu.js",
"app_remoting/js/app_connected_view.js",
"app_remoting/js/app_remoting.js",
"app_remoting/js/app_remoting_activity.js",
"app_remoting/js/ar_auth_dialog.js",
"app_remoting/js/ar_main.js",
"app_remoting/js/context_menu_adapter.js",
"app_remoting/js/context_menu_chrome.js",
"app_remoting/js/context_menu_dom.js",
"app_remoting/js/drag_and_drop.js",
"app_remoting/js/idle_detector.js",
"app_remoting/js/keyboard_layouts_menu.js",
"app_remoting/js/loading_window.js",
"app_remoting/js/submenu_manager.js",
"app_remoting/js/window_activation_menu.js",
"base/js/application.js",
"base/js/base.js",
"base/js/message_window_helper.js",
"base/js/message_window_manager.js",
] + remoting_webapp_shared_js_auth_google_files +
remoting_webapp_shared_js_client_files +
remoting_webapp_shared_js_core_files +
remoting_webapp_shared_js_host_files +
remoting_webapp_shared_js_logging_files +
remoting_webapp_shared_js_signaling_files +
remoting_webapp_shared_js_ui_files
#
# AppRemoting feedback_consent.html generation files.
#
ar_feedback_consent_template =
"app_remoting/html/template_feedback_consent.html"
# These JS files are specific to the feedback consent page and are not part
# of the main JS files.
ar_feedback_consent_html_js_files = [ "app_remoting/js/feedback_consent.js" ]
# All the JavaScript files required by feedback_consent.html.
ar_feedback_consent_html_all_js_files = [
"app_remoting/js/feedback_consent.js",
"base/js/base.js",
"base/js/error.js",
"base/js/identity.js",
"base/js/oauth2_api.js",
"base/js/oauth2_api_impl.js",
"base/js/plugin_settings.js",
"base/js/l10n.js",
"base/js/xhr.js",
]
#
# AppRemoting loading_window.html generation files.
#
# Variables for loading_window.html. Note that the JS files are the same as
# for message_window.html, and are not duplicated here.
ar_loading_window_template = "app_remoting/html/template_loading_window.html"
#
# AppRemoting background JS files.
# These files are referenced from the manifest
#
ar_background_js_files = [
"app_remoting/js/ar_background.js",
"base/js/platform.js",
]
ar_all_js_files =
ar_main_js_files + ar_feedback_consent_html_js_files +
remoting_webapp_message_window_html_js_files +
remoting_webapp_wcs_sandbox_html_js_files + ar_background_js_files
# Files that contain localizable strings.
app_remoting_webapp_localizable_files =
[
ar_main_template,
ar_feedback_consent_template,
ar_loading_window_template,
remoting_webapp_template_message_window,
remoting_webapp_template_wcs_sandbox,
] + ar_main_template_files + ar_all_js_files
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment