Skip to content

Commit

Permalink
[Closure GN] Convert simple WebUI Closure Compilation 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 from GYP to GN for the following:
- cryptotoken
- download_internals
- md_downloads
- md_extensions
- md_history
- md_user_manager
- offline_pages
- signin
- webapks
- welcome

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.
Individual projects can be compiled via, for example,
ninja -C out/Default chrome/browser/resources/md_extensions:closure_compile

Bug: 632206
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I401fc54ee6c5202bd27855ba28d886677e52210e
Reviewed-on: https://chromium-review.googlesource.com/954772
Commit-Queue: calamity <calamity@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550956}
  • Loading branch information
nik3daz authored and Commit Bot committed Apr 16, 2018
1 parent dcb5b1f commit 673e013
Show file tree
Hide file tree
Showing 25 changed files with 827 additions and 792 deletions.
9 changes: 9 additions & 0 deletions chrome/browser/resources/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ assert(!is_ios, "Chromium/iOS shouldn't use anything in //chrome")
if (closure_compile) {
group("closure_compile") {
deps = [
"cryptotoken:closure_compile",
"engagement:closure_compile",
"md_bookmarks:closure_compile",
"md_downloads:closure_compile",
"md_extensions:closure_compile",
"md_history:closure_compile",
"md_user_manager:closure_compile",
"offline_pages:closure_compile",
"signin/dice_sync_confirmation:closure_compile",
"webapks:closure_compile",
"welcome/dice_welcome:closure_compile",
]
}
}
Expand Down
50 changes: 50 additions & 0 deletions chrome/browser/resources/cryptotoken/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 = [
":approvedorigins",
":b64",
":closeable",
":countdown",
":errorcodes",
":inherits",
":origincheck",
":sha256",
":textfetcher",
":timer",
]
}

js_library("errorcodes") {
}

js_library("b64") {
}

js_library("approvedorigins") {
}

js_library("closeable") {
}

js_library("countdown") {
}

js_library("inherits") {
}

js_library("origincheck") {
}

js_library("sha256") {
}

js_library("textfetcher") {
}

js_library("timer") {
}
47 changes: 0 additions & 47 deletions chrome/browser/resources/cryptotoken/compiled_resources2.gyp

This file was deleted.

36 changes: 36 additions & 0 deletions chrome/browser/resources/download_internals/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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 = [
":download_internals",
":download_internals_browser_proxy",
":download_internals_visuals",
]
}

js_library("download_internals") {
deps = [
":download_internals_browser_proxy",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:util",
]
}

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

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

This file was deleted.

89 changes: 89 additions & 0 deletions chrome/browser/resources/md_downloads/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 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")
import("../optimize_webui.gni")

optimize_webui("build") {
Expand All @@ -9,3 +14,87 @@ optimize_webui("build") {
insert_in_head = "<base href=chrome://downloads>"
js_out_files = [ "crisper.js" ]
}

js_type_check("closure_compile") {
deps = [
":browser_proxy",
":constants",
":downloads",
":externs",
":item",
":manager",
":search_service",
":toolbar",
]
}

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

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

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

js_library("externs") {
}

js_library("item") {
deps = [
":browser_proxy",
":constants",
":externs",
"//third_party/polymer/v1_0/components-chromium/paper-behaviors:paper-inky-focus-behavior-extracted",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:util",
]
}

js_library("manager") {
deps = [
":browser_proxy",
":externs",
":item",
":search_service",
":toolbar",
"//third_party/polymer/v1_0/components-chromium/iron-list:iron-list-extracted",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:util",
"//ui/webui/resources/js/cr:ui",
"//ui/webui/resources/js/cr/ui:command",
]
externs_list = [ "$externs_path/chrome_send.js" ]
}

js_library("search_service") {
deps = [
":browser_proxy",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:load_time_data",
]
}

js_library("toolbar") {
deps = [
":browser_proxy",
":search_service",
"//third_party/polymer/v1_0/components-chromium/iron-a11y-announcer:iron-a11y-announcer-extracted",
"//ui/webui/resources/cr_elements/cr_action_menu:cr_action_menu",
"//ui/webui/resources/cr_elements/cr_toolbar:cr_toolbar",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:util",
]
}
84 changes: 0 additions & 84 deletions chrome/browser/resources/md_downloads/compiled_resources2.gyp

This file was deleted.

Loading

0 comments on commit 673e013

Please sign in to comment.