Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Unified Diff: docs/closure_compilation.md

Issue 2247353004: GN files for running Closure Compiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add script to generate polymer gn files Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/chromeos/network_ui/BUILD.gn ('k') | third_party/closure_compiler/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/closure_compilation.md
diff --git a/docs/closure_compilation.md b/docs/closure_compilation.md
index 5ba5e05e293cff7c2b97332da13f173b3fb1d34c..d258d49a93cf4029b62d7e0c9b8c32707f5d2bb9 100644
--- a/docs/closure_compilation.md
+++ b/docs/closure_compilation.md
@@ -82,33 +82,46 @@ alert(mensa); // '100 IQ50' instead of 150
Closure compiler can notify us if we're using `string`s and `number`s in
dangerous ways.
-To do this, we can create:
+To do this, we can create (or add to):
- + ui/compiled_resources2.gyp
+ + ui/BUILD.gn
With these contents:
```
+
# Copyright 2016 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.
-{
- 'targets': [
- {
- # Target names is typically just without ".js"
- 'target_name': 'makes_things_pretty',
-
- 'dependencies': [
- '../lib/compiled_resources2.gyp:does_the_hard_stuff',
-
- # Teaches closure about non-standard environments/APIs, e.g.
- # chrome.send(), chrome.app.window, etc.
- '<(EXTERNS_GYP):extern_name_goes_here'
- ],
-
- 'includes': ['../path/to/third_party/closure_compiler/compile_js2.gypi'],
- },
- ],
+import("//third_party/closure_compiler/compile_js2.gni")
+
+# Target name is typically compile_<root file name> but can be anything
+compile_js("compile_make_things_pretty") {
+ source_files = ["make_things_pretty.js"]
+ deps = ["../lib:compile_does_the_hard_stuff"]
+ externs = "extern_name_goes_here"
+}
+...
+
+# Create a group to include all compilations in this GN file
+group("compile_js") {
+ deps = [
+ :compile_make_things_pretty,
+ ...
+ ]
+}
+
+```
+
+To include this in builds add your new target to the `'deps'` list in
+`src/third_party/closure_compiler/BUILD.gn`:
+
+```
+group("compile_js_all") {
+ deps = [
+ # ... other projects ...
+++ "//my_project:compile_js",
+ ]
}
```
@@ -174,24 +187,6 @@ CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation
Working in common resource directories in Chrome automatically adds this line
for you.
-## Integrating with the continuous build
-
-To compile your code on every commit, add your file to the `'dependencies'` list
-in `src/third_party/closure_compiler/compiled_resources2.gyp`:
-
-```
-{
- 'targets': [
- {
- 'target_name': 'compile_all_resources',
- 'dependencies': [
- # ... other projects ...
-++ '../my_project/compiled_resources2.gyp:*',
- ],
- }
- ]
-}
-```
This file is used by the
[Closure compiler bot](http://build.chromium.org/p/chromium.fyi/builders/Closure%20Compilation%20Linux)
« no previous file with comments | « chrome/browser/resources/chromeos/network_ui/BUILD.gn ('k') | third_party/closure_compiler/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698