blob: 391867ceff8d170e40f0cd5a5aa91b8e5331d083 [file] [log] [blame]
# Copyright 2018 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/browser/resources/tools/optimize_webui.gni")
import("//third_party/closure_compiler/compile_js.gni")
group("closure_compile") {
testonly = true
deps = [
":closure_compile_jsmodules",
":closure_compile_polymer",
]
}
group("js_modules") {
deps = [
":audio_player",
":background",
":error_util",
":main",
":main_background",
":test_util",
]
}
js_type_check("closure_compile_jsmodules") {
deps = [
":background",
":error_util",
":metadata_worker",
]
closure_flags = default_closure_args + [
"js_module_root=gen/ui/file_manager/",
"js_module_root=../../ui/file_manager/",
]
}
js_type_check("closure_compile_polymer") {
is_polymer3 = true
closure_flags = default_closure_args + [
"js_module_root=gen/ui/file_manager/",
"js_module_root=../../ui/file_manager/",
"browser_resolver_prefix_replacements=\"chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/=./file_manager/\"",
"browser_resolver_prefix_replacements=\"chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/=./image_loader/\"",
]
deps = [
":audio_player",
":main",
]
}
js_library("audio_player") {
deps = [
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/file_manager/audio_player/elements:audio_player",
"//ui/file_manager/file_manager/common/js:app_util",
"//ui/file_manager/file_manager/common/js:async_util",
"//ui/file_manager/file_manager/common/js:filtered_volume_manager",
"//ui/file_manager/file_manager/common/js:mediasession_types",
"//ui/file_manager/file_manager/common/js:util",
"//ui/file_manager/file_manager/common/js:volume_manager_types",
"//ui/file_manager/file_manager/externs:volume_manager",
"//ui/file_manager/file_manager/foreground/js/metadata:content_metadata_provider",
"//ui/file_manager/file_manager/foreground/js/metadata:metadata_model",
"//ui/webui/resources/js:load_time_data.m",
]
externs_list = [
"//ui/file_manager/file_manager/externs/audio_player_foreground.js",
"$externs_path/mediasession.js",
]
}
js_library("background") {
deps = [
"//ui/file_manager/file_manager/background/js:app_window_wrapper",
"//ui/file_manager/file_manager/background/js:background_base",
"//ui/file_manager/file_manager/common/js:file_type",
"//ui/file_manager/file_manager/common/js:util",
]
}
js_library("error_util") {
}
js_library("metadata_worker") {
deps = [
"//ui/file_manager/file_manager/foreground/js/metadata:metadata_dispatcher",
]
}
js_library("test_util") {
deps = [
":background",
"//ui/file_manager/file_manager/background/js:test_util_base",
]
}
js_library("main") {
deps = [ ":audio_player" ]
}
js_library("main_background") {
deps = [
":background",
":error_util",
":test_util",
]
}
preprocess_folder =
rebase_path("$target_gen_dir/../../preprocessed/audio_player/js",
root_build_dir)
files_app_path =
rebase_path("$root_gen_dir/ui/file_manager/preprocessed/file_manager",
root_build_dir)
image_loader_path =
rebase_path("$root_gen_dir/ui/file_manager/preprocessed/image_loader",
root_build_dir)
optimize_webui("build") {
host = "audio_player"
input = preprocess_folder
js_module_in_files = [ "main.js" ]
js_out_files = [ "main.rollup.js" ]
external_paths = [
"chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj|$files_app_path",
"chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp|$image_loader_path",
]
deps = [
":main",
"//ui/file_manager:preprocess_generated",
"//ui/file_manager:preprocess_static",
"//ui/webui/resources:preprocess",
]
}
optimize_webui("build_worker") {
host = "audio_player"
input = preprocess_folder
js_module_in_files = [ "metadata_worker.js" ]
js_out_files = [ "metadata_worker.rollup.js" ]
external_paths = [
"chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj|$files_app_path",
"chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp|$image_loader_path",
]
deps = [
"//ui/file_manager:preprocess_generated",
"//ui/file_manager:preprocess_static",
"//ui/webui/resources:preprocess",
]
}
optimize_webui("build_background") {
host = "audio_player"
input = preprocess_folder
js_module_in_files = [
"main_background.js",
"../../file_manager/background/js/runtime_loaded_test_util.js",
]
js_out_files = [
"main_background.rollup.js",
"runtime_loaded_test_util.rollup.js",
"shared.m.rollup.js",
]
external_paths = [
"chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj|$files_app_path",
"chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp|$image_loader_path",
]
deps = [
":main_background",
"//ui/file_manager:preprocess_generated",
"//ui/file_manager:preprocess_static",
"//ui/webui/resources:preprocess",
]
}