summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authordbeam <dbeam@chromium.org>2016-03-10 10:30:36 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-10 18:33:01 +0000
commit1ff345867aad0aab194da5acf8d46410f27d6494 (patch)
tree9fe2ece79656f7cf24a3722649061fd3abc7be0e /docs
parent188420007f05ecba5074a272fe66a3553a3056e7 (diff)
downloadchromium_src-1ff345867aad0aab194da5acf8d46410f27d6494.zip
chromium_src-1ff345867aad0aab194da5acf8d46410f27d6494.tar.gz
chromium_src-1ff345867aad0aab194da5acf8d46410f27d6494.tar.bz2
Closure: more v2-specific changes, typo and rendering fixes
R=dpapad@chromium.org BUG=585553 NOTRY=true Review URL: https://codereview.chromium.org/1780873002 Cr-Commit-Position: refs/heads/master@{#380437}
Diffstat (limited to 'docs')
-rw-r--r--docs/closure_compilation.md28
1 files changed, 12 insertions, 16 deletions
diff --git a/docs/closure_compilation.md b/docs/closure_compilation.md
index 7502d51..540abf6 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