Skip to content

Commit

Permalink
Move ui/file_manager/ Closure Compile to GN.
Browse files Browse the repository at this point in the history
See go/closure-compile-gn for details.

This CL converts the Closure Compilation of the file manager from GYP to
GN, and fixes a number of type-checking issues that were somehow
suppressed due to the way the compiler used to be run.

A local closure compile can be run by setting closure_compile = true in
args.gn, and then running ninja -C out/Default webui_closure_compile.
A more localized compile may look like:
ninja -C out/Default ui/file_manager:closure_compile

Bug: 632206
TBR=tbreisacher@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ic95ae50ee2e61cb6b5432cb4c5e13a8ac3b2bb44
Reviewed-on: https://chromium-review.googlesource.com/1018684
Commit-Queue: calamity <calamity@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Reviewed-by: Sasha Morrissey <sashab@chromium.org>
Reviewed-by: Naoki Fukino <fukino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553872}
  • Loading branch information
nik3daz authored and Commit Bot committed Apr 26, 2018
1 parent 116dd7c commit b977693
Show file tree
Hide file tree
Showing 35 changed files with 2,364 additions and 2,511 deletions.
3 changes: 3 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,9 @@ if (closure_compile) {
"chrome/browser/resources:closure_compile",
"ui/webui/resources:closure_compile",
]
if (is_chromeos) {
data_deps += [ "ui/file_manager:closure_compile" ]
}
}
}

Expand Down
50 changes: 50 additions & 0 deletions components/chrome_apps/webstore_widget/cws_widget/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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("//third_party/closure_compiler/compile_js.gni")

js_type_check("closure_compile") {
deps = [
":app_installer",
":cws_webview_client",
":cws_widget_container",
":cws_widget_container_error_dialog",
":cws_widget_container_platform_delegate",
]
}

js_library("app_installer") {
deps = [
":cws_widget_container_platform_delegate",
]
}

js_library("cws_widget_container") {
deps = [
":app_installer",
":cws_webview_client",
":cws_widget_container_error_dialog",
]
}

js_library("cws_widget_container_error_dialog") {
deps = [
"//ui/webui/resources/js/cr/ui:dialogs",
]
}

js_library("cws_widget_container_platform_delegate") {
}

js_library("cws_webview_client") {
deps = [
":cws_widget_container_platform_delegate",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js/cr:event_target",
]
externs_list = [
"$externs_path/chrome_extensions.js",
"../externs/webview_tag.js",
]
}

This file was deleted.

12 changes: 0 additions & 12 deletions third_party/analytics/compiled_resources2.gyp

This file was deleted.

1 change: 0 additions & 1 deletion third_party/closure_compiler/compiled_resources2.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
'<(DEPTH)/chrome/browser/resources/print_preview/compiled_resources2.gyp:*',
'<(DEPTH)/chrome/browser/resources/print_preview/new/compiled_resources2.gyp:*',
'<(DEPTH)/chrome/browser/resources/settings/compiled_resources2.gyp:*',
'<(DEPTH)/ui/file_manager/compiled_resources2.gyp:*',
'<(DEPTH)/ui/webui/resources/cr_components/compiled_resources2.gyp:*',
'<(DEPTH)/ui/webui/resources/cr_elements/compiled_resources2.gyp:*',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:*',
Expand Down
19 changes: 19 additions & 0 deletions ui/file_manager/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//third_party/closure_compiler/compile_js.gni")
import("//tools/grit/grit_rule.gni")

grit("resources") {
Expand All @@ -27,3 +28,21 @@ component("file_manager") {
]
defines = [ "FILE_MANAGER_IMPLEMENTATION" ]
}

group("closure_compile") {
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",
"video_player/js:closure_compile",
"video_player/js/cast:closure_compile",
]
}
44 changes: 44 additions & 0 deletions ui/file_manager/audio_player/elements/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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("//third_party/closure_compiler/compile_js.gni")

js_type_check("closure_compile") {
deps = [
":audio_player",
":control_panel",
":repeat_button",
":track_info_panel",
":track_list",
]
}

js_library("audio_player") {
deps = [
":control_panel",
":track_info_panel",
":track_list",
]
}

js_library("control_panel") {
deps = [
":repeat_button",
"//third_party/polymer/v1_0/components-chromium/paper-slider:paper-slider-extracted",
"//ui/webui/resources/js:assert",
]
}

js_library("repeat_button") {
deps = [
"//third_party/polymer/v1_0/components-chromium/iron-behaviors:iron-button-state-extracted",
"//third_party/polymer/v1_0/components-chromium/iron-behaviors:iron-control-state-extracted",
]
}

js_library("track_info_panel") {
}

js_library("track_list") {
}
41 changes: 0 additions & 41 deletions ui/file_manager/audio_player/elements/compiled_resources2.gyp

This file was deleted.

44 changes: 44 additions & 0 deletions ui/file_manager/audio_player/js/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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("//third_party/closure_compiler/compile_js.gni")

js_type_check("closure_compile") {
deps = [
":audio_player",
":background",
":error_util",
":metadata_worker",
]
}

js_library("audio_player") {
deps = [
"../../file_manager/common/js:util",
"../../file_manager/foreground/js:volume_manager_wrapper",
"../../file_manager/foreground/js/metadata:content_metadata_provider",
"../../file_manager/foreground/js/metadata:metadata_model",
"../elements:audio_player",
"../elements:track_list",
]
externs_list = [
"../../externs/audio_player_foreground.js",
"$externs_path/file_manager_private.js",
]
}

js_library("background") {
deps = [
"../../file_manager/background/js:app_window_wrapper",
"../../file_manager/background/js:background_base",
"../../file_manager/common/js:file_type",
"../../file_manager/common/js:util",
]
}

js_library("error_util") {
}

js_library("metadata_worker") {
}
39 changes: 0 additions & 39 deletions ui/file_manager/audio_player/js/compiled_resources2.gyp

This file was deleted.

26 changes: 0 additions & 26 deletions ui/file_manager/compiled_resources2.gyp

This file was deleted.

Loading

0 comments on commit b977693

Please sign in to comment.