Skip to content

Commit

Permalink
Mark PACKAGE_NAME and REPOSITORY_NAME as deprecated.
Browse files Browse the repository at this point in the history
RELNOTES: None.
PiperOrigin-RevId: 162475651
  • Loading branch information
laurentlb authored and aehlig committed Jul 19, 2017
1 parent b8514f5 commit 286f1e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion site/docs/skylark/macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def my_macro(name, visibility=None):
```

If you need to know the package name (i.e. which BUILD file is calling the
macro), use the constant [PACKAGE_NAME](lib/globals.html#PACKAGE_NAME).
macro), use the function [native.package_name()](lib/native.html#package_name).

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public void repr(SkylarkPrinter printer) {
public static final NoneType NONE = new NoneType();

@SkylarkSignature(name = "PACKAGE_NAME", returnType = String.class,
doc = "The name of the package being evaluated. "
doc = "<b>Deprecated. Use <a href=\"native.html#package_name\">package_name()</a> "
+ "instead.</b> The name of the package being evaluated. "
+ "For example, in the BUILD file <code>some/package/BUILD</code>, its value "
+ "will be <code>some/package</code>. "
+ "If the BUILD file calls a function defined in a .bzl file, PACKAGE_NAME will "
Expand All @@ -117,7 +118,8 @@ public void repr(SkylarkPrinter printer) {
public static final String PKG_NAME = "PACKAGE_NAME";

@SkylarkSignature(name = "REPOSITORY_NAME", returnType = String.class,
doc = "The name of the repository the rule or build extension is called from. "
doc = "<b>Deprecated. Use <a href=\"native.html#repository_name\">repository_name()</a> "
+ "instead.</b> The name of the repository the rule or build extension is called from. "
+ "For example, in packages that are called into existence by the WORKSPACE stanza "
+ "<code>local_repository(name='local', path=...)</code> it will be set to "
+ "<code>@local</code>. In packages in the main repository, it will be empty. "
Expand Down

0 comments on commit 286f1e9

Please sign in to comment.