| # Copyright 2014 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("//third_party/blink/public/public_features.gni") |
| import("./all_devtools_files.gni") |
| import("./all_devtools_modules.gni") |
| import("./devtools_image_files.gni") |
| import("./devtools_module_entrypoints.gni") |
| import("./scripts/build/ninja/vars.gni") |
| |
| devtools_test_files = [ |
| "//third_party/axe-core/axe.js", |
| "front_end/accessibility_test_runner/AccessibilityPaneTestRunner.js", |
| "front_end/accessibility_test_runner/module.json", |
| "front_end/application_test_runner/AppcacheTestRunner.js", |
| "front_end/application_test_runner/CacheStorageTestRunner.js", |
| "front_end/application_test_runner/IndexedDBTestRunner.js", |
| "front_end/application_test_runner/module.json", |
| "front_end/application_test_runner/ResourcesTestRunner.js", |
| "front_end/application_test_runner/ResourceTreeTestRunner.js", |
| "front_end/application_test_runner/ServiceWorkersTestRunner.js", |
| "front_end/lighthouse_test_runner/LighthouseTestRunner.js", |
| "front_end/lighthouse_test_runner/module.json", |
| "front_end/axe_core_test_runner/AxeCoreTestRunner.js", |
| "front_end/axe_core_test_runner/module.json", |
| "front_end/bindings_test_runner/AutomappingTestRunner.js", |
| "front_end/bindings_test_runner/BindingsTestRunner.js", |
| "front_end/bindings_test_runner/IsolatedFilesystemTestRunner.js", |
| "front_end/bindings_test_runner/module.json", |
| "front_end/bindings_test_runner/OverridesTestRunner.js", |
| "front_end/bindings_test_runner/PersistenceTestRunner.js", |
| "front_end/console_test_runner/ConsoleTestRunner.js", |
| "front_end/console_test_runner/module.json", |
| "front_end/coverage_test_runner/CoverageTestRunner.js", |
| "front_end/coverage_test_runner/module.json", |
| "front_end/cpu_profiler_test_runner/module.json", |
| "front_end/cpu_profiler_test_runner/ProfilerTestRunner.js", |
| "front_end/data_grid_test_runner/DataGridTestRunner.js", |
| "front_end/data_grid_test_runner/module.json", |
| "front_end/device_mode_test_runner/DeviceModeTestRunner.js", |
| "front_end/device_mode_test_runner/module.json", |
| "front_end/elements_test_runner/EditDOMTestRunner.js", |
| "front_end/elements_test_runner/ElementsPanelShadowSelectionOnRefreshTestRunner.js", |
| "front_end/elements_test_runner/ElementsTestRunner.js", |
| "front_end/elements_test_runner/module.json", |
| "front_end/elements_test_runner/SetOuterHTMLTestRunner.js", |
| "front_end/elements_test_runner/StylesUpdateLinksTestRunner.js", |
| "front_end/extensions_test_runner/ExtensionsNetworkTestRunner.js", |
| "front_end/extensions_test_runner/ExtensionsTestRunner.js", |
| "front_end/extensions_test_runner/module.json", |
| "front_end/heap_profiler_test_runner/HeapProfilerTestRunner.js", |
| "front_end/heap_profiler_test_runner/module.json", |
| "front_end/integration_test_runner.html", |
| "front_end/integration_test_runner.js", |
| "front_end/integration_test_runner.json", |
| "front_end/layers_test_runner/LayersTestRunner.js", |
| "front_end/layers_test_runner/module.json", |
| "front_end/network_test_runner/module.json", |
| "front_end/network_test_runner/NetworkTestRunner.js", |
| "front_end/performance_test_runner/module.json", |
| "front_end/performance_test_runner/TimelineDataTestRunner.js", |
| "front_end/performance_test_runner/TimelineTestRunner.js", |
| "front_end/sdk_test_runner/module.json", |
| "front_end/sdk_test_runner/PageMockTestRunner.js", |
| "front_end/security_test_runner/module.json", |
| "front_end/security_test_runner/SecurityTestRunner.js", |
| "front_end/sources_test_runner/AutocompleteTestRunner.js", |
| "front_end/sources_test_runner/DebuggerTestRunner.js", |
| "front_end/sources_test_runner/EditorTestRunner.js", |
| "front_end/sources_test_runner/LiveEditTestRunner.js", |
| "front_end/sources_test_runner/module.json", |
| "front_end/sources_test_runner/SearchTestRunner.js", |
| "front_end/sources_test_runner/SourcesTestRunner.js", |
| "front_end/test_runner/module.json", |
| ] |
| |
| devtools_embedder_scripts = [ |
| "front_end/devtools_compatibility.js", |
| "front_end/Tests.js", |
| ] |
| |
| devtools_emulated_devices_images = [ |
| "front_end/emulated_devices/google-nexus-5-horizontal-default-1x.png", |
| "front_end/emulated_devices/google-nexus-5-horizontal-default-2x.png", |
| "front_end/emulated_devices/google-nexus-5-horizontal-keyboard-1x.png", |
| "front_end/emulated_devices/google-nexus-5-horizontal-keyboard-2x.png", |
| "front_end/emulated_devices/google-nexus-5-horizontal-navigation-1x.png", |
| "front_end/emulated_devices/google-nexus-5-horizontal-navigation-2x.png", |
| "front_end/emulated_devices/google-nexus-5-vertical-default-1x.png", |
| "front_end/emulated_devices/google-nexus-5-vertical-default-2x.png", |
| "front_end/emulated_devices/google-nexus-5-vertical-keyboard-1x.png", |
| "front_end/emulated_devices/google-nexus-5-vertical-keyboard-2x.png", |
| "front_end/emulated_devices/google-nexus-5-vertical-navigation-1x.png", |
| "front_end/emulated_devices/google-nexus-5-vertical-navigation-2x.png", |
| "front_end/emulated_devices/google-nexus-5x-horizontal-default-1x.png", |
| "front_end/emulated_devices/google-nexus-5x-horizontal-default-2x.png", |
| "front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-1x.png", |
| "front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-2x.png", |
| "front_end/emulated_devices/google-nexus-5x-horizontal-navigation-1x.png", |
| "front_end/emulated_devices/google-nexus-5x-horizontal-navigation-2x.png", |
| "front_end/emulated_devices/google-nexus-5x-vertical-default-1x.png", |
| "front_end/emulated_devices/google-nexus-5x-vertical-default-2x.png", |
| "front_end/emulated_devices/google-nexus-5x-vertical-keyboard-1x.png", |
| "front_end/emulated_devices/google-nexus-5x-vertical-keyboard-2x.png", |
| "front_end/emulated_devices/google-nexus-5x-vertical-navigation-1x.png", |
| "front_end/emulated_devices/google-nexus-5x-vertical-navigation-2x.png", |
| "front_end/emulated_devices/iPad-landscape.svg", |
| "front_end/emulated_devices/iPad-portrait.svg", |
| "front_end/emulated_devices/iPhone5-landscape.svg", |
| "front_end/emulated_devices/iPhone5-portrait.svg", |
| "front_end/emulated_devices/iPhone6-landscape.svg", |
| "front_end/emulated_devices/iPhone6-portrait.svg", |
| "front_end/emulated_devices/iPhone6Plus-landscape.svg", |
| "front_end/emulated_devices/iPhone6Plus-portrait.svg", |
| "front_end/emulated_devices/MotoG4-landscape.svg", |
| "front_end/emulated_devices/MotoG4-portrait.svg", |
| "front_end/emulated_devices/Nexus5X-landscape.svg", |
| "front_end/emulated_devices/Nexus5X-portrait.svg", |
| "front_end/emulated_devices/Nexus6P-landscape.svg", |
| "front_end/emulated_devices/Nexus6P-portrait.svg", |
| ] |
| |
| application_templates = [ |
| "front_end/devtools_app.html", |
| "front_end/inspector.html", |
| "front_end/integration_test_runner.html", |
| "front_end/js_app.html", |
| "front_end/ndb_app.html", |
| "front_end/node_app.html", |
| "front_end/toolbox.html", |
| "front_end/worker_app.html", |
| ] |
| |
| generated_applications_html = [ |
| "$resources_out_dir/devtools_app.html", |
| "$resources_out_dir/inspector.html", |
| "$resources_out_dir/integration_test_runner.html", |
| "$resources_out_dir/js_app.html", |
| "$resources_out_dir/ndb_app.html", |
| "$resources_out_dir/node_app.html", |
| "$resources_out_dir/toolbox.html", |
| "$resources_out_dir/worker_app.html", |
| ] |
| |
| generated_applications_js = [ |
| "$resources_out_dir/lighthouse_worker.js", |
| "$resources_out_dir/devtools_app.js", |
| "$resources_out_dir/inspector.js", |
| "$resources_out_dir/js_app.js", |
| "$resources_out_dir/node_app.js", |
| "$resources_out_dir/shell.js", |
| "$resources_out_dir/toolbox.js", |
| "$resources_out_dir/worker_app.js", |
| ] |
| |
| generated_non_autostart_non_remote_modules = [ |
| "$resources_out_dir/accessibility/accessibility_module.js", |
| "$resources_out_dir/animation/animation_module.js", |
| "$resources_out_dir/lighthouse/lighthouse_module.js", |
| "$resources_out_dir/browser_debugger/browser_debugger_module.js", |
| "$resources_out_dir/changes/changes_module.js", |
| "$resources_out_dir/cm_modes/cm_modes_module.js", |
| "$resources_out_dir/cm/cm_module.js", |
| "$resources_out_dir/color_picker/color_picker_module.js", |
| "$resources_out_dir/console/console_module.js", |
| "$resources_out_dir/cookie_table/cookie_table_module.js", |
| "$resources_out_dir/coverage/coverage_module.js", |
| "$resources_out_dir/css_overview/css_overview_module.js", |
| "$resources_out_dir/data_grid/data_grid_module.js", |
| "$resources_out_dir/devices/devices_module.js", |
| "$resources_out_dir/diff/diff_module.js", |
| "$resources_out_dir/elements/elements_module.js", |
| "$resources_out_dir/event_listeners/event_listeners_module.js", |
| "$resources_out_dir/formatter/formatter_module.js", |
| "$resources_out_dir/har_importer/har_importer_module.js", |
| "$resources_out_dir/heap_snapshot_model/heap_snapshot_model_module.js", |
| "$resources_out_dir/help/help_module.js", |
| "$resources_out_dir/inline_editor/inline_editor_module.js", |
| "$resources_out_dir/input/input_module.js", |
| "$resources_out_dir/javascript_metadata/javascript_metadata_module.js", |
| "$resources_out_dir/js_profiler/js_profiler_module.js", |
| "$resources_out_dir/layer_viewer/layer_viewer_module.js", |
| "$resources_out_dir/layers/layers_module.js", |
| "$resources_out_dir/marked/marked_module.js", |
| "$resources_out_dir/media/media_module.js", |
| "$resources_out_dir/network/network_module.js", |
| "$resources_out_dir/node_debugger/node_debugger_module.js", |
| "$resources_out_dir/object_ui/object_ui_module.js", |
| "$resources_out_dir/perf_ui/perf_ui_module.js", |
| "$resources_out_dir/performance_monitor/performance_monitor_module.js", |
| "$resources_out_dir/profiler/profiler_module.js", |
| "$resources_out_dir/issues/issues_module.js", |
| "$resources_out_dir/developer_resources/developer_resources_module.js", |
| "$resources_out_dir/protocol_monitor/protocol_monitor_module.js", |
| "$resources_out_dir/quick_open/quick_open_module.js", |
| "$resources_out_dir/resources/resources_module.js", |
| "$resources_out_dir/search/search_module.js", |
| "$resources_out_dir/security/security_module.js", |
| "$resources_out_dir/settings/settings_module.js", |
| "$resources_out_dir/snippets/snippets_module.js", |
| "$resources_out_dir/source_frame/source_frame_module.js", |
| "$resources_out_dir/sources/sources_module.js", |
| "$resources_out_dir/text_editor/text_editor_module.js", |
| "$resources_out_dir/timeline_model/timeline_model_module.js", |
| "$resources_out_dir/timeline/timeline_module.js", |
| "$resources_out_dir/web_audio/web_audio_module.js", |
| "$resources_out_dir/webauthn/webauthn_module.js", |
| "$resources_out_dir/workspace_diff/workspace_diff_module.js", |
| ] |
| |
| generated_remote_modules = [ |
| "$resources_out_dir/lighthouse_worker/lighthouse_worker_module.js", |
| "$resources_out_dir/dagre_layout/dagre_layout_module.js", |
| "$resources_out_dir/emulated_devices/emulated_devices_module.js", |
| ] |
| |
| generated_test_modules = [ |
| "$resources_out_dir/accessibility_test_runner/accessibility_test_runner_module.js", |
| "$resources_out_dir/application_test_runner/application_test_runner_module.js", |
| "$resources_out_dir/lighthouse_test_runner/lighthouse_test_runner_module.js", |
| "$resources_out_dir/axe_core_test_runner/axe_core_test_runner_module.js", |
| "$resources_out_dir/bindings_test_runner/bindings_test_runner_module.js", |
| "$resources_out_dir/console_test_runner/console_test_runner_module.js", |
| "$resources_out_dir/coverage_test_runner/coverage_test_runner_module.js", |
| "$resources_out_dir/cpu_profiler_test_runner/cpu_profiler_test_runner_module.js", |
| "$resources_out_dir/data_grid_test_runner/data_grid_test_runner_module.js", |
| "$resources_out_dir/device_mode_test_runner/device_mode_test_runner_module.js", |
| "$resources_out_dir/elements_test_runner/elements_test_runner_module.js", |
| "$resources_out_dir/extensions_test_runner/extensions_test_runner_module.js", |
| "$resources_out_dir/heap_profiler_test_runner/heap_profiler_test_runner_module.js", |
| "$resources_out_dir/heap_snapshot_worker/heap_snapshot_worker_module.js", |
| "$resources_out_dir/integration_test_runner.js", |
| "$resources_out_dir/layers_test_runner/layers_test_runner_module.js", |
| "$resources_out_dir/network_test_runner/network_test_runner_module.js", |
| "$resources_out_dir/performance_test_runner/performance_test_runner_module.js", |
| "$resources_out_dir/sdk_test_runner/sdk_test_runner_module.js", |
| "$resources_out_dir/security_test_runner/security_test_runner_module.js", |
| "$resources_out_dir/sources_test_runner/sources_test_runner_module.js", |
| ] |
| |
| all_worker_entrypoints = [ |
| "front_end/heap_snapshot_worker_entrypoint.js", |
| "front_end/wasmparser_worker_entrypoint.js", |
| ] |
| |
| generated_worker_bundles = [ |
| "$resources_out_dir/heap_snapshot_worker_entrypoint.js", |
| "$resources_out_dir/wasmparser_worker_entrypoint.js", |
| ] |
| |
| devtools_applications = [ |
| "lighthouse_worker", |
| "devtools_app", |
| "heap_snapshot_worker_entrypoint", |
| "inspector", |
| "integration_test_runner", |
| "js_app", |
| "ndb_app", |
| "node_app", |
| "shell", |
| "toolbox", |
| "wasmparser_worker_entrypoint", |
| "worker_app", |
| ] |
| |
| #------------------------------------------------------------------------------- |
| |
| devtools_frontend_resources_deps = [ |
| ":build_release_devtools", |
| ":copy_emulated_devices_images", |
| ":devtools_extension_api", |
| "front_end", |
| "test", |
| ] |
| |
| if (is_debug) { |
| devtools_frontend_resources_deps += [ ":copy_devtools_modules" ] |
| } |
| |
| group("devtools_all_files") { |
| testonly = true |
| data = all_devtools_files + generated_devtools_module_entrypoints |
| data += [ |
| # This enables us to test bots with whitespace changes. |
| "scripts/whitespaces.txt", |
| ] |
| data_deps = devtools_frontend_resources_deps |
| } |
| |
| group("devtools_frontend_resources") { |
| public_deps = devtools_frontend_resources_deps |
| } |
| |
| group("generate_devtools_inspector_overlay_resources") { |
| public_deps = [ "front_end/inspector_overlay:build_inspector_overlay" ] |
| } |
| |
| copy("copy_emulated_devices_images") { |
| sources = devtools_emulated_devices_images |
| outputs = [ "$resources_out_dir/emulated_devices/{{source_file_part}}" ] |
| } |
| |
| if (is_debug) { |
| action("copy_devtools_modules") { |
| script = "scripts/build/copy_devtools_modules.py" |
| |
| deps = [ ":build_release_devtools" ] |
| |
| inputs = input_devtools_modules |
| response_file_contents = inputs |
| outputs = output_devtools_modules |
| |
| args = [ |
| "--file_list", |
| "{{response_file_name}}", |
| "--input_path", |
| rebase_path(".", root_build_dir), |
| "--output_path", |
| rebase_path(resources_out_dir, root_build_dir), |
| ] |
| } |
| } |
| |
| action("generate_devtools_grd") { |
| script = "scripts/build/generate_devtools_grd.py" |
| |
| deps = [ ":devtools_frontend_resources" ] |
| |
| grd_files = |
| generated_devtools_module_entrypoints + output_devtools_modules + |
| generated_applications_html + generated_applications_js + |
| generated_non_autostart_non_remote_modules + devtools_embedder_scripts + |
| generated_worker_bundles + generated_typescript_entrypoints + |
| generated_typescript_modules + |
| [ |
| "$resources_out_dir/devtools_extension_api.js", |
| "$resources_out_dir/sdk/wasm_source_map/pkg/wasm_source_map_bg.wasm", |
| ] |
| |
| inputs = grd_files + front_end_image_files |
| response_file_contents = rebase_path(grd_files, root_build_dir) |
| outfile = "$root_gen_dir/devtools/devtools_resources.grd" |
| outputs = [ outfile ] |
| |
| relative_path_dirs = [ |
| resources_out_dir, |
| "front_end", |
| ] |
| |
| args = [ |
| "--file_list", |
| "{{response_file_name}}", |
| "--relative_path_dirs", |
| ] + rebase_path(relative_path_dirs, root_build_dir) + |
| [ |
| "--images", |
| rebase_path("front_end/Images", root_build_dir), |
| "--output", |
| rebase_path(outfile, root_build_dir), |
| ] |
| } |
| |
| action("devtools_extension_api") { |
| script = "scripts/build/generate_devtools_extension_api.py" |
| |
| devtools_extension_api_files = [ "front_end/extensions/ExtensionAPI.js" ] |
| inputs = devtools_extension_api_files |
| outputs = [ "$resources_out_dir/devtools_extension_api.js" ] |
| |
| args = rebase_path(outputs, root_build_dir) + |
| rebase_path(devtools_extension_api_files, root_build_dir) |
| } |
| |
| build_release_devtools_args = [] |
| |
| if (!is_debug) { |
| build_release_devtools_args += [ "--rollup" ] |
| } |
| |
| action("build_release_devtools") { |
| script = "scripts/build/build_release_applications.py" |
| |
| helper_scripts = [ |
| "scripts/build/modular_build.py", |
| "scripts/build/rjsmin.py", |
| "front_end/rollup.config.js", |
| ] |
| |
| deps = [ "front_end" ] |
| |
| inputs = helper_scripts + all_devtools_files + devtools_test_files + |
| application_templates + all_worker_entrypoints + |
| front_end_devtools_module_entrypoints + input_devtools_modules |
| outputs = |
| generated_applications_js + generated_non_autostart_non_remote_modules + |
| generated_remote_modules + generated_test_modules + |
| generated_worker_bundles + generated_devtools_module_entrypoints |
| |
| args = devtools_applications + [ |
| "--input_path", |
| rebase_path("front_end", root_build_dir), |
| "--output_path", |
| rebase_path(resources_out_dir, root_build_dir), |
| ] + build_release_devtools_args |
| } |