Commit 31f4de69 authored by brettw's avatar brettw Committed by Commit bot

Add remoting and PPAPI tests to GN build

Reland of https://codereview.chromium.org/961323004
TBR=dpranke

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

Cr-Commit-Position: refs/heads/master@{#319080}
parent 568f4362
...@@ -63,8 +63,10 @@ group("gn_all") { ...@@ -63,8 +63,10 @@ group("gn_all") {
"//mojo", "//mojo",
"//mojo/common:mojo_common_unittests", "//mojo/common:mojo_common_unittests",
"//net:net_unittests", "//net:net_unittests",
"//ppapi:ppapi_unittests",
"//ppapi/examples", # TODO(GYP): What's the GYP equivalent? "//ppapi/examples", # TODO(GYP): What's the GYP equivalent?
"//printing:printing_unittests", "//printing:printing_unittests",
"//remoting:remoting_unittests",
"//skia:skia_unittests", "//skia:skia_unittests",
"//sql:sql_unittests", "//sql:sql_unittests",
"//sync:sync_unit_tests", "//sync:sync_unit_tests",
...@@ -276,8 +278,6 @@ if (is_linux) { ...@@ -276,8 +278,6 @@ if (is_linux) {
# components_browsertests TODO(GYP) # components_browsertests TODO(GYP)
# device_unittests TODO(GYP) # device_unittests TODO(GYP)
# nacl_loader_unittests TODO(GYP) # nacl_loader_unittests TODO(GYP)
# ppapi_unittests TODO(GYP)
# remoting_unittests TODO(GYP)
"//base:base_unittests", # PASSES (*) 2/25/2015 "//base:base_unittests", # PASSES (*) 2/25/2015
"//cc:cc_unittests", # PASSES 2/25/2015 "//cc:cc_unittests", # PASSES 2/25/2015
...@@ -304,7 +304,9 @@ if (is_linux) { ...@@ -304,7 +304,9 @@ if (is_linux) {
"//media:media_unittests", # TODO(GYP) MidiManagerTest fails. "//media:media_unittests", # TODO(GYP) MidiManagerTest fails.
"//mojo/common:mojo_common_unittests", # PASSES 2/25/2015 "//mojo/common:mojo_common_unittests", # PASSES 2/25/2015
"//net:net_unittests", # PASSES 2/25/2015 "//net:net_unittests", # PASSES 2/25/2015
"//ppapi:ppapi_unittests", # PASSES 2/26/2015
"//printing:printing_unittests", # PASSES 2/25/2015 "//printing:printing_unittests", # PASSES 2/25/2015
"//remoting:remoting_unittests", # Some crashes.
"//sandbox/linux:sandbox_linux_unittests", # PASSES 2/25/2015 "//sandbox/linux:sandbox_linux_unittests", # PASSES 2/25/2015
"//skia:skia_unittests", # PASSES 2/25/2015 "//skia:skia_unittests", # PASSES 2/25/2015
"//sql:sql_unittests", # PASSES 2/25/2015 "//sql:sql_unittests", # PASSES 2/25/2015
......
# 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.
import("//build/config/linux/pkg_config.gni")
assert(is_linux, "This file should only be referenced on Linux")
# Depend on //build/config/linux/gtk to use GTK.
#
# GN doesn't check visibility for configs so we give this an obviously internal
# name to discourage random targets from accidentally depending on this and
# bypassing the GTK target's visibility.
pkg_config("gtk_internal_config") {
# Gtk requires gmodule, but it does not list it as a dependency in some
# misconfigured systems.
packages = [
"gmodule-2.0",
"gtk+-2.0",
"gthread-2.0",
]
}
# Basically no parts of Chrome should depend on GTK. To prevent accidents, the
# parts that explicitly need GTK are whitelisted on this target.
group("gtk") {
visibility = [
"//chrome/browser/ui/libgtk2ui",
"//remoting/host",
]
direct_dependent_configs = [ ":gtk_internal_config" ]
}
# Depend on "gtkprint" to get this.
pkg_config("gtkprint_internal_config") {
packages = [ "gtk+-unix-print-2.0" ]
}
group("gtkprint") {
visibility = [ "//chrome/browser/ui/libgtk2ui" ]
direct_dependent_configs = [ ":gtkprint_internal_config" ]
}
...@@ -16,6 +16,7 @@ import("//build/config/win/visual_studio_version.gni") ...@@ -16,6 +16,7 @@ import("//build/config/win/visual_studio_version.gni")
# out_dir (optional) # out_dir (optional)
# Directory to write the generated files to. Defaults to target_gen_dir. # Directory to write the generated files to. Defaults to target_gen_dir.
# #
# deps (optional)
# visibility (optional) # visibility (optional)
template("midl") { template("midl") {
...@@ -82,6 +83,10 @@ template("midl") { ...@@ -82,6 +83,10 @@ template("midl") {
idl_target_platform, idl_target_platform,
"/Oicf", "/Oicf",
] ]
if (defined(invoker.deps)) {
deps = invoker.deps
}
} }
source_set(target_name) { source_set(target_name) {
......
...@@ -5,21 +5,6 @@ ...@@ -5,21 +5,6 @@
assert(is_linux, "This file should only be referenced on Linux") assert(is_linux, "This file should only be referenced on Linux")
import("//build/config/features.gni") import("//build/config/features.gni")
import("//build/config/linux/pkg_config.gni")
pkg_config("gtk") {
# Gtk requires gmodule, but it does not list it as a dependency in some
# misconfigured systems.
packages = [
"gmodule-2.0",
"gtk+-2.0",
"gthread-2.0",
]
}
pkg_config("gtkprint") {
packages = [ "gtk+-unix-print-2.0" ]
}
component("libgtk2ui") { component("libgtk2ui") {
sources = [ sources = [
...@@ -79,8 +64,6 @@ component("libgtk2ui") { ...@@ -79,8 +64,6 @@ component("libgtk2ui") {
defines = [ "LIBGTK2UI_IMPLEMENTATION" ] defines = [ "LIBGTK2UI_IMPLEMENTATION" ]
configs += [ configs += [
":gtk",
":gtkprint",
"//build/config/linux:gconf", "//build/config/linux:gconf",
"//printing:cups", "//printing:cups",
] ]
...@@ -109,6 +92,8 @@ component("libgtk2ui") { ...@@ -109,6 +92,8 @@ component("libgtk2ui") {
"//base", "//base",
"//base/third_party/dynamic_annotations", "//base/third_party/dynamic_annotations",
"//base:i18n", "//base:i18n",
"//build/config/linux/gtk",
"//build/config/linux/gtk:gtkprint",
"//chrome/app/theme:theme_resources", "//chrome/app/theme:theme_resources",
"//chrome:extra_resources", "//chrome:extra_resources",
"//chrome:resources", "//chrome:resources",
......
...@@ -27,6 +27,8 @@ copy("copy_test_files2") { ...@@ -27,6 +27,8 @@ copy("copy_test_files2") {
} }
import("//ppapi/ppapi_sources.gni") import("//ppapi/ppapi_sources.gni")
import("//testing/test.gni")
shared_library("ppapi_tests") { shared_library("ppapi_tests") {
sources = ppapi_sources.test_common_source_files + sources = ppapi_sources.test_common_source_files +
ppapi_sources.test_trusted_source_files ppapi_sources.test_trusted_source_files
...@@ -41,4 +43,76 @@ shared_library("ppapi_tests") { ...@@ -41,4 +43,76 @@ shared_library("ppapi_tests") {
":copy_test_files2", ":copy_test_files2",
] ]
} }
# TODO(GYP) other targets from ppapi_tests.gyp
test("ppapi_unittests") {
sources = [
"host/resource_message_filter_unittest.cc",
"proxy/device_enumeration_resource_helper_unittest.cc",
"proxy/file_chooser_resource_unittest.cc",
"proxy/file_system_resource_unittest.cc",
"proxy/flash_resource_unittest.cc",
"proxy/interface_list_unittest.cc",
"proxy/mock_resource.cc",
"proxy/mock_resource.h",
"proxy/nacl_message_scanner_unittest.cc",
"proxy/pdf_resource_unittest.cc",
"proxy/plugin_dispatcher_unittest.cc",
"proxy/plugin_resource_tracker_unittest.cc",
"proxy/plugin_var_tracker_unittest.cc",
"proxy/ppb_var_unittest.cc",
"proxy/ppp_instance_private_proxy_unittest.cc",
"proxy/ppp_instance_proxy_unittest.cc",
"proxy/ppp_messaging_proxy_unittest.cc",
"proxy/printing_resource_unittest.cc",
"proxy/raw_var_data_unittest.cc",
"proxy/serialized_var_unittest.cc",
"proxy/talk_resource_unittest.cc",
"proxy/video_decoder_resource_unittest.cc",
"proxy/video_encoder_resource_unittest.cc",
"proxy/websocket_resource_unittest.cc",
"shared_impl/media_stream_audio_track_shared_unittest.cc",
"shared_impl/media_stream_buffer_manager_unittest.cc",
"shared_impl/media_stream_video_track_shared_unittest.cc",
"shared_impl/proxy_lock_unittest.cc",
"shared_impl/resource_tracker_unittest.cc",
"shared_impl/thread_aware_callback_unittest.cc",
"shared_impl/time_conversion_unittest.cc",
"shared_impl/tracked_callback_unittest.cc",
"shared_impl/var_tracker_unittest.cc",
]
deps = [
"//base/allocator",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//gpu/ipc",
"//ipc",
"//ipc:test_support",
"//media:shared_memory_support",
"//ppapi/host",
"//ppapi/proxy",
"//ppapi/proxy:test_support",
"//ppapi/shared_impl",
"//ppapi/shared_impl:test_support",
"//testing/gmock",
"//testing/gtest",
"//ui/surface",
]
}
test("ppapi_perftests") {
sources = [
"proxy/ppapi_perftests.cc",
"proxy/ppp_messaging_proxy_perftest.cc",
]
deps = [
"//base/allocator",
"//base/test:test_support",
"//ppapi/proxy",
"//ppapi/proxy:test_support",
"//ppapi/shared_impl",
"//ppapi/shared_impl:test_support",
"//testing/gtest",
]
}
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
{ {
'targets': [ 'targets': [
{ {
# GN version: //ppapi:ppapi_host # GN version: //ppapi/host
'target_name': 'ppapi_host', 'target_name': 'ppapi_host',
'type': '<(component)', 'type': '<(component)',
'dependencies': [ 'dependencies': [
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
{ {
'targets': [ 'targets': [
{ {
# GN version: //ppapi:ppapi_tests
'target_name': 'ppapi_tests', 'target_name': 'ppapi_tests',
'type': 'loadable_module', 'type': 'loadable_module',
'include_dirs': [ 'include_dirs': [
...@@ -106,6 +107,7 @@ ...@@ -106,6 +107,7 @@
}, },
{ {
# GN version: //ppapi:ppapi_perftests
'target_name': 'ppapi_perftests', 'target_name': 'ppapi_perftests',
'type': 'executable', 'type': 'executable',
'variables': { 'variables': {
...@@ -132,6 +134,7 @@ ...@@ -132,6 +134,7 @@
], ],
}, },
{ {
# GN version: //ppapi:ppapi_unittests
'target_name': 'ppapi_unittests', 'target_name': 'ppapi_unittests',
'type': 'executable', 'type': 'executable',
'variables': { 'variables': {
...@@ -153,6 +156,7 @@ ...@@ -153,6 +156,7 @@
'../ui/surface/surface.gyp:surface', '../ui/surface/surface.gyp:surface',
], ],
'sources': [ 'sources': [
# Note: sources list duplicated in GN build.
'host/resource_message_filter_unittest.cc', 'host/resource_message_filter_unittest.cc',
'proxy/device_enumeration_resource_helper_unittest.cc', 'proxy/device_enumeration_resource_helper_unittest.cc',
'proxy/file_chooser_resource_unittest.cc', 'proxy/file_chooser_resource_unittest.cc',
......
# 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.
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//remoting/remoting_version.gni")
import("//testing/test.gni")
enable_remoting_host = is_win || is_mac || is_chromeos || use_x11
# Various remoting targets need this version definition.
config("version") {
defines = [ "VERSION=$version_full" ]
}
# GYP version: remoting/remoting_test.gypi:remoting_test_common
source_set("test_support") {
testonly = true
sources = [
# Files from remoting_test_common not in separate test_support targets.
"signaling/fake_signal_strategy.cc",
"signaling/fake_signal_strategy.h",
"signaling/mock_signal_strategy.cc",
"signaling/mock_signal_strategy.h",
"test/access_token_fetcher.cc",
"test/app_remoting_test_driver_environment.cc",
"test/fake_access_token_fetcher.cc",
"test/fake_network_dispatcher.cc",
"test/fake_network_dispatcher.h",
"test/fake_network_manager.cc",
"test/fake_network_manager.h",
"test/fake_port_allocator.cc",
"test/fake_port_allocator.h",
"test/fake_socket_factory.cc",
"test/fake_socket_factory.h",
"test/leaky_bucket.cc",
"test/leaky_bucket.h",
"test/mock_access_token_fetcher.cc",
"test/refresh_token_store.cc",
]
deps = [
"//base",
"//components/policy:test_support",
"//net",
"//remoting/base",
"//remoting/client",
"//remoting/codec",
"//remoting/protocol:test_support",
"//remoting/resources",
"//testing/gmock",
"//testing/gtest",
]
if (enable_remoting_host) {
deps += [ "//remoting/host:test_support" ]
}
}
# TODO(GYP) remoting_unittests on Windows. Currently this fails with a
# duplicate resource error on linking.
if (!is_win) {
test("remoting_unittests") {
# Sources not included in one of the more specific unit_tests deps.
sources = [
"signaling/iq_sender_unittest.cc",
"signaling/log_to_server_unittest.cc",
"signaling/server_log_entry_unittest.cc",
"signaling/server_log_entry_unittest.h",
"test/access_token_fetcher_unittest.cc",
"test/app_remoting_test_driver_environment_unittest.cc",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":test_support",
"//base/allocator",
"//google_apis",
"//remoting/base:unit_tests",
"//remoting/client:unit_tests",
"//remoting/protocol:unit_tests",
"//testing/gmock",
"//testing/gtest",
"//third_party/webrtc",
]
if (is_android) {
deps += [ "//testing/android:native_test_native_code" ]
} else {
deps += [ "//remoting/client/plugin" ]
}
if (enable_remoting_host) {
deps += [
"//remoting/codec:unit_tests",
"//remoting/host:unit_tests",
]
}
if (enable_webrtc) {
deps += [
"//third_party/libjingle:libjingle_webrtc",
"//third_party/libjingle:libpeerconnection",
]
}
}
} else {
group("remoting_unittests") {
}
}
...@@ -2,13 +2,12 @@ ...@@ -2,13 +2,12 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
static_library("base") { import("//remoting/remoting_srcs.gni")
gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("../remoting_srcs.gypi") ],
"scope",
[ "../remoting_srcs.gypi" ])
sources = rebase_path(gypi_values.remoting_base_sources, ".", "//remoting") source_set("base") {
sources = rebase_path(remoting_srcs_gypi_values.remoting_base_sources,
".",
"//remoting")
configs += [ "//build/config/compiler:wexit_time_destructors" ] configs += [ "//build/config/compiler:wexit_time_destructors" ]
...@@ -25,10 +24,43 @@ static_library("base") { ...@@ -25,10 +24,43 @@ static_library("base") {
"//remoting/resources", "//remoting/resources",
"//third_party/libvpx", "//third_party/libvpx",
"//third_party/libyuv", "//third_party/libyuv",
"//third_party/opus",
"//third_party/webrtc/modules/desktop_capture", "//third_party/webrtc/modules/desktop_capture",
"//ui/base", "//ui/base",
"//ui/gfx",
"//ui/gfx/geometry",
] ]
} }
source_set("unit_tests") {
testonly = true
sources = [
"auto_thread_task_runner_unittest.cc",
"auto_thread_unittest.cc",
"breakpad_win_unittest.cc",
"buffered_socket_writer_unittest.cc",
"capabilities_unittest.cc",
"compound_buffer_unittest.cc",
"rate_counter_unittest.cc",
"rsa_key_pair_unittest.cc",
"run_all_unittests.cc",
"running_average_unittest.cc",
"test_rsa_key_pair.h",
"typed_buffer_unittest.cc",
"util_unittest.cc",
]
deps = [
":base",
"//base",
"//net:test_support",
"//testing/gmock",
"//testing/gtest",
"//third_party/libyuv",
"//third_party/webrtc/modules/desktop_capture",
]
if (is_win || is_mac || is_chromeos) {
sources += [ "resources_unittest.cc" ]
deps += [ "//breakpad:client" ]
}
}
...@@ -2,24 +2,48 @@ ...@@ -2,24 +2,48 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//remoting/remoting_version.gni") import("//remoting/remoting_srcs.gni")
static_library("client") { source_set("client") {
gypi_values = exec_script("//build/gypi_to_gn.py", sources = rebase_path(remoting_srcs_gypi_values.remoting_client_sources,
[ rebase_path("../remoting_srcs.gypi") ], ".",
"scope", "//remoting")
[ "../remoting_srcs.gypi" ])
sources = rebase_path(gypi_values.remoting_client_sources, ".", "//remoting") configs += [
"//build/config/compiler:wexit_time_destructors",
configs += [ "//build/config/compiler:wexit_time_destructors" ] "//remoting:version",
]
defines = [ "VERSION=$version_full" ]
deps = [ deps = [
"//remoting/base", "//remoting/base",
"//remoting/codec",
"//remoting/protocol", "//remoting/protocol",
"//third_party/libyuv", "//third_party/libyuv",
"//third_party/webrtc/modules/desktop_capture", "//third_party/webrtc/modules/desktop_capture",
] ]
} }
source_set("unit_tests") {
testonly = true
sources = [
"audio_player_unittest.cc",
"client_status_logger_unittest.cc",
"key_event_mapper_unittest.cc",
"plugin/empty_cursor_filter_unittest.cc",
"plugin/normalizing_input_filter_mac_unittest.cc",
"server_log_entry_client_unittest.cc",
]
if (is_chromeos) {
sources += [ "plugin/normalizing_input_filter_cros_unittest.cc" ]
}
deps = [
":client",
"//remoting/proto",
"//testing/gmock",
"//testing/gtest",
"//third_party/webrtc",
]
}
...@@ -2,16 +2,22 @@ ...@@ -2,16 +2,22 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
static_library("plugin") { import("//remoting/remoting_srcs.gni")
gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("../../remoting_srcs.gypi") ],
"scope",
[ "../../remoting_srcs.gypi" ])
source_set("plugin") {
sources = sources =
rebase_path(gypi_values.remoting_client_plugin_sources, ".", "//remoting") rebase_path(remoting_srcs_gypi_values.remoting_client_plugin_sources,
".",
"//remoting")
# TODO(brettw) when a nacl version of this target is made, these files if (!is_chromeos) {
sources -= [
"normalizing_input_filter_cros.cc",
"normalizing_input_filter_cros.h",
]
}
# TODO(GYP) when a nacl version of this target is made, these files
# won't be part of it. # won't be part of it.
sources += [ sources += [
"pepper_entrypoints.cc", "pepper_entrypoints.cc",
...@@ -28,6 +34,7 @@ static_library("plugin") { ...@@ -28,6 +34,7 @@ static_library("plugin") {
"//ppapi/cpp/private:internal_module", "//ppapi/cpp/private:internal_module",
"//remoting/base", "//remoting/base",
"//remoting/client", "//remoting/client",
"//remoting/codec",
"//remoting/protocol", "//remoting/protocol",
"//third_party/webrtc/modules/desktop_capture", "//third_party/webrtc/modules/desktop_capture",
"//ui/events:dom4_keycode_converter", "//ui/events:dom4_keycode_converter",
......
# 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.
import("//remoting/remoting_srcs.gni")
source_set("codec") {
sources = rebase_path(remoting_srcs_gypi_values.remoting_codec_sources,
".",
"//remoting")
configs += [ "//build/config/compiler:wexit_time_destructors" ]
deps = [
"//base/third_party/dynamic_annotations",
"//media",
"//media:shared_memory_support",
"//remoting/proto",
"//remoting/resources",
"//third_party/libvpx",
"//third_party/libyuv",
"//third_party/opus",
"//third_party/webrtc/modules/desktop_capture",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"audio_encoder_opus_unittest.cc",
"codec_test.cc",
"codec_test.h",
"video_decoder_vpx_unittest.cc",
"video_encoder_helper_unittest.cc",
"video_encoder_verbatim_unittest.cc",
"video_encoder_vpx_unittest.cc",
]
deps = [
":codec",
"//base",
"//remoting/proto",
"//testing/gtest",
"//third_party/webrtc/modules/desktop_capture",
]
}
...@@ -4,15 +4,22 @@ ...@@ -4,15 +4,22 @@
import("//build/config/features.gni") import("//build/config/features.gni")
import("//build/config/ui.gni") import("//build/config/ui.gni")
import("//remoting/remoting_locales.gni")
import("//remoting/remoting_srcs.gni")
import("//remoting/remoting_version.gni") import("//remoting/remoting_version.gni")
import("//remoting/tools/build/remoting_localize.gni")
# This must be a static library instead of a source set because
# remoting_unittests requires that remoting_me2me_host.cc not be pulled in,
# which in turn depends on remoting_me2me_host_static which isn't part of that
# build.
#
# TODO fix this, successful builds should not depend on static libraries
# stripping code.
static_library("host") { static_library("host") {
gypi_values = exec_script("//build/gypi_to_gn.py", sources = rebase_path(remoting_host_srcs_gypi_values.remoting_host_sources,
[ rebase_path("../remoting_host_srcs.gypi") ], ".",
"scope", "//remoting")
[ "../remoting_host_srcs.gypi" ])
sources = rebase_path(gypi_values.remoting_host_sources, ".", "//remoting")
libs = [] libs = []
...@@ -40,15 +47,25 @@ static_library("host") { ...@@ -40,15 +47,25 @@ static_library("host") {
if (use_x11) { if (use_x11) {
configs += [ configs += [
# TODO(kelvinp): Add GTK to the configs.
"//build/config/linux:x11", "//build/config/linux:x11",
"//build/config/linux:xrandr",
] ]
if (!is_chromeos) {
deps += [ "//build/config/linux/gtk" ]
}
} else { } else {
sources -= [ sources -= [
"clipboard_x11.cc", "clipboard_x11.cc",
"linux/x_server_clipboard.cc", "input_injector_x11.cc",
"linux/x_server_clipboard.h", "local_input_monitor_x11.cc",
] ]
if (is_linux) {
# These will already be filtered out on non-Linux.
sources -= [
"linux/x_server_clipboard.cc",
"linux/x_server_clipboard.h",
]
}
} }
if (is_chromeos) { if (is_chromeos) {
...@@ -66,8 +83,11 @@ static_library("host") { ...@@ -66,8 +83,11 @@ static_library("host") {
deps += [ "//ash" ] deps += [ "//ash" ]
} }
if (use_ozone) { if (!use_x11) {
sources -= [ "input_injector_x11.cc" ] sources -= [ "input_injector_x11.cc" ]
}
if (use_ozone) {
deps += [ "//ui/ozone" ] deps += [ "//ui/ozone" ]
} else { } else {
sources -= [ sources -= [
...@@ -76,21 +96,27 @@ static_library("host") { ...@@ -76,21 +96,27 @@ static_library("host") {
"input_injector_chromeos.h", "input_injector_chromeos.h",
"linux/x_server_clipboard.cc", "linux/x_server_clipboard.cc",
"linux/x_server_clipboard.h", "linux/x_server_clipboard.h",
"local_input_monitor_x11.cc",
] ]
} }
sources -= [ sources -= [
"continue_window_linux.cc", "continue_window_linux.cc",
"disconnect_window_linux.cc", "disconnect_window_linux.cc",
"local_input_monitor_x11.cc",
] ]
} }
if (is_mac) { if (is_mac) {
defines += [ # TODO(GYP) Mac host_bundle_name and prefpane_bundle_name.
"HOST_BUNDLE_NAME=\"$host_bundle_name\"", # Note if you are looking at this: It really sucks to have to synchronously
"PREFPANE_BUNDLE_NAME=\"$prefpane_bundle_name\"", # call into python twice to get these values. They should instead be
] # written into a generated header via the process_version template, and we
# change the source files to include that header rather than rely on these
# defines being set in the build.
#defines += [
# "HOST_BUNDLE_NAME=\"$host_bundle_name\"",
# "PREFPANE_BUNDLE_NAME=\"$prefpane_bundle_name\"",
#]
libs += [ libs += [
"Accelerate.framework", "Accelerate.framework",
...@@ -100,12 +126,205 @@ static_library("host") { ...@@ -100,12 +126,205 @@ static_library("host") {
deps += [ "//google_toolbox_for_mac" ] deps += [ "//google_toolbox_for_mac" ]
} }
if (is_win) {
deps += [
":messages",
":remoting_lib_idl",
]
}
if (enable_webrtc) { if (enable_webrtc) {
deps += [ deps += [
"//third_party/libjingle:libpeerconnection", "//third_party/libjingle:libpeerconnection",
"//third_party/webrtc/modules/desktop_capture", "//third_party/webrtc/modules/desktop_capture",
] ]
sources += rebase_path(gypi_values.remoting_cast_sources, ".", "//remoting") sources += rebase_path(remoting_host_srcs_gypi_values.remoting_cast_sources,
".",
"//remoting")
}
}
source_set("test_support") {
testonly = true
sources = [
"fake_desktop_capturer.cc",
"fake_desktop_capturer.h",
"fake_desktop_environment.cc",
"fake_desktop_environment.h",
"fake_host_extension.cc",
"fake_host_extension.h",
"fake_host_status_monitor.h",
"fake_host_status_monitor.h",
"fake_mouse_cursor_monitor.cc",
"fake_mouse_cursor_monitor.h",
]
deps = [
"//remoting/proto",
"//testing/gtest",
]
public_deps = [
":host",
]
if (enable_webrtc) {
public_deps += [
"//third_party/libjingle:libpeerconnection",
"//third_party/webrtc/modules/desktop_capture",
]
}
}
# The host portions of the remoting unit tests.
source_set("unit_tests") {
testonly = true
sources = [
"audio_pump_unittest.cc",
"audio_silence_detector_unittest.cc",
"capture_scheduler_unittest.cc",
"chromeos/aura_desktop_capturer_unittest.cc",
"chromeos/clipboard_aura_unittest.cc",
"chromoting_host_context_unittest.cc",
"chromoting_host_unittest.cc",
"client_session_unittest.cc",
"config_file_watcher_unittest.cc",
"daemon_process_unittest.cc",
"desktop_process_unittest.cc",
"desktop_shape_tracker_unittest.cc",
"gnubby_auth_handler_posix_unittest.cc",
"heartbeat_sender_unittest.cc",
"host_change_notification_listener_unittest.cc",
"host_config_unittest.cc",
"host_extension_session_manager_unittest.cc",
"host_mock_objects.cc",
"host_status_logger_unittest.cc",
"ipc_desktop_environment_unittest.cc",
"it2me/it2me_confirmation_dialog_proxy_unittest.cc",
"it2me/it2me_native_messaging_host_unittest.cc",
"linux/audio_pipe_reader_unittest.cc",
"linux/unicode_to_keysym_unittest.cc",
"linux/x_server_clipboard_unittest.cc",
"local_input_monitor_unittest.cc",
"mouse_shape_pump_unittest.cc",
"native_messaging/native_messaging_reader_unittest.cc",
"native_messaging/native_messaging_writer_unittest.cc",
"pairing_registry_delegate_linux_unittest.cc",
"pairing_registry_delegate_win_unittest.cc",
"pin_hash_unittest.cc",
"policy_watcher_unittest.cc",
"register_support_host_request_unittest.cc",
"remote_input_filter_unittest.cc",
"resizing_host_observer_unittest.cc",
"screen_resolution_unittest.cc",
"server_log_entry_host_unittest.cc",
"setup/me2me_native_messaging_host_unittest.cc",
"setup/oauth_helper_unittest.cc",
"setup/pin_validator_unittest.cc",
"shaped_desktop_capturer_unittest.cc",
"token_validator_factory_impl_unittest.cc",
"video_frame_pump_unittest.cc",
"video_frame_recorder_unittest.cc",
"win/rdp_client_unittest.cc",
"win/worker_process_launcher.cc",
"win/worker_process_launcher.h",
"win/worker_process_launcher_unittest.cc",
]
if (use_ozone || is_chromeos) {
sources -= [ "local_input_monitor_unittest.cc" ]
}
if (is_chromeos) {
sources -= [ "linux/x_server_clipboard_unittest.cc" ]
}
deps = [
":host",
":test_support",
"//components/policy:policy_component_test_support",
"//remoting/host/setup",
"//remoting/host/it2me:common",
"//remoting/host/native_messaging",
"//remoting/proto",
"//skia",
"//testing/gmock",
"//testing/gtest",
]
}
if (is_win) {
import("//build/toolchain/win/midl.gni")
import("//remoting/tools/build/message_compiler.gni")
# TODO(brettw) these should not be generated via exec_script. This should be
# part of the build process rather than the metabuild. Instead, a script
# should generate a header containing the #defines for this as well as the
# IDL file with the values.
clsids = exec_script("win/get_clsids.py",
[
remoting_srcs_gypi_values.daemon_controller_guid,
remoting_srcs_gypi_values.rdp_desktop_session_guid,
version_full,
],
"value")
daemon_controller_clsid = clsids[0]
rdp_desktop_session_clsid = clsids[1]
action("generate_idl") {
script = "//build/util/version.py"
inputs = [
"win/chromoting_lib_idl.templ",
]
outputs = [
"$target_gen_dir/chromoting_lib.idl",
]
args = [
"-e",
"DAEMON_CONTROLLER_CLSID='$daemon_controller_clsid'",
"-e",
"RDP_DESKTOP_SESSION_CLSID='$rdp_desktop_session_clsid'",
rebase_path(inputs[0], root_build_dir),
rebase_path(outputs[0], root_build_dir),
]
}
midl("remoting_lib_idl") {
sources = get_target_outputs(":generate_idl")
deps = [
":generate_idl",
]
}
# Makes the .mc file from the .mc.jinja file.
remoting_localize("messages_localizing") {
sources = [
"win/host_messages.mc.jinja2",
]
locales = remoting_locales
locale_dir = webapp_locale_dir
encoding = "utf-16"
# This target is funny. It only produces one file and the output doesn't
# match the input. We want to generate remoting_host_messages.mc from
# host_messages.mg.jinja2. GN complains if it doesn't see a pattern in the
# output, so the following pattern produces the name we want with a template
# based on the input.
#
# TODO: This is for GYP compat. We should just make the names match instead.
output = "$target_gen_dir/remoting_{{source_name_part}}"
} }
# Makes the .h/.rc files from the .mc file.
message_compiler("messages") {
sources = get_target_outputs(":messages_localizing")
deps = [
":messages_localizing",
]
}
# TODO(GYP) More Windows remoting targets from remoting_host_win.gypi
} }
...@@ -15,10 +15,9 @@ ...@@ -15,10 +15,9 @@
#include "net/base/ip_endpoint.h" #include "net/base/ip_endpoint.h"
#include "remoting/host/host_status_monitor.h" #include "remoting/host/host_status_monitor.h"
#include "remoting/host/host_status_observer.h" #include "remoting/host/host_status_observer.h"
#include "remoting/host/remoting_host_messages.h"
#include "remoting/protocol/transport.h" #include "remoting/protocol/transport.h"
#include "remoting_host_messages.h"
namespace remoting { namespace remoting {
namespace { namespace {
......
...@@ -3,20 +3,18 @@ ...@@ -3,20 +3,18 @@
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/features.gni") import("//build/config/features.gni")
import("//build/config/ui.gni") import("//remoting/remoting_srcs.gni")
import("//remoting/remoting_version.gni")
static_library("common") { source_set("common") {
gypi_values = exec_script("//build/gypi_to_gn.py", sources = rebase_path(
[ rebase_path("../../remoting_host_srcs.gypi") ], remoting_host_srcs_gypi_values.remoting_it2me_host_static_sources,
"scope", ".",
[ "../../remoting_host_srcs.gypi" ]) "//remoting")
sources = rebase_path(gypi_values.remoting_it2me_host_static_sources, configs += [
".", "//build/config/compiler:wexit_time_destructors",
"//remoting") "//remoting:version",
]
configs += [ "//build/config/compiler:wexit_time_destructors" ]
deps = [ deps = [
"//base:i18n", "//base:i18n",
...@@ -26,6 +24,4 @@ static_library("common") { ...@@ -26,6 +24,4 @@ static_library("common") {
"//remoting/protocol", "//remoting/protocol",
"//remoting/resources", "//remoting/resources",
] ]
defines = [ "VERSION=$version_full" ]
} }
# 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.
import("//remoting/remoting_srcs.gni")
# GYP version: remoting/remoting_host.gypi:remoting_native_messaging_base
source_set("native_messaging") {
sources = rebase_path(
remoting_host_srcs_gypi_values.remoting_host_native_messaging_sources,
".",
"//remoting")
configs += [ "//build/config/compiler:wexit_time_destructors" ]
deps = [
"//base",
]
}
# 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.
import("//remoting/remoting_srcs.gni")
source_set("setup") {
sources =
rebase_path(remoting_host_srcs_gypi_values.remoting_host_setup_sources,
".",
"//remoting")
configs += [
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
"//build/config/compiler:wexit_time_destructors",
"//remoting:version",
]
deps = [
"//base",
"//google_apis",
"//remoting/host",
]
if (is_win) {
deps += [
"//google_update",
"//remoting/host:remoting_lib_idl",
]
}
}
# 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.
# Each CLSID is a hash of the current version string salted with an
# arbitrary GUID. This ensures that the newly installed COM classes will
# be used during/after upgrade even if there are old instances running
# already.
# The IDs are not random to avoid rebuilding host when it's not
# necessary.
import uuid
import sys
if len(sys.argv) != 4:
print """Expecting 3 args:
<daemon_controller_guid> <rdp_desktop_session_guid> <version>"""
sys.exit(1)
daemon_controller_guid = sys.argv[1]
rdp_desktop_session_guid = sys.argv[2]
version_full = sys.argv[3]
# Output a GN list of 2 strings.
print '["' + \
str(uuid.uuid5(uuid.UUID(daemon_controller_guid), version_full)) + '", '
print '"' + \
str(uuid.uuid5(uuid.UUID(rdp_desktop_session_guid), version_full)) + '"]'
...@@ -2,14 +2,12 @@ ...@@ -2,14 +2,12 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
static_library("protocol") { import("//remoting/remoting_srcs.gni")
gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("../remoting_srcs.gypi") ],
"scope",
[ "../remoting_srcs.gypi" ])
sources = source_set("protocol") {
rebase_path(gypi_values.remoting_protocol_sources, ".", "//remoting") sources = rebase_path(remoting_srcs_gypi_values.remoting_protocol_sources,
".",
"//remoting")
configs += [ configs += [
"//build/config/compiler:no_size_t_to_int_warning", "//build/config/compiler:no_size_t_to_int_warning",
...@@ -17,6 +15,7 @@ static_library("protocol") { ...@@ -17,6 +15,7 @@ static_library("protocol") {
] ]
public_deps = [ public_deps = [
"//remoting/proto",
"//third_party/libjingle", "//third_party/libjingle",
] ]
deps = [ deps = [
...@@ -26,5 +25,66 @@ static_library("protocol") { ...@@ -26,5 +25,66 @@ static_library("protocol") {
"//jingle:notifier", "//jingle:notifier",
"//net", "//net",
"//remoting/base", "//remoting/base",
"//remoting/codec",
]
}
source_set("test_support") {
testonly = true
sources = [
"fake_authenticator.cc",
"fake_authenticator.h",
"fake_datagram_socket.cc",
"fake_datagram_socket.h",
"fake_session.cc",
"fake_session.h",
"fake_stream_socket.cc",
"fake_stream_socket.h",
"protocol_mock_objects.cc",
"protocol_mock_objects.h",
]
public_deps = [
":protocol",
"//testing/gmock",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"authenticator_test_base.cc",
"authenticator_test_base.h",
"channel_multiplexer_unittest.cc",
"chromium_socket_factory_unittest.cc",
"client_video_dispatcher_unittest.cc",
"clipboard_echo_filter_unittest.cc",
"clipboard_filter_unittest.cc",
"connection_tester.cc",
"connection_tester.h",
"connection_to_client_unittest.cc",
"content_description_unittest.cc",
"input_event_tracker_unittest.cc",
"input_filter_unittest.cc",
"jingle_messages_unittest.cc",
"jingle_session_unittest.cc",
"message_decoder_unittest.cc",
"message_reader_unittest.cc",
"monitored_video_stub_unittest.cc",
"mouse_input_filter_unittest.cc",
"negotiating_authenticator_unittest.cc",
"pairing_registry_unittest.cc",
"ppapi_module_stub.cc",
"ssl_hmac_channel_authenticator_unittest.cc",
"third_party_authenticator_unittest.cc",
"v2_authenticator_unittest.cc",
]
deps = [
":test_support",
"//testing/gmock",
"//testing/gtest",
] ]
} }
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
# The IDs are not random to avoid rebuilding host when it's not # The IDs are not random to avoid rebuilding host when it's not
# necessary. # necessary.
'daemon_controller_clsid': 'daemon_controller_clsid':
'<!(python -c "import uuid; print uuid.uuid5(uuid.UUID(\'655bd819-c08c-4b04-80c2-f160739ff6ef\'), \'<(version_full)\')")', '<!(python -c "import uuid; print uuid.uuid5(uuid.UUID(\'<(daemon_controller_guid)\'), \'<(version_full)\')")',
'rdp_desktop_session_clsid': 'rdp_desktop_session_clsid':
'<!(python -c "import uuid; print uuid.uuid5(uuid.UUID(\'6a7699f0-ee43-43e7-aa30-a6738f9bd470\'), \'<(version_full)\')")', '<!(python -c "import uuid; print uuid.uuid5(uuid.UUID(\'<(rdp_desktop_session_guid)\'), \'<(version_full)\')")',
}], }],
], ],
}, },
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
}, # end of target 'remoting_resources' }, # end of target 'remoting_resources'
{ {
# GN version: //remoting/base # GN version: //remoting/base and //remoting/codec
'target_name': 'remoting_base', 'target_name': 'remoting_base',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, }, 'variables': { 'enable_wexit_time_destructors': 1, },
...@@ -220,6 +220,7 @@ ...@@ -220,6 +220,7 @@
'hard_dependency': 1, 'hard_dependency': 1,
'sources': [ 'sources': [
'<@(remoting_base_sources)', '<@(remoting_base_sources)',
'<@(remoting_codec_sources)',
], ],
}, # end of target 'remoting_base' }, # end of target 'remoting_base'
......
...@@ -204,6 +204,7 @@ ...@@ -204,6 +204,7 @@
}, # end of target 'remoting_host' }, # end of target 'remoting_host'
{ {
# GN version: //remoting/host/native_messaging
'target_name': 'remoting_native_messaging_base', 'target_name': 'remoting_native_messaging_base',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, }, 'variables': { 'enable_wexit_time_destructors': 1, },
...@@ -211,18 +212,12 @@ ...@@ -211,18 +212,12 @@
'../base/base.gyp:base', '../base/base.gyp:base',
], ],
'sources': [ 'sources': [
'host/native_messaging/native_messaging_pipe.cc', '<@(remoting_host_native_messaging_sources)',
'host/native_messaging/native_messaging_pipe.h',
'host/native_messaging/native_messaging_reader.cc',
'host/native_messaging/native_messaging_reader.h',
'host/native_messaging/native_messaging_writer.cc',
'host/native_messaging/native_messaging_writer.h',
'host/native_messaging/pipe_messaging_channel.cc',
'host/native_messaging/pipe_messaging_channel.h',
], ],
}, # end of target 'remoting_native_messaging_base' }, # end of target 'remoting_native_messaging_base'
{ {
# GN version: //remoting/host/setup
'target_name': 'remoting_host_setup_base', 'target_name': 'remoting_host_setup_base',
'type': 'static_library', 'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, }, 'variables': { 'enable_wexit_time_destructors': 1, },
...@@ -235,28 +230,7 @@ ...@@ -235,28 +230,7 @@
'VERSION=<(version_full)', 'VERSION=<(version_full)',
], ],
'sources': [ 'sources': [
'host/setup/daemon_controller.cc', '<@(remoting_host_setup_sources)',
'host/setup/daemon_controller.h',
'host/setup/daemon_controller_delegate_linux.cc',
'host/setup/daemon_controller_delegate_linux.h',
'host/setup/daemon_controller_delegate_mac.h',
'host/setup/daemon_controller_delegate_mac.mm',
'host/setup/daemon_controller_delegate_win.cc',
'host/setup/daemon_controller_delegate_win.h',
'host/setup/me2me_native_messaging_host.cc',
'host/setup/me2me_native_messaging_host.h',
'host/setup/oauth_client.cc',
'host/setup/oauth_client.h',
'host/setup/oauth_helper.cc',
'host/setup/oauth_helper.h',
'host/setup/pin_validator.cc',
'host/setup/pin_validator.h',
'host/setup/service_client.cc',
'host/setup/service_client.h',
'host/setup/test_util.cc',
'host/setup/test_util.h',
'host/setup/win/auth_code_getter.cc',
'host/setup/win/auth_code_getter.h',
], ],
'conditions': [ 'conditions': [
['OS=="win"', { ['OS=="win"', {
......
...@@ -258,7 +258,41 @@ ...@@ -258,7 +258,41 @@
'host/win/wts_terminal_monitor.h', 'host/win/wts_terminal_monitor.h',
'host/win/wts_terminal_observer.h', 'host/win/wts_terminal_observer.h',
], ],
'remoting_cast_sources' : [ 'remoting_host_setup_sources': [
'host/setup/daemon_controller.cc',
'host/setup/daemon_controller.h',
'host/setup/daemon_controller_delegate_linux.cc',
'host/setup/daemon_controller_delegate_linux.h',
'host/setup/daemon_controller_delegate_mac.h',
'host/setup/daemon_controller_delegate_mac.mm',
'host/setup/daemon_controller_delegate_win.cc',
'host/setup/daemon_controller_delegate_win.h',
'host/setup/me2me_native_messaging_host.cc',
'host/setup/me2me_native_messaging_host.h',
'host/setup/oauth_client.cc',
'host/setup/oauth_client.h',
'host/setup/oauth_helper.cc',
'host/setup/oauth_helper.h',
'host/setup/pin_validator.cc',
'host/setup/pin_validator.h',
'host/setup/service_client.cc',
'host/setup/service_client.h',
'host/setup/test_util.cc',
'host/setup/test_util.h',
'host/setup/win/auth_code_getter.cc',
'host/setup/win/auth_code_getter.h',
],
'remoting_host_native_messaging_sources': [
'host/native_messaging/native_messaging_pipe.cc',
'host/native_messaging/native_messaging_pipe.h',
'host/native_messaging/native_messaging_reader.cc',
'host/native_messaging/native_messaging_reader.h',
'host/native_messaging/native_messaging_writer.cc',
'host/native_messaging/native_messaging_writer.h',
'host/native_messaging/pipe_messaging_channel.cc',
'host/native_messaging/pipe_messaging_channel.h',
],
'remoting_cast_sources': [
'host/cast_extension.cc', 'host/cast_extension.cc',
'host/cast_extension.h', 'host/cast_extension.h',
'host/cast_extension_session.cc', 'host/cast_extension_session.cc',
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
], ],
}, # end of target 'remoting_breakpad_tester' }, # end of target 'remoting_breakpad_tester'
{ {
# GN version: //remoting/host:remoting_lib_idl
'target_name': 'remoting_lib_idl', 'target_name': 'remoting_lib_idl',
'type': 'static_library', 'type': 'static_library',
'sources': [ 'sources': [
...@@ -50,6 +51,7 @@ ...@@ -50,6 +51,7 @@
}, },
'rules': [ 'rules': [
{ {
# GN version: //remoting/host:generate_idl
'rule_name': 'generate_idl', 'rule_name': 'generate_idl',
'extension': 'templ', 'extension': 'templ',
'outputs': [ 'outputs': [
...@@ -381,6 +383,7 @@ ...@@ -381,6 +383,7 @@
}, },
}, # end of target 'remoting_it2me_native_messaging_host' }, # end of target 'remoting_it2me_native_messaging_host'
{ {
# GN version: //remoting/host:messages
'target_name': 'remoting_host_messages', 'target_name': 'remoting_host_messages',
'type': 'none', 'type': 'none',
'dependencies': [ 'dependencies': [
......
# 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.
webapp_locale_dir = "$root_gen_dir/remoting/webapp/_locales"
# See also remoting_locales_with_underscores below.
remoting_locales = [
"am",
"ar",
"bg",
"bn",
"ca",
"cs",
"da",
"de",
"el",
"en",
"en-GB",
"es",
"es-419",
"et",
"fa",
"fake-bidi",
"fi",
"fil",
"fr",
"gu",
"he",
"hi",
"hr",
"hu",
"id",
"it",
"ja",
"kn",
"ko",
"lt",
"lv",
"ml",
"mr",
"ms",
"nb",
"nl",
"pl",
"pt-BR",
"pt-PT",
"ro",
"ru",
"sk",
"sl",
"sr",
"sv",
"sw",
"ta",
"te",
"th",
"tr",
"uk",
"vi",
"zh-CN",
"zh-TW",
]
# Some locales have hyphens in the names but for some uses underscores are
# needed.
remoting_locales_with_underscores = remoting_locales
remoting_locales_with_underscores -= [
"en-GB",
"es-419",
"fake-bidi",
"pt-BR",
"pt-PT",
"zh-CN",
"zh-TW",
]
remoting_locales_with_underscores += [
"en_GB",
"es_419",
"fake_bidi",
"pt_BR",
"pt_PT",
"zh_CN",
"zh_TW",
]
if (is_chromeos) {
remoting_locales += [ "en-US" ]
remoting_locales_with_underscores += [ "en_US" ]
}
messages_locales = remoting_locales_with_underscores
if (!is_chromeos) {
# The messages output includes a separate one for en-US that the pak ones
# don't have. We don't need to do this on ChromeOS since en_US is in the
# locales list be default there.
messages_locales += [ "en_US" ]
}
# The list of .json files generated by remoting_strings.grd.
remoting_webapp_locale_files =
process_file_template(
messages_locales,
[ "remoting/webapp/_locales/{{source_name_part}}/messages.json" ])
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
'webapp_locale_dir': '<(SHARED_INTERMEDIATE_DIR)/remoting/webapp/_locales', 'webapp_locale_dir': '<(SHARED_INTERMEDIATE_DIR)/remoting/webapp/_locales',
'remoting_locales': [ 'remoting_locales': [
# Note: list duplicated in GN build. See //remoting/resources/BUILD.gn # Note: list duplicated in GN build. See //remoting/remoting_locales.gni
'ar', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en', 'en-GB', 'es', 'ar', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en', 'en-GB', 'es',
'es-419', 'et', 'fi', 'fil', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'es-419', 'et', 'fi', 'fil', 'fr', 'he', 'hi', 'hr', 'hu', 'id',
'it', 'ja', 'ko', 'lt', 'lv', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'it', 'ja', 'ko', 'lt', 'lv', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT',
......
...@@ -116,6 +116,7 @@ ...@@ -116,6 +116,7 @@
'sources': [ 'sources': [
'../ui/events/keycodes/dom4/keycode_converter.cc', '../ui/events/keycodes/dom4/keycode_converter.cc',
'<@(remoting_base_sources)', '<@(remoting_base_sources)',
'<@(remoting_codec_sources)',
'<@(remoting_client_plugin_sources)', '<@(remoting_client_plugin_sources)',
'<@(remoting_client_sources)', '<@(remoting_client_sources)',
'<@(remoting_protocol_sources)', '<@(remoting_protocol_sources)',
......
# 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.
remoting_srcs_gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("remoting_srcs.gypi") ],
"scope",
[ "remoting_srcs.gypi" ])
remoting_host_srcs_gypi_values =
exec_script("//build/gypi_to_gn.py",
[ rebase_path("remoting_host_srcs.gypi") ],
"scope",
[ "remoting_host_srcs.gypi" ])
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
{ {
'variables': { 'variables': {
'daemon_controller_guid': '655bd819-c08c-4b04-80c2-f160739ff6ef',
'rdp_desktop_session_guid': '6a7699f0-ee43-43e7-aa30-a6738f9bd470',
'remoting_base_sources': [ 'remoting_base_sources': [
'base/auto_thread.cc', 'base/auto_thread.cc',
'base/auto_thread.h', 'base/auto_thread.h',
...@@ -41,6 +43,8 @@ ...@@ -41,6 +43,8 @@
'base/util.h', 'base/util.h',
'base/vlog_net_log.cc', 'base/vlog_net_log.cc',
'base/vlog_net_log.h', 'base/vlog_net_log.h',
],
'remoting_codec_sources': [
'codec/audio_decoder.cc', 'codec/audio_decoder.cc',
'codec/audio_decoder.h', 'codec/audio_decoder.h',
'codec/audio_decoder_opus.cc', 'codec/audio_decoder_opus.cc',
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
{ {
'targets': [ 'targets': [
{ {
# GN version: //remoting:test_support
'target_name': 'remoting_test_common', 'target_name': 'remoting_test_common',
'type': 'static_library', 'type': 'static_library',
'dependencies': [ 'dependencies': [
...@@ -20,6 +21,7 @@ ...@@ -20,6 +21,7 @@
'remoting_resources', 'remoting_resources',
], ],
'sources': [ 'sources': [
# Note: sources list duplicated in GN build.
'host/fake_desktop_capturer.cc', 'host/fake_desktop_capturer.cc',
'host/fake_desktop_capturer.h', 'host/fake_desktop_capturer.h',
'host/fake_desktop_environment.cc', 'host/fake_desktop_environment.cc',
...@@ -71,6 +73,9 @@ ...@@ -71,6 +73,9 @@
# Remoting unit tests # Remoting unit tests
{ {
# GN version: //remoting:remoting_unittests
# Note that many of the sources are broken out into subdir-specific unit
# test source set targets that then GN version then brings together.
'target_name': 'remoting_unittests', 'target_name': 'remoting_unittests',
'type': '<(gtest_target_type)', 'type': '<(gtest_target_type)',
'dependencies': [ 'dependencies': [
...@@ -107,6 +112,7 @@ ...@@ -107,6 +112,7 @@
'../testing/gmock/include', '../testing/gmock/include',
], ],
'sources': [ 'sources': [
# Note: sources list duplicated in GN build.
'base/auto_thread_task_runner_unittest.cc', 'base/auto_thread_task_runner_unittest.cc',
'base/auto_thread_unittest.cc', 'base/auto_thread_unittest.cc',
'base/breakpad_win_unittest.cc', 'base/breakpad_win_unittest.cc',
......
...@@ -2,93 +2,9 @@ ...@@ -2,93 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//remoting/remoting_locales.gni")
import("//tools/grit/grit_rule.gni") import("//tools/grit/grit_rule.gni")
# See also remoting_locales_with_underscores below.
remoting_locales = [
"am",
"ar",
"bg",
"bn",
"ca",
"cs",
"da",
"de",
"el",
"en",
"en-GB",
"es",
"es-419",
"et",
"fa",
"fake-bidi",
"fi",
"fil",
"fr",
"gu",
"he",
"hi",
"hr",
"hu",
"id",
"it",
"ja",
"kn",
"ko",
"lt",
"lv",
"ml",
"mr",
"ms",
"nb",
"nl",
"pl",
"pt-BR",
"pt-PT",
"ro",
"ru",
"sk",
"sl",
"sr",
"sv",
"sw",
"ta",
"te",
"th",
"tr",
"uk",
"vi",
"zh-CN",
"zh-TW",
]
# Some locales have hyphens in the names but for some uses underscores are
# needed.
remoting_locales_with_underscores = remoting_locales
remoting_locales_with_underscores -= [
"en-GB",
"es-419",
"fake-bidi",
"pt-BR",
"pt-PT",
"zh-CN",
"zh-TW",
]
remoting_locales_with_underscores += [
"en_GB",
"es_419",
"fake_bidi",
"pt_BR",
"pt_PT",
"zh_CN",
"zh_TW",
]
if (is_chromeos) {
remoting_locales += [ "en-US" ]
remoting_locales_with_underscores += [ "en_US" ]
}
group("resources") { group("resources") {
deps = [ deps = [
":copy_locales", ":copy_locales",
...@@ -166,16 +82,7 @@ grit("strings") { ...@@ -166,16 +82,7 @@ grit("strings") {
process_file_template(remoting_locales, process_file_template(remoting_locales,
[ "remoting/resources/{{source_name_part}}.pak" ]) [ "remoting/resources/{{source_name_part}}.pak" ])
messages_locales = remoting_locales_with_underscores outputs += remoting_webapp_locale_files
if (!is_chromeos) {
# The messages output includes a separate one for en-US that the pak ones
# don't have. We don't need to do this on ChromeOS since en_US is in the
# locales list be default there.
messages_locales += [ "en_US" ]
}
outputs += process_file_template(
messages_locales,
[ "remoting/webapp/_locales/{{source_name_part}}/messages.json" ])
} }
action("copy_locales") { action("copy_locales") {
......
# 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.
assert(is_win, "This only runs on Windows.")
# Runs mc.exe over a list of sources.
#
# sources
# List of .mc files to process.
template("message_compiler") {
action_name = "${target_name}_mc"
source_set_name = target_name
action_foreach(action_name) {
visibility = [ ":$source_set_name" ]
script = "//remoting/tools/build/message_compiler.py"
sources = invoker.sources
outputs = [
"$target_gen_dir/{{source_name_part}}.h",
"$target_gen_dir/{{source_name_part}}.rc",
]
args = [
# Where to put the header.
"-h",
rebase_path(target_gen_dir, root_build_dir),
# Where to put the .rc file.
"-r",
rebase_path(target_gen_dir, root_build_dir),
# Input is Unicode.
"-u",
"{{source}}",
]
if (defined(invoker.deps)) {
deps = invoker.deps
}
}
source_set(source_set_name) {
sources = get_target_outputs(":$action_name")
deps = [
":$action_name",
]
}
}
# 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.
# Runs the Microsoft Message Compiler (mc.exe). This Python adapter is for the
# GYP build, which can only run Python and not native binaries.
import subprocess
import sys
# mc writes to stderr, so this explicily redirects to stdout and eats it.
try:
subprocess.check_output(["mc.exe"] + sys.argv[1:], stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
print e.output
sys.exit(e.returncode)
# 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.
# Calls the remoting_localize script with a jinja2 template.
#
# Arguments
#
# sources (required)
# List of jinja2 files to load. This is the template.
#
# locales (required)
# List of locales.
#
# locale_dir (optional)
#
# defines (optional)
# List of defines to pass to script.
# Example: defines = [ "FOO_HOST_PATH=bar" ]
#
# variables (optional)
# List of variables to pass to script.
#
# output (optiona)
# Substitution pattern for the output. Defaults to a file in the target
# gen dir with the extension stripped (normally the extension is ".jinja2"
# which then leaves the non-tempaltized file name).
# TODO(brettw) Need locale_output. This is a per-locale output file.
#
# encoding (optional)
# String.
#
# deps (optional)
# visibility (optional)
template("remoting_localize") {
action_foreach(target_name) {
if (defined(invoker.visibility)) {
visibility = invoker.visibility
}
script = "//remoting/tools/build/remoting_localize.py"
sources = invoker.sources
if (defined(invoker.output)) {
outputs = [
invoker.output,
]
} else {
outputs = [
"$target_gen_dir/{{source_name_part}}",
]
}
args = []
if (defined(invoker.locale_dir)) {
args += [
"--locale_dir",
rebase_path(invoker.locale_dir, root_build_dir),
]
}
# Add defines to command line.
if (defined(invoker.defines)) {
foreach(i, invoker.defines) {
args += [
"--define",
i,
]
}
}
# Add variables to command line.
if (defined(invoker.variables)) {
foreach(i, invoker.variables) {
args += [
"--variables",
i,
]
}
}
# The template file is required.
args += [
"--template",
"{{source}}",
]
args += [
"--output",
rebase_path(outputs[0], root_build_dir),
]
if (defined(invoker.encoding)) {
args += [
"--encoding",
invoker.encoding,
]
}
args += invoker.locales
if (defined(invoker.deps)) {
deps = invoker.deps
} else {
deps = []
}
# This script reads the messages strings from the generated resource files.
deps += [ "//remoting/resources:strings" ]
}
}
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