[go: nahoru, domu]

blob: b0d094fc6ba69b7f6b287048e1f697a3565f21fd [file] [log] [blame]
# 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("//chrome/common/features.gni")
import("//third_party/closure_compiler/compile_js.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/grit/preprocess_if_expr.gni")
import("//ui/webui/resources/tools/generate_grd.gni")
grit("resources") {
source = "file_manager_resources.grd"
outputs = [
"grit/file_manager_resources.h",
"grit/file_manager_resources_map.cc",
"grit/file_manager_resources_map.h",
"file_manager_resources.pak",
"file_manager_resources.rc",
]
}
component("file_manager") {
sources = [ "file_manager_export.h" ]
public_deps = [
":file_manager_gen_resources",
":resources",
"//base",
]
defines = [ "FILE_MANAGER_IMPLEMENTATION" ]
}
group("closure_compile") {
# Subfolders' closure_compile groups bundle the non-test "module" type-check
# groups as well as unittests and test_support.
testonly = true
deps = [
"audio_player/elements:closure_compile",
"audio_player/js:closure_compile",
"file_manager/background/js:closure_compile",
"file_manager/common/js:closure_compile",
"file_manager/foreground/elements:closure_compile",
"file_manager/foreground/js:closure_compile",
"file_manager/foreground/js/metadata:closure_compile",
"file_manager/foreground/js/ui:closure_compile",
"gallery/js:closure_compile",
"gallery/js/image_editor:closure_compile",
"image_loader:closure_compile",
"integration_tests:closure_compile",
"integration_tests/file_manager:closure_compile",
"video_player/js:closure_compile",
]
}
group("unit_test_data") {
testonly = true
deps = [
"file_manager/background/js:js_test_gen_html_modules",
"file_manager/common/js:js_test_gen_html_modules",
"file_manager/foreground/elements:js_test_gen_html_modules",
"file_manager/foreground/js:js_test_gen_html_modules",
"file_manager/foreground/js/metadata:js_test_gen_html_modules",
"file_manager/foreground/js/ui:js_test_gen_html_modules",
"gallery/js:js_test_gen_html",
"gallery/js/image_editor:js_test_gen_html",
"gallery/js/image_editor:js_test_gen_html_modules",
"image_loader:js_test_gen_html_modules",
"video_player/js:js_test_gen_html_modules",
]
}
preprocess_folder = "$target_gen_dir/preprocessed"
# Move files to the preprocessed folder to combine all resources in the same
# folder for JS bundling with rollup.
# This is for files direct from the src/: input_folder="./".
preprocess_if_expr("preprocess_static") {
in_folder = "./"
out_folder = preprocess_folder
out_manifest = "$target_gen_dir/manifest_preprocess_static.json"
in_files = [
# Audio Player:
"audio_player/js/audio_player.js",
"audio_player/js/background.js",
"audio_player/js/error_util.js",
"audio_player/js/main.js",
"audio_player/js/main_background.js",
"audio_player/js/metadata_worker.js",
"audio_player/js/test_util.js",
# Files app:
"file_manager/background/js/main_background.m.js",
"file_manager/foreground/js/deferred_elements.m.js",
"file_manager/foreground/js/elements_importer.m.js",
"file_manager/foreground/js/main.m.js",
# Image Loader:
"image_loader/background.m.js",
# Video Player:
"video_player/js/main.m.js",
"video_player/js/main_background.m.js",
]
deps = [
"//ui/file_manager/audio_player/js:js_modules",
"//ui/file_manager/file_manager/background/js:main_background.m",
"//ui/file_manager/file_manager/foreground/js:deferred_elements.m",
"//ui/file_manager/file_manager/foreground/js:main.m",
"//ui/file_manager/image_loader:background.m",
"//ui/file_manager/video_player/js:main.m",
"//ui/file_manager/video_player/js:main_background.m",
]
}
# This is for files that are generated in "gen/": input_folder=target_gen_dir.
preprocess_if_expr("preprocess_generated") {
in_folder = target_gen_dir
out_folder = preprocess_folder
out_manifest = "$target_gen_dir/manifest_preprocess_generated.json"
in_files = [
# Audio Player:
"audio_player/elements/audio_player.js",
"audio_player/elements/track_info_panel.js",
"audio_player/elements/track_list.js",
"audio_player/elements/control_panel.js",
"audio_player/elements/repeat_button.js",
# Common:
"file_manager/common/js/app_util.m.js",
"file_manager/common/js/async_util.m.js",
"file_manager/common/js/error_counter.m.js",
"file_manager/common/js/file_operation_common.m.js",
"file_manager/common/js/file_type.m.js",
"file_manager/common/js/files_app_entry_types.m.js",
"file_manager/common/js/filtered_volume_manager.m.js",
"file_manager/common/js/importer_common.m.js",
"file_manager/common/js/lru_cache.m.js",
"file_manager/common/js/mediasession_types.m.js",
"file_manager/common/js/metrics.m.js",
"file_manager/common/js/metrics_base.m.js",
"file_manager/common/js/mock_chrome.m.js",
"file_manager/common/js/power.m.js",
"file_manager/common/js/progress_center_common.m.js",
"file_manager/common/js/storage_adapter.m.js",
"file_manager/common/js/test_error_reporting.m.js",
"file_manager/common/js/trash.m.js",
"file_manager/common/js/util.m.js",
"file_manager/common/js/volume_manager_types.m.js",
"file_manager/common/js/xfm.m.js",
# Externs:
"file_manager/externs/background/background_base.m.js",
"file_manager/externs/background/crostini.m.js",
"file_manager/externs/background/drive_sync_handler.m.js",
"file_manager/externs/background/duplicate_finder.m.js",
"file_manager/externs/background/file_browser_background_full.m.js",
"file_manager/externs/background/file_operation_manager.m.js",
"file_manager/externs/background/import_history.m.js",
"file_manager/externs/background/media_import_handler.m.js",
"file_manager/externs/background/media_scanner.m.js",
"file_manager/externs/background/progress_center.m.js",
"file_manager/externs/background/task_queue.m.js",
"file_manager/externs/background_window.m.js",
"file_manager/externs/command_handler_deps.m.js",
"file_manager/externs/directory_change_event.m.js",
"file_manager/externs/drive_dialog_controller.m.js",
"file_manager/externs/entry_location.m.js",
"file_manager/externs/entries_changed_event.m.js",
"file_manager/externs/exif_entry.m.js",
"file_manager/externs/files_app_entry_interfaces.m.js",
"file_manager/externs/metadata_worker_window.m.js",
"file_manager/externs/progress_center_panel.m.js",
"file_manager/externs/volume_info.m.js",
"file_manager/externs/volume_info_list.m.js",
"file_manager/externs/volume_manager.m.js",
# Files app Background:
"file_manager/background/js/app_window_wrapper.m.js",
"file_manager/background/js/app_windows.m.js",
"file_manager/background/js/background.m.js",
"file_manager/background/js/background_base.m.js",
"file_manager/background/js/crostini.m.js",
"file_manager/background/js/device_handler.m.js",
"file_manager/background/js/drive_sync_handler.m.js",
"file_manager/background/js/duplicate_finder.m.js",
"file_manager/background/js/entry_location_impl.m.js",
"file_manager/background/js/file_operation_handler.m.js",
"file_manager/background/js/file_operation_manager.m.js",
"file_manager/background/js/file_operation_util.m.js",
"file_manager/background/js/import_history.m.js",
"file_manager/background/js/launcher.m.js",
"file_manager/background/js/media_import_handler.m.js",
"file_manager/background/js/media_scanner.m.js",
"file_manager/background/js/metadata_proxy.m.js",
"file_manager/background/js/metrics_start.m.js",
"file_manager/background/js/mount_metrics.m.js",
"file_manager/background/js/progress_center.m.js",
"file_manager/background/js/task_queue.m.js",
"file_manager/background/js/test_util.m.js",
"file_manager/background/js/test_util_base.m.js",
"file_manager/background/js/trash.m.js",
"file_manager/background/js/volume_info_impl.m.js",
"file_manager/background/js/volume_info_list_impl.m.js",
"file_manager/background/js/volume_manager_factory.m.js",
"file_manager/background/js/volume_manager_impl.m.js",
"file_manager/background/js/volume_manager_util.m.js",
# Files app Foreground:
"file_manager/foreground/js/actions_controller.m.js",
"file_manager/foreground/js/actions_model.m.js",
"file_manager/foreground/js/android_app_list_model.m.js",
"file_manager/foreground/js/app_state_controller.m.js",
"file_manager/foreground/js/column_visibility_controller.m.js",
"file_manager/foreground/js/constants.m.js",
"file_manager/foreground/js/crossover_search_utils.m.js",
"file_manager/foreground/js/crostini_controller.m.js",
"file_manager/foreground/js/dialog_action_controller.m.js",
"file_manager/foreground/js/dialog_type.m.js",
"file_manager/foreground/js/directory_contents.m.js",
"file_manager/foreground/js/directory_model.m.js",
"file_manager/foreground/js/directory_tree_naming_controller.m.js",
"file_manager/foreground/js/drive_dialog_controller.m.js",
"file_manager/foreground/js/drop_effect_and_label.m.js",
"file_manager/foreground/js/empty_folder_controller.m.js",
"file_manager/foreground/js/file_list_model.m.js",
"file_manager/foreground/js/file_manager.m.js",
"file_manager/foreground/js/file_manager_commands.m.js",
"file_manager/foreground/js/file_selection.m.js",
"file_manager/foreground/js/file_tasks.m.js",
"file_manager/foreground/js/file_transfer_controller.m.js",
"file_manager/foreground/js/file_type_filters_controller.m.js",
"file_manager/foreground/js/file_watcher.m.js",
"file_manager/foreground/js/folder_shortcuts_data_model.m.js",
"file_manager/foreground/js/gear_menu_controller.m.js",
"file_manager/foreground/js/holding_space_util.m.js",
"file_manager/foreground/js/import_controller.m.js",
"file_manager/foreground/js/last_modified_controller.m.js",
"file_manager/foreground/js/launch_param.m.js",
"file_manager/foreground/js/list_thumbnail_loader.m.js",
"file_manager/foreground/js/main_window_component.m.js",
"file_manager/foreground/js/metadata_box_controller.m.js",
"file_manager/foreground/js/metadata_update_controller.m.js",
"file_manager/foreground/js/metrics_start.m.js",
"file_manager/foreground/js/naming_controller.m.js",
"file_manager/foreground/js/navigation_list_model.m.js",
"file_manager/foreground/js/navigation_uma.m.js",
"file_manager/foreground/js/path_component.m.js",
"file_manager/foreground/js/providers_model.m.js",
"file_manager/foreground/js/quick_view_controller.m.js",
"file_manager/foreground/js/quick_view_model.m.js",
"file_manager/foreground/js/quick_view_uma.m.js",
"file_manager/foreground/js/scan_controller.m.js",
"file_manager/foreground/js/search_controller.m.js",
"file_manager/foreground/js/selection_menu_controller.m.js",
"file_manager/foreground/js/sort_menu_controller.m.js",
"file_manager/foreground/js/spinner_controller.m.js",
"file_manager/foreground/js/task_controller.m.js",
"file_manager/foreground/js/task_history.m.js",
"file_manager/foreground/js/thumbnail_loader.m.js",
"file_manager/foreground/js/toolbar_controller.m.js",
"file_manager/foreground/js/webui_command_extender.m.js",
# Files app Elements:
"file_manager/foreground/elements/icons.m.js",
"file_manager/foreground/elements/files_format_dialog.js",
"file_manager/foreground/elements/files_icon_button.js",
"file_manager/foreground/elements/files_message.m.js",
"file_manager/foreground/elements/files_metadata_box.js",
"file_manager/foreground/elements/files_metadata_entry.js",
"file_manager/foreground/elements/files_password_dialog.m.js",
"file_manager/foreground/elements/files_quick_view.js",
"file_manager/foreground/elements/files_ripple.js",
"file_manager/foreground/elements/files_safe_media.js",
"file_manager/foreground/elements/files_spinner.m.js",
"file_manager/foreground/elements/files_toast.js",
"file_manager/foreground/elements/files_toggle_ripple.js",
"file_manager/foreground/elements/files_tooltip.js",
"file_manager/foreground/elements/xf_button.m.js",
"file_manager/foreground/elements/xf_circular_progress.m.js",
"file_manager/foreground/elements/xf_display_panel.m.js",
"file_manager/foreground/elements/xf_panel_item.m.js",
# Files app UI:
"file_manager/foreground/js/ui/a11y_announce.m.js",
"file_manager/foreground/js/ui/action_model_ui.m.js",
"file_manager/foreground/js/ui/actions_submenu.m.js",
"file_manager/foreground/js/ui/autocomplete_list.m.js",
"file_manager/foreground/js/ui/banners.m.js",
"file_manager/foreground/js/ui/breadcrumb.m.js",
"file_manager/foreground/js/ui/combobutton.m.js",
"file_manager/foreground/js/ui/commandbutton.m.js",
"file_manager/foreground/js/ui/default_task_dialog.m.js",
"file_manager/foreground/js/ui/dialog_footer.m.js",
"file_manager/foreground/js/ui/directory_tree.m.js",
"file_manager/foreground/js/ui/drag_selector.m.js",
"file_manager/foreground/js/ui/import_crostini_image_dialog.m.js",
"file_manager/foreground/js/ui/install_linux_package_dialog.m.js",
"file_manager/foreground/js/ui/empty_folder.m.js",
"file_manager/foreground/js/ui/file_grid.m.js",
"file_manager/foreground/js/ui/file_list_selection_model.m.js",
"file_manager/foreground/js/ui/file_manager_dialog_base.m.js",
"file_manager/foreground/js/ui/file_manager_ui.m.js",
"file_manager/foreground/js/ui/file_metadata_formatter.m.js",
"file_manager/foreground/js/ui/file_table.m.js",
"file_manager/foreground/js/ui/file_table_list.m.js",
"file_manager/foreground/js/ui/file_tap_handler.m.js",
"file_manager/foreground/js/ui/files_alert_dialog.m.js",
"file_manager/foreground/js/ui/files_confirm_dialog.m.js",
"file_manager/foreground/js/ui/files_menu.m.js",
"file_manager/foreground/js/ui/gear_menu.m.js",
"file_manager/foreground/js/ui/list_container.m.js",
"file_manager/foreground/js/ui/location_line.m.js",
"file_manager/foreground/js/ui/multi_menu.m.js",
"file_manager/foreground/js/ui/multi_menu_button.m.js",
"file_manager/foreground/js/ui/progress_center_panel.m.js",
"file_manager/foreground/js/ui/providers_menu.m.js",
"file_manager/foreground/js/ui/search_box.m.js",
"file_manager/foreground/js/ui/table/table.m.js",
"file_manager/foreground/js/ui/table/table_column.m.js",
"file_manager/foreground/js/ui/table/table_column_model.m.js",
"file_manager/foreground/js/ui/table/table_header.m.js",
"file_manager/foreground/js/ui/table/table_list.m.js",
"file_manager/foreground/js/ui/table/table_splitter.m.js",
# Image Loader:
"image_loader/cache.m.js",
"image_loader/image_loader.m.js",
"image_loader/image_loader_client.m.js",
"image_loader/image_loader_util.m.js",
"image_loader/image_request_task.m.js",
"image_loader/load_image_request.m.js",
"image_loader/piex_loader.m.js",
"image_loader/scheduler.m.js",
# Metadata:
"file_manager/foreground/js/metadata/byte_reader.m.js",
"file_manager/foreground/js/metadata/content_metadata_provider.m.js",
"file_manager/foreground/js/metadata/exif_constants.m.js",
"file_manager/foreground/js/metadata/exif_parser.m.js",
"file_manager/foreground/js/metadata/external_metadata_provider.m.js",
"file_manager/foreground/js/metadata/file_system_metadata_provider.m.js",
"file_manager/foreground/js/metadata/function_parallel.m.js",
"file_manager/foreground/js/metadata/function_sequence.m.js",
"file_manager/foreground/js/metadata/id3_parser.m.js",
"file_manager/foreground/js/metadata/image_orientation.m.js",
"file_manager/foreground/js/metadata/image_parsers.m.js",
"file_manager/foreground/js/metadata/metadata_cache_item.m.js",
"file_manager/foreground/js/metadata/metadata_cache_set.m.js",
"file_manager/foreground/js/metadata/metadata_dispatcher.m.js",
"file_manager/foreground/js/metadata/metadata_item.m.js",
"file_manager/foreground/js/metadata/metadata_model.m.js",
"file_manager/foreground/js/metadata/metadata_parser.m.js",
"file_manager/foreground/js/metadata/metadata_provider.m.js",
"file_manager/foreground/js/metadata/metadata_request.m.js",
"file_manager/foreground/js/metadata/mpeg_parser.m.js",
"file_manager/foreground/js/metadata/multi_metadata_provider.m.js",
"file_manager/foreground/js/metadata/thumbnail_model.m.js",
# Video Player:
"video_player/js/error_util.m.js",
"video_player/js/test_util.m.js",
"video_player/js/background.m.js",
"video_player/js/video_player.m.js",
"video_player/js/video_player_native_controls.m.js",
"video_player/js/video_player_metrics.m.js",
]
deps = [
"//ui/file_manager/audio_player/elements:web_components",
"//ui/file_manager/file_manager:gen_main_html",
"//ui/file_manager/file_manager/background/js:modulize",
"//ui/file_manager/file_manager/common/js:modulize",
"//ui/file_manager/file_manager/externs:modulize",
"//ui/file_manager/file_manager/externs/background:modulize",
"//ui/file_manager/file_manager/foreground/elements:elements",
"//ui/file_manager/file_manager/foreground/elements:modulize",
"//ui/file_manager/file_manager/foreground/elements:web_components",
"//ui/file_manager/file_manager/foreground/js:modulize",
"//ui/file_manager/file_manager/foreground/js/metadata:modulize",
"//ui/file_manager/file_manager/foreground/js/ui:modulize",
"//ui/file_manager/file_manager/foreground/js/ui/table:modulize",
"//ui/file_manager/image_loader:modulize",
"//ui/file_manager/video_player/js:modulize",
]
}
grd_prefix = "file_manager_gen"
generated_grd = "$target_gen_dir/${grd_prefix}_resources.grd"
generate_grd("build_grd") {
out_grd = generated_grd
grdp_files = [
"$target_gen_dir/audio_player/static_resources.grdp",
"$target_gen_dir/file_manager/static_resources.grdp",
]
deps = [
":preprocess_generated",
"audio_player:build_static_grdp",
"file_manager:build_static_grdp",
"//ui/file_manager/audio_player/js:build",
"//ui/file_manager/audio_player/js:build_background",
"//ui/file_manager/audio_player/js:build_worker",
"//ui/file_manager/file_manager:fix_broken_images",
]
input_files_base_dir = rebase_path(target_gen_dir, root_build_dir)
input_files = [
"audio_player/js/main.rollup.js",
"audio_player/js/main_background.rollup.js",
"audio_player/js/metadata_worker.rollup.js",
# Fix broken images:
"file_manager/images/files/ui/arrow_right.svg",
"file_manager/images/files/ui/menu_ng.svg",
"file_manager/main_modules.html",
]
resource_path_rewrites = [
"audio_player/js/main.rollup.js|audio_player/js/main.js",
"audio_player/js/main_background.rollup.js|audio_player/js/main_background.js",
"audio_player/js/metadata_worker.rollup.js|audio_player/js/metadata_worker.js",
]
if (optimize_webui) {
input_files += [
# Fix unittestxs: These files are imported via chrome-extension:// URLs:
"file_manager/common/js/app_util.m.js",
"file_manager/common/js/file_type.m.js",
"file_manager/common/js/files_app_entry_types.m.js",
"file_manager/common/js/lru_cache.m.js",
"file_manager/common/js/mock_chrome.m.js",
"file_manager/common/js/power.m.js",
"file_manager/common/js/storage_adapter.m.js",
"file_manager/common/js/test_error_reporting.m.js",
"file_manager/common/js/volume_manager_types.m.js",
"file_manager/common/js/xfm.m.js",
"file_manager/externs/background/background_base.m.js",
"file_manager/externs/entry_location.m.js",
"file_manager/externs/files_app_entry_interfaces.m.js",
"file_manager/externs/volume_info.m.js",
"file_manager/externs/volume_info_list.m.js",
"file_manager/externs/volume_manager.m.js",
"file_manager/foreground/js/metadata/image_orientation.m.js",
"image_loader/image_loader_client.m.js",
"image_loader/load_image_request.m.js",
"file_manager/background/js/main_background.m.rollup.js",
"file_manager/foreground/js/deferred_elements.m.rollup.js",
"file_manager/foreground/js/main.m.rollup.js",
"file_manager/foreground/js/metadata_dispatcher.m.rollup.js",
"file_manager/foreground/js/shared.m.rollup.js",
"image_loader/background.m.rollup.js",
"video_player/js/main.m.rollup.js",
"video_player/js/main_background.m.rollup.js",
]
resource_path_rewrites += [
"file_manager/background/js/main_background.m.rollup.js|file_manager/background/js/main_background.m.js",
"file_manager/foreground/js/deferred_elements.m.rollup.js|file_manager/foreground/js/deferred_elements.m.js",
"file_manager/foreground/js/main.m.rollup.js|file_manager/foreground/js/main.m.js",
"file_manager/foreground/js/metadata_dispatcher.m.rollup.js|file_manager/foreground/js/metadata/metadata_dispatcher.m.js",
"image_loader/background.m.rollup.js|image_loader/background.m.js",
"video_player/js/main.m.rollup.js|video_player/js/main.m.js",
"video_player/js/main_background.m.rollup.js|video_player/js/main_background.m.js",
]
deps += [
"//ui/file_manager/file_manager/background/js:build",
"//ui/file_manager/file_manager/foreground/elements:elements",
"//ui/file_manager/file_manager/foreground/js:build",
"//ui/file_manager/file_manager/foreground/js:build_worker",
"//ui/file_manager/image_loader:build",
"//ui/file_manager/video_player/js:build",
"//ui/file_manager/video_player/js:build_background",
]
} else {
manifest_files = [
"$target_gen_dir/manifest_preprocess_generated.json",
"$target_gen_dir/manifest_preprocess_static.json",
]
deps += [ ":preprocess_static" ]
}
}
# Resources for the JS modules.
grit("file_manager_gen_resources") {
defines = chrome_grit_defines
# These arguments are needed since the grd is generated at build time.
enable_input_discovery_for_gn_analyze = false
source = generated_grd
deps = [ ":build_grd" ]
outputs = [
"grit/file_manager_gen_resources.h",
"grit/file_manager_gen_resources_map.cc",
"grit/file_manager_gen_resources_map.h",
"file_manager_gen_resources.pak",
]
output_dir = target_gen_dir
}