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

Unified Diff: docs/closure_compilation.md

Issue 1780873002: Closure: more v2-specific changes, typo and rendering fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@closure-doc2
Patch Set: Created 4 years, 9 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 | « no previous file | no next file » | 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 7502d51cf747aef37c814d8601221f30716b674e..540abf6cb4a027e7216fa99395ea843cd664d0f2 100644
--- a/docs/closure_compilation.md
+++ b/docs/closure_compilation.md
@@ -18,7 +18,7 @@ On Mac or Windows, visit:
We use GYP and ninja as our build system. To generate the ninja files from GYP:
```shell
-# notice the 2 in compiled_resources.gyp
+# notice the 2 in compiled_resources2.gyp
GYP_GENERATORS=ninja tools/gyp/gyp --depth . third_party/closure_compiler/compiled_resources2.gyp
```
@@ -99,29 +99,23 @@ alert(mensa); // '100 IQ50' instead of 150
In order to check that our code acts as we'd expect, we can create a
- my_project/compiled_resources.gyp
+ my_project/compiled_resources2.gyp
with the contents:
```
-# Copyright 2015 The Chromium Authors. All rights reserved.
+# 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_name': 'my_file', # file name without ".js"
-
- 'variables': { # Only use if necessary (no need to specify empty lists).
- 'depends': [
- 'other_file.js', # or 'other_project/compiled_resources.gyp:target',
- ],
- 'externs': [
- '<(CLOSURE_DIR)/externs/any_needed_externs.js' # e.g. chrome.send(), chrome.app.window, etc.
- ],
- },
-
- 'includes': ['../third_party/closure_compiler/compile_js.gypi'],
+ 'dependencies': [ # No need to specify empty lists.
+ '../compiled_resources2.gyp:other_file',
+ '<(EXTERNS_GYP):any_needed_externs' # e.g. chrome.send(), chrome.app.window, etc.
+ ],
+ 'includes': ['../third_party/closure_compiler/compile_js2.gypi'],
},
],
}
@@ -154,7 +148,7 @@ like this:
'target_name': 'compile_all_resources',
'dependencies': [
# ... other projects ...
-++ '../my_project/compiled_resources.gyp:*',
+++ '../my_project/compiled_resources2.gyp:*',
],
}
]
@@ -172,7 +166,7 @@ Compiled JavaScript is output in
map for use in debugging. In order to use the compiled JavaScript, we can create
a
- my_project/my_project_resources.gpy
+ my_project/my_project_resources.gyp
with the contents:
@@ -225,6 +219,7 @@ with the contents:
```
In your C++, the resource can be retrieved like this:
+
```
base::string16 my_script =
base::UTF8ToUTF16(
@@ -287,6 +282,7 @@ my_project/compiled_resources.gyp
```
with contents similar to this:
+
```
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698