# 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/sanitizers/sanitizers.gni") import("//build/config/ui.gni") import("//tools/grit/repack.gni") import("//tools/grit/grit_rule.gni") repack("pak") { sources = [ "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak", "$root_gen_dir/blink/public/resources/blink_resources.pak", "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", "$root_gen_dir/content/app/strings/content_strings_en-US.pak", "$root_gen_dir/content/browser/tracing/tracing_resources.pak", "$root_gen_dir/content/content_resources.pak", "$root_gen_dir/net/net_resources.pak", "$root_gen_dir/ui/resources/ui_resources_100_percent.pak", "$root_gen_dir/ui/resources/webui_resources.pak", "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", "$root_gen_dir/ui/strings/ui_strings_en-US.pak", ] deps = [ "//content:resources", "//content/app/resources", "//content/app/strings", "//content/browser/tracing:resources", "//net:net_resources", "//third_party/WebKit/public:image_resources", "//third_party/WebKit/public:resources", "//ui/resources", "//ui/strings", ] if (toolkit_views) { deps += [ "//ui/views/resources" ] sources += [ "$root_gen_dir/ui/views/resources/views_resources_100_percent.pak" ] } output = "$root_out_dir/blimp_engine.pak" } source_set("app") { sources = [ "app/blimp_browser_main_parts.cc", "app/blimp_browser_main_parts.h", "app/blimp_content_browser_client.cc", "app/blimp_content_browser_client.h", "app/blimp_content_main_delegate.cc", "app/blimp_content_main_delegate.h", "app/blimp_content_renderer_client.cc", "app/blimp_content_renderer_client.h", "app/blimp_engine_config.cc", "app/blimp_engine_config.h", "app/blimp_network_delegate.cc", "app/blimp_network_delegate.h", "app/blimp_permission_manager.cc", "app/blimp_permission_manager.h", "app/blimp_url_request_context_getter.cc", "app/blimp_url_request_context_getter.h", "app/switches.cc", "app/switches.h", ] deps = [ ":app_ui", ":common", ":session", "//base", "//blimp/common/proto", "//components/web_cache/renderer", "//content", "//content/public/app:both", "//content/public/browser", "//content/public/common", "//content/public/renderer", "//content/public/utility", ] } source_set("app_ui") { sources = [ "app/ui/blimp_layout_manager.cc", "app/ui/blimp_layout_manager.h", "app/ui/blimp_screen.cc", "app/ui/blimp_screen.h", "app/ui/blimp_ui_context_factory.cc", "app/ui/blimp_ui_context_factory.h", "app/ui/blimp_window_tree_host.cc", "app/ui/blimp_window_tree_host.h", ] deps = [ "//blimp/common:blimp_common", "//cc", "//cc/surfaces", "//ui/aura", "//ui/compositor", "//ui/events", "//ui/gfx", "//ui/platform_window", "//ui/platform_window", "//ui/platform_window/stub/", ] } source_set("common") { sources = [ "common/blimp_browser_context.cc", "common/blimp_browser_context.h", "common/blimp_content_client.cc", "common/blimp_content_client.h", ] deps = [ "//base", "//components/version_info", "//content/public/common", "//ui/base", ] } source_set("feature") { sources = [ "feature/engine_render_widget_feature.cc", "feature/engine_render_widget_feature.h", ] deps = [ "//base", "//blimp/common/proto", "//ui/base", "//ui/base/ime", "//ui/resources", "//ui/wm", ] } source_set("session") { sources = [ "session/blimp_engine_session.cc", "session/blimp_engine_session.h", ] deps = [ ":feature", "//base", "//blimp/common:blimp_common", "//blimp/common/proto", "//blimp/net:blimp_net", "//content", "//net", ] } source_set("app_unit_tests") { testonly = true sources = [ "app/blimp_engine_config_unittest.cc", "app/ui/blimp_screen_unittest.cc", ] deps = [ ":app", "//base", "//base/test:run_all_unittests", "//base/test:test_support", "//testing/gmock", "//testing/gtest", "//ui/gfx:test_support", ] } source_set("feature_unit_tests") { testonly = true sources = [ "feature/engine_render_widget_feature_unittest.cc", ] deps = [ ":feature", "//base", "//base/test:run_all_unittests", "//base/test:test_support", "//blimp/common/proto", "//content", "//testing/gmock", "//testing/gtest", ] } source_set("unit_tests") { testonly = true deps = [ ":app_unit_tests", ":feature_unit_tests", ] } if (is_linux) { executable("blimp_engine_app") { sources = [ "app/blimp_main.cc", ] deps = [ ":app", ":pak", "//blimp/net:blimp_net", "//content/public/app:both", ] } group("blimp_engine") { deps = [ ":blimp_engine_app", ":pak", "//sandbox/linux:chrome_sandbox", "//third_party/blimp_fonts", ] # List dependencies as both deps and data_deps to ensure changes trigger a # rebuild and "gn desc ... runtime_deps" correctly prints the data_deps. data_deps = deps } # Builds and bundles the engine into a tarball that can be used to build a # Docker image. action("blimp_engine_bundle") { script = "//blimp/tools/bundle-engine.py" # These form the arguments to the script. _rebased_out_dir = rebase_path(root_out_dir) _rebased_dockerfile = rebase_path("//blimp/engine/Dockerfile") _rebased_startup_script = rebase_path("//blimp/engine/start_engine.sh") _rebased_manifest = rebase_path("//blimp/engine/engine-manifest.txt") _bundle = "$root_out_dir/blimp_engine_bundle.tar.gz" # Detail the target & "source"-file dependencies, and output, for GN. deps = [ "//blimp/engine:blimp_engine_app", ] sources = [ _rebased_dockerfile, _rebased_manifest, _rebased_startup_script, ] outputs = [ _bundle, ] # Manually specify the actual arguments to the script. args = [ "--build-dir", _rebased_out_dir, "--dockerfile", _rebased_dockerfile, "--startup-script", _rebased_startup_script, "--manifest", _rebased_manifest, "--output", rebase_path(_bundle), ] } }