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

Unified Diff: tools/gn/docs/reference.md

Issue 2936923002: Add not_needed function (Closed)
Patch Set: Support current scope Created 3 years, 6 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
Index: tools/gn/docs/reference.md
diff --git a/tools/gn/docs/reference.md b/tools/gn/docs/reference.md
index 735e5f9eadd9afeba60a98dd64826e7044cdb72d..24b78fdee193d1c3845f822b16d929add418d1fb 100644
--- a/tools/gn/docs/reference.md
+++ b/tools/gn/docs/reference.md
@@ -42,6 +42,7 @@
* [get_target_outputs: [file list] Get the list of outputs from a target.](#get_target_outputs)
* [getenv: Get an environment variable.](#getenv)
* [import: Import a file into the current scope.](#import)
+ * [not_needed: Mark variables from scope as not needed.](#not_needed)
* [pool: Defines a pool object.](#pool)
* [print: Prints to the console.](#print)
* [process_file_template: Do template expansion over a list of files.](#process_file_template)
@@ -598,7 +599,7 @@
### <a name="gen:"></a>**gn gen**: Generate ninja files.
```
- gn gen [<ide options>] <out_dir>
+ gn gen [--check] [<ide options>] <out_dir>
Generates ninja files from the current tree and puts them in the given output
directory.
@@ -608,6 +609,9 @@
Or it can be a directory relative to the current directory such as:
out/foo
+ "gn gen --check" is the same as running "gn check". See "gn help check"
+ for documentation on that mode.
+
See "gn help switches" for the common command-line switches.
```
@@ -688,9 +692,10 @@
#### **Generic JSON Output**
```
- Dumps target information to JSON file and optionally invokes python script on
- generated file. See comments at the beginning of json_project_writer.cc and
- desc_builder.cc for overview of JSON file format.
+ Dumps target information to a JSON file and optionally invokes a
+ python script on the generated file. See the comments at the beginning
+ of json_project_writer.cc and desc_builder.cc for an overview of the JSON
+ file format.
--json-file-name=<json_file_name>
Overrides default file name (project.json) of generated JSON file.
@@ -2127,6 +2132,25 @@
# Looks in the current directory.
import("my_vars.gni")
```
+### <a name="not_needed"></a>**not_needed**: Mark variables from scope as not needed.
+
+```
+ not_needed(variable_list_or_star, variable_to_ignore_list = [])
+ not_needed(from_scope, variable_list_or_star,
+ variable_to_ignore_list = [])
+
+ Mark the variables in the current or given scope as not needed, which means
+ you will not get an error about unused variables for these.
+```
+
+#### **Example**
+
+```
+ not_needed("*", [ "config" ])
+ not_needed([ "data_deps", "deps" ])
+ not_needed(invoker, "*", [ "config" ])
+ not_needed(invoker, [ "data_deps", "deps" ])
+```
### <a name="pool"></a>**pool**: Defines a pool object.
```

Powered by Google App Engine
This is Rietveld 408576698