diff options
Diffstat (limited to 'mojo/shell/BUILD.gn')
-rw-r--r-- | mojo/shell/BUILD.gn | 417 |
1 files changed, 41 insertions, 376 deletions
diff --git a/mojo/shell/BUILD.gn b/mojo/shell/BUILD.gn index 38b8639f..5a13e6b 100644 --- a/mojo/shell/BUILD.gn +++ b/mojo/shell/BUILD.gn @@ -2,334 +2,49 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/config/ui.gni") -import("//third_party/mojo/src/mojo/public/mojo.gni") -import("//third_party/mojo/src/mojo/public/mojo_application.gni") import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni") import("//testing/test.gni") -# We don't support building in the component build since mojo apps are -# inherently components. -assert(!is_component_build) - -group("shell") { - testonly = true - - deps = [ - ":mojo_shell", - ":tests", - "//mojo/shell/application_manager:tests", - ] - - if (is_android) { - deps += [ - ":mojo_shell_apk", - ":tests_apk", - ] - } -} - -if (is_android) { - import("//build/config/android/config.gni") - import("//build/config/android/rules.gni") -} - -executable("mojo_shell") { - sources = [] - - deps = [ - ":lib", - "//base", - "//build/config/sanitizers:deps", - "//mojo/common", - "//mojo/environment:chromium", - ] - - if (!is_android) { - sources += [ - "desktop/launcher_process.cc", - "desktop/launcher_process.h", - "desktop/main.cc", - ] - } else { - sources += [ - "android/library_loader.cc", - "android/main.cc", - "android/main.h", - ] - - # On android, the executable is also the native library used by the apk. - # It means dynamic symbols must be preserved and exported. - ldflags = [ "-Wl,--export-dynamic" ] - - deps += [ - ":jni_headers", - "//components/native_viewport:lib", - "//mojo/shell/application_manager", - "//ui/gl", - ] - } -} - -source_set("in_process_native_runner") { +source_set("shell") { + output_name = "mojo_shell" sources = [ - "in_process_native_runner.cc", - "in_process_native_runner.h", + "application_loader.h", + "application_manager.cc", + "application_manager.h", + "data_pipe_peek.cc", + "data_pipe_peek.h", + "fetcher.cc", + "fetcher.h", + "identity.cc", + "identity.h", + "local_fetcher.cc", + "local_fetcher.h", + "native_runner.h", + "network_fetcher.cc", + "network_fetcher.h", + "query_util.cc", + "query_util.h", + "shell_impl.cc", + "shell_impl.h", + "switches.cc", + "switches.h", ] public_deps = [ - ":native_application_support", - "//mojo/shell/application_manager", - ] - - deps = [ - "//base", - ] -} - -source_set("lib") { - sources = [ - "child_process.cc", - "child_process.h", - "child_process_host.cc", - "child_process_host.h", - "context.cc", - "context.h", - "filename_util.cc", - "filename_util.h", - "init.cc", - "init.h", - "out_of_process_native_runner.cc", - "out_of_process_native_runner.h", - "task_runners.cc", - "task_runners.h", - "url_resolver.cc", - "url_resolver.h", - ] - - deps = [ - ":child_process_bindings", - ":in_process_native_runner", - ":native_application_support", "//base", - "//base/third_party/dynamic_annotations", - "//base:base_static", - "//mojo/application", "//mojo/common", - "//mojo/common:tracing_impl", - "//third_party/mojo/src/mojo/edk/system", - "//third_party/mojo/src/mojo/public/cpp/bindings", - "//third_party/mojo/src/mojo/public/interfaces/application", + "//third_party/mojo/src/mojo/public/interfaces/application:application", "//mojo/services/network/public/interfaces", - "//mojo/shell/application_manager", - "//mojo/services/tracing:bindings", - "//ui/gl", "//url", ] - - public_deps = [ - ":switches", - ] - - if (is_android) { - sources += [ - "android/android_handler.cc", - "android/android_handler.h", - "android/android_handler_loader.cc", - "android/android_handler_loader.h", - "android/background_application_loader.cc", - "android/background_application_loader.h", - "android/native_viewport_application_loader.cc", - "android/native_viewport_application_loader.h", - "android/ui_application_loader_android.cc", - "android/ui_application_loader_android.h", - ] - - deps += [ - ":jni_headers", - ":run_android_application_function", - "//components/gles2", - "//components/native_viewport:lib", - "//mojo/application:content_handler", - ] - } - - # This target includes some files behind #ifdef OS... guards. Since gn is not - # smart enough to understand preprocess includes, it does complains about - # these includes when not using the build files for that OS. Suppress checking - # so we can enable checking for the rest of the targets in this file. - # TODO: Might be better to split the files with OS-specific includes out to a - # separate source_set so we can leave checking on for the rest of the target. - check_includes = false -} - -source_set("native_application_support") { - sources = [ - "native_application_support.cc", - "native_application_support.h", - ] - - public_deps = [ - "//third_party/mojo/src/mojo/public/cpp/bindings", - ] - deps = [ - "//base", - "//mojo/gles2", - ] - - # This target has to include the public thunk headers, which generally - # shouldn't be included without picking an implementation. We are providing - # the implementation but the thunk header target cannot declare that we are - # permitted to include it since it's in the public SDK and we are not. - # Suppress include checking so we can still check the rest of the targets in - # this file. - check_includes = false -} - -source_set("switches") { - sources = [ - "switches.cc", - "switches.h", - ] - - deps = [ - "//base", - ] -} - -if (is_android) { - generate_jni("jni_headers") { - sources = [ - "android/apk/src/org/chromium/mojo/shell/AndroidHandler.java", - "android/apk/src/org/chromium/mojo/shell/Bootstrap.java", - "android/apk/src/org/chromium/mojo/shell/ShellMain.java", - "android/tests/src/org/chromium/mojo/shell/ShellTestBase.java", - ] - jni_package = "mojo/shell" - } - - android_library("bootstrap_java") { - java_files = [ "android/apk/src/org/chromium/mojo/shell/Bootstrap.java" ] - - deps = [ - "//base:base_java", - ] - - dex_path = "$target_out_dir/bootstrap_java.dex.jar" - } - - shared_library("bootstrap") { - sources = [ - "android/bootstrap.cc", - ] - deps = [ - ":jni_headers", - ":lib", - ":run_android_application_function", - "//base", - ] - } - - # Shared header between the bootstrap and the main shell .so. - source_set("run_android_application_function") { - sources = [ - "android/run_android_application_function.h", - ] - - deps = [ - "//base", - ] - } - - android_library("java") { - java_files = [ - "android/apk/src/org/chromium/mojo/shell/AndroidHandler.java", - "android/apk/src/org/chromium/mojo/shell/FileHelper.java", - "android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java", - "android/apk/src/org/chromium/mojo/shell/MojoShellApplication.java", - "android/apk/src/org/chromium/mojo/shell/ShellMain.java", - ] - - deps = [ - "//base:base_java", - ] - } - - android_resources("resources") { - resource_dirs = [ "android/apk/res" ] - custom_package = "org.chromium.mojo.shell" - } - - mojo_shell_assets_dir = "$root_build_dir/mojo_shell_assets" - mojo_shell_test_assets_dir = "$root_build_dir/mojo_shell_test_assets" - - copy_ex("copy_mojo_shell_assets") { - clear_dir = true - dest = mojo_shell_assets_dir - sources = [ - "$root_out_dir/lib.stripped/libbootstrap.so", - "$root_out_dir/network_service.mojo", - "$root_out_dir/obj/mojo/shell/bootstrap_java.dex.jar", - ] - } - - copy("copy_mojo_shell") { - sources = [ - "$root_out_dir/exe.stripped/mojo_shell", - ] - outputs = [ - "$root_out_dir/lib.stripped/libmojo_shell.so", - ] - } - - copy_ex("copy_mojo_shell_test_assets") { - clear_dir = true - dest = mojo_shell_test_assets_dir - sources = [ - "$root_out_dir/test_app.mojo", - "$root_out_dir/test_request_tracker_app.mojo", - ] - } - - android_apk("mojo_shell_apk") { - apk_name = "MojoShell" - - android_manifest = "android/apk/AndroidManifest.xml" - - native_libs = [ "libmojo_shell.so" ] - - asset_location = mojo_shell_assets_dir - - deps = [ - ":copy_mojo_shell", - ":copy_mojo_shell_assets", - ":java", - ":resources", - "//base:base_java", - "//components/native_viewport:native_viewport_java", - "//third_party/android_tools:google_play_services_default_resources", - ] - } - - android_library("mojo_shell_tests_java") { - java_files = - [ "android/tests/src/org/chromium/mojo/shell/ShellTestBase.java" ] - - deps = [ - ":java", - "//base:base_java", - ] - } -} - -mojom("child_process_bindings") { - sources = [ - "child_process.mojom", - ] - - deps = [ - "//third_party/mojo/src/mojo/public/interfaces/application", + "//base/third_party/dynamic_annotations", + "//crypto:crypto", + "//url", + "//third_party/mojo/src/mojo/edk/system", + "//mojo/environment:chromium", + "//third_party/mojo_services/src/content_handler/public/interfaces", + "//mojo/runner:native_application_support", ] } @@ -337,77 +52,27 @@ test("tests") { output_name = "mojo_shell_unittests" sources = [ - "child_process_host_unittest.cc", - "data_pipe_peek_unittest.cc", - "in_process_native_runner_unittest.cc", - "native_runner_unittest.cc", - "shell_test_base.cc", - "shell_test_base.h", - "shell_test_base_android.cc", - "shell_test_base_unittest.cc", - "shell_test_main.cc", - "url_resolver_unittest.cc", + "application_manager_unittest.cc", + "query_util_unittest.cc", ] deps = [ - ":in_process_native_runner", - ":lib", + ":shell", + ":test_bindings", "//base", - "//base:i18n", - "//base/test:test_support", - "//testing/gtest", - "//url", + "//mojo/application", "//mojo/common", - "//third_party/mojo/src/mojo/edk/system", + "//third_party/mojo/src/mojo/edk/test:run_all_unittests", "//mojo/environment:chromium", + "//third_party/mojo/src/mojo/public/cpp/application", "//third_party/mojo/src/mojo/public/cpp/bindings", - "//mojo/services/test_service:bindings", - "//mojo/shell/application_manager", - ] - - datadeps = [ - "//mojo/services/test_service:test_app", - "//mojo/services/test_service:test_request_tracker_app", + "//testing/gtest", + "//url", ] - - if (is_android) { - sources += [ "android/background_application_loader_unittest.cc" ] - - deps += [ ":jni_headers" ] - - apk_deps = [ - ":copy_mojo_shell_test_assets", - ":mojo_shell_tests_java", - ] - - apk_asset_location = mojo_shell_test_assets_dir - } } -mojo_native_application("apptests") { - output_name = "shell_apptests" - - testonly = true - +mojom("test_bindings") { sources = [ - # TODO(jam): needs http_server service. - #"shell_apptest.cc", - ] - - deps = [ - "//base", - "//mojo/application", - "//mojo/application:test_support", - "//mojo/common:common", - "//third_party/mojo/src/mojo/public/cpp/bindings:callback", - "//third_party/mojo/src/mojo/public/cpp/environment", - "//third_party/mojo/src/mojo/public/cpp/system:system", - - #"//mojo/services/http_server/public/cpp", - #"//mojo/services/http_server/public/interfaces", - "//mojo/services/network/public/interfaces", - "//mojo/shell/test:bindings", + "test.mojom", ] - - #data_deps = [ "//services/http_server:http_server($default_toolchain)" ] } |