Skip to content

Commit

Permalink
[Chromoting] Enable remoting webapp main.html GN build.
Browse files Browse the repository at this point in the history
This is a re-land of crrev.com/1082083005

The previous remoting webapp GN build files were not enabled and at
least 6 months out of date. This cl fixes the problem by bringing
the build rules up to date and enables the webapp build.

It also starts to move all the remoting-specific build rules into
the remoting dir rather than having them in the main build.gn file.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#325733}
  • Loading branch information
garykac authored and Commit bot committed Apr 17, 2015
1 parent 391f56c commit 3eddb5b
Show file tree
Hide file tree
Showing 9 changed files with 592 additions and 191 deletions.
15 changes: 2 additions & 13 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import("//build/config/crypto.gni")
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//build/module_args/v8.gni")
import("//remoting/remoting_host.gni")

if (is_android) {
import("//build/config/android/config.gni")
Expand Down Expand Up @@ -139,25 +138,15 @@ group("gn_all") {
deps += [ "//extensions/shell:app_shell_unittests" ]
}

if (enable_me2me_host) {
deps += [ "//remoting/host:remoting_me2me_host" ]
}

if (enable_media_router) {
deps += [
"//chrome/browser/media/router/",
"//chrome/browser/media/router:unit_tests",
]
}

if (enable_remoting_host) {
deps += [
"//remoting:remoting_unittests",
"//remoting:remoting_perftests",
"//remoting/host",
"//remoting/host:remoting_start_host",
"//remoting/host/it2me:remote_assistance_host",
]
if (enable_remoting) {
deps += [ "//remoting:remoting_all" ]
}

if (toolkit_views) {
Expand Down
12 changes: 1 addition & 11 deletions build/gn_migration.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,7 @@
}],
['remoting==1', {
'dependencies': [
'../remoting/remoting.gyp:remoting_host',
'../remoting/remoting.gyp:remoting_it2me_native_messaging_host',
'../remoting/remoting.gyp:remoting_start_host',
'../remoting/remoting.gyp:remoting_native_messaging_manifests',
'../remoting/remoting.gyp:remoting_perftests',
'../remoting/remoting.gyp:remoting_unittests',
],
}],
['remoting==1 and disable_nacl==0 and disable_nacl_untrusted==0', {
'dependencies': [
'../remoting/remoting.gyp:remoting_key_tester',
'../remoting/remoting_all.gyp:remoting_all',
],
}],
['remoting==1 and chromeos==0', {
Expand Down
59 changes: 58 additions & 1 deletion remoting/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,71 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//remoting/remoting_version.gni")
import("//remoting/remoting_host.gni")
import("//remoting/remoting_enable.gni")
import("//testing/test.gni")

# Various remoting targets need this version definition.
config("version") {
defines = [ "VERSION=$version_full" ]
}

group("remoting_all") {
testonly = true

deps = [
#"//remoting:remoting_browser_test_resources",
"//remoting:remoting_unittests",

#"//remoting:remoting_webapp",
"//remoting/webapp:html",

#"//remoting:remoting_webapp_unittests",
#"//app_remoting_test.gyp:ar_sample_test_driver",
#"//app_remoting_webapp.gyp:ar_sample_app",
]

if (is_win) {
deps += [
#"//remoting:remoting_breakpad_tester",
#"//remoting:remoting_console",
#"//remoting:remoting_desktop",
#"//remoting:remoting_host_installation",
]
}

if (is_android) {
deps += [
#"//remoting:remoting_apk",
#"//remoting:remoting_test_apk",
#"//remoting:remoting_unittests_apk",
]
}

if (enable_remoting_host) {
deps += [
"//remoting:remoting_perftests",
"//remoting/host",
"//remoting/host:remoting_start_host",
"//remoting/host/it2me:remote_assistance_host",

#"//remoting:remoting_it2me_native_messaging_host",
#"//remoting:remoting_native_messaging_manifests",
]
}

if (enable_me2me_host) {
deps += [
"//remoting/host:remoting_me2me_host",
#"//remoting/host:remoting_me2me_host_archive",
]
}

# TODO(GYP) Depends on crbug.com/471924 being fixed for PNaCl.
if (enable_nacl) {
deps += [ "//remoting:remoting_key_tester" ]
}
}

# GYP version: remoting/remoting_test.gypi:remoting_test_common
source_set("test_support") {
testonly = true
Expand Down
6 changes: 6 additions & 0 deletions remoting/remoting_all.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@
'../remoting/remoting.gyp:remoting_me2me_native_messaging_host',
],
}],
# TODO(GYP) Depends on crbug.com/471924 being fixed for PNaCl.
['disable_nacl==0 and disable_nacl_untrusted==0', {
'dependencies': [
'../remoting/remoting.gyp:remoting_key_tester',
],
}],
],

}, # end of target 'remoting_all'
Expand Down
25 changes: 25 additions & 0 deletions remoting/remoting_enable.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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.

# Keep in sync with remoting/remoting_enable.gypi.

import("//build/config/ui.gni")

enable_remoting_host = false
enable_me2me_host = false

# TODO(GYP) Make remoting hosts work on Windows and Mac.
#if (is_win || is_mac) {
# enable_remoting_host = true
# enable_me2me_host = true
#}

if (is_linux && !is_chromeos && use_x11) {
enable_remoting_host = true
enable_me2me_host = true
}

if (is_linux && is_chromeos) {
enable_remoting_host = true
}
2 changes: 2 additions & 0 deletions remoting/remoting_enable.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Keep in sync with remoting/remoting_enable.gni.

{
'variables': {
'enable_remoting_host%': 0,
Expand Down
2 changes: 2 additions & 0 deletions remoting/remoting_webapp_files.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Keep in sync with remoting/webapp/files.gni.

{
'variables': {

Expand Down
181 changes: 15 additions & 166 deletions remoting/webapp/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,168 +2,19 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

action("html") {
script = "build-html.py"

remoting_webapp_template_main = "html/template_main.html"
remoting_webapp_template_files = [
"html/butterbar.html",
"html/client_plugin.html",
"html/dialog_auth.html",
"html/dialog_client_connect_failed.html",
"html/dialog_client_connecting.html",
"html/dialog_client_host_needs_upgrade.html",
"html/dialog_client_pin_prompt.html",
"html/dialog_client_session_finished.html",
"html/dialog_client_third_party_auth.html",
"html/dialog_client_unconnected.html",
"html/dialog_confirm_host_delete.html",
"html/dialog_connection_history.html",
"html/dialog_host.html",
"html/dialog_host_install.html",
"html/dialog_host_setup.html",
"html/dialog_manage_pairings.html",
"html/dialog_token_refresh_failed.html",
"html/toolbar.html",
"html/ui_header.html",
"html/ui_it2me.html",
"html/ui_me2me.html",
"html/window_frame.html",
]

# Remoting core JavaScript files.
remoting_webapp_js_core_files = [
"base.js",
"error.js",
"event_handlers.js",
"plugin_settings.js",

# TODO(garykac) Split out UI client stuff from remoting.js.
"remoting.js",
"typecheck.js",
"xhr.js",
]

# Auth (client to host) JavaScript files.
remoting_webapp_js_auth_client2host_files = [
"third_party_host_permissions.js",
"third_party_token_fetcher.js",
]

# Auth (Google account) JavaScript files.
remoting_webapp_js_auth_google_files = [
"identity.js",
"oauth2.js",
"oauth2_api.js",
]

# Client JavaScript files.
remoting_webapp_js_client_files = [
"client_plugin.js",

# TODO(garykac) For client_screen:
# * Split out pin/access code stuff into separate file.
# * Move client logic into session_connector
"client_screen.js",
"client_session.js",
"clipboard.js",
"hangout_session.js",
"session_connector.js",
"smart_reconnector.js",
"video_frame_recorder.js",
]

# gnubby authentication JavaScript files.
remoting_webapp_js_gnubby_auth_files = [ "gnubby_auth_handler.js" ]

# cast extension handler JavaScript files.
remoting_webapp_js_cast_extension_files = [ "cast_extension_handler.js" ]
# Keep in sync with 'remoting_webapp_html' target in
# remoting/remoting_client.gypi.

# Host JavaScript files.
# Includes both it2me and me2me files.
remoting_webapp_js_host_files = [
"host_controller.js",
"host_daemon_facade.js",
"it2me_host_facade.js",
"host_session.js",
]

# Logging and stats JavaScript files.
remoting_webapp_js_logging_files = [
"format_iq.js",
"log_to_server.js",
"server_log_entry.js",
"stats_accumulator.js",
]

# UI JavaScript files.
remoting_webapp_js_ui_files = [
"butter_bar.js",
"connection_stats.js",
"feedback.js",
"fullscreen.js",
"fullscreen_v1.js",
"fullscreen_v2.js",
"l10n.js",
"menu_button.js",
"options_menu.js",
"ui_mode.js",
"toolbar.js",
"window_frame.js",
]

# UI files for controlling the local machine as a host.
remoting_webapp_js_ui_host_control_files = [
"host_screen.js",
"host_setup_dialog.js",
"host_install_dialog.js",
"host_installer.js",
"paired_client_manager.js",
]

# UI files for displaying (in the client) info about available hosts.
remoting_webapp_js_ui_host_display_files = [
"host.js",
"host_list.js",
"host_settings.js",
"host_table_entry.js",
]

# Remoting WCS container JavaScript files.
remoting_webapp_js_wcs_container_files = [ "wcs_sandbox_container.js" ]

# Browser test JavaScript files (uncomment if used below).
#remoting_webapp_js_browser_test_files = [
# "browser_test/browser_test.js",
# "browser_test/bump_scroll_browser_test.js",
# "browser_test/cancel_pin_browser_test.js",
# "browser_test/invalid_pin_browser_test.js",
# "browser_test/update_pin_browser_test.js",
#]

# The JavaScript files required by main.html.
remoting_webapp_main_html_js_files =
# Include the core files first as it is required by the other files.
# Otherwise, Jscompile will complain.
remoting_webapp_js_core_files +
remoting_webapp_js_auth_client2host_files +
remoting_webapp_js_auth_google_files + remoting_webapp_js_client_files +
remoting_webapp_js_gnubby_auth_files +
remoting_webapp_js_cast_extension_files + remoting_webapp_js_host_files +
remoting_webapp_js_logging_files + remoting_webapp_js_ui_files +
remoting_webapp_js_ui_host_control_files +
remoting_webapp_js_ui_host_display_files +
remoting_webapp_js_wcs_container_files
import("//remoting/webapp/files.gni")

# Uncomment this line to include browser test files in the web app
# to expedite debugging or local development.
#+ remoting_webapp_js_browser_test_files
action("html") {
script = "build-html.py"

inputs = [ remoting_webapp_template_main ] + remoting_webapp_template_files +
remoting_webapp_main_html_js_files
remoting_webapp_crd_main_html_all_js_files

outputs = [
"$root_gen_dir/main.html",
"$target_gen_dir/main.html",
]

# Template files are relative to this directory. This passes some template
Expand All @@ -172,19 +23,17 @@ action("html") {
# of these relative to the remoting directory, so this does the same.
template_rel_dir = "//remoting"

# TODO(brettw) It's very bad to put this file named "main" in the root
# generated file directory.
args = [
rebase_path("$root_gen_dir/main.html", template_rel_dir),
rebase_path(remoting_webapp_template_main, template_rel_dir),
rebase_path("$target_gen_dir/main.html", root_build_dir),
rebase_path(remoting_webapp_template_main, root_build_dir),
]
args += [ "--template" ] +
rebase_path(remoting_webapp_template_files, template_rel_dir)
args += [ "--js" ] +
rebase_path(remoting_webapp_main_html_js_files, template_rel_dir)
args += [
"--dir-for-templates",
"--template-dir",
rebase_path(template_rel_dir, root_build_dir),
]
args += [ "--templates" ] +
rebase_path(remoting_webapp_template_files, template_rel_dir)
args += [ "--js" ] + rebase_path(remoting_webapp_crd_main_html_all_js_files,
template_rel_dir)
}
# TODO(GYP) wcs_sandbox.html
# TODO(GYP) wcs_sandbox.html, background.html, message_window.html
Loading

0 comments on commit 3eddb5b

Please sign in to comment.