Skip to content

Commit

Permalink
Doc: mention that sibling must be in the same package.
Browse files Browse the repository at this point in the history
RELNOTES: None.
PiperOrigin-RevId: 178609245
  • Loading branch information
laurentlb authored and Copybara-Service committed Dec 11, 2017
1 parent 502d718 commit 30f6d44
Showing 1 changed file with 31 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,34 +102,37 @@ Root newFileRoot() throws EvalException {
}

@SkylarkCallable(
name = "declare_file",
doc =
"Declares that rule or aspect creates a file with the given filename. "
+ "If <code>sibling</code> is not specified, file name is relative to "
+ "package directory, otherwise the file is in the same directory as "
+ "<code>sibling</code>. "
+ "You must create an action that generates the file. <br>"
+ "Files that are specified in rule's outputs do not need to be declared and are "
+ "available through <a href=\"ctx.html#outputs\">ctx.outputs</a>.",
parameters = {
@Param(
name = "filename",
type = String.class,
doc =
"If no 'sibling' provided, path of the new file, relative "
+ "to the current package. Otherwise a base name for a file "
+ "('sibling' determines a directory)."
),
@Param(
name = "sibling",
doc = "A file that lives in the same directory as the newly created file.",
type = Artifact.class,
noneable = true,
positional = false,
named = true,
defaultValue = "None"
)
}
name = "declare_file",
doc =
"Declares that rule or aspect creates a file with the given filename. "
+ "If <code>sibling</code> is not specified, file name is relative to "
+ "package directory, otherwise the file is in the same directory as "
+ "<code>sibling</code>. "
+ "You must create an action that generates the file. <br>"
+ "Files cannot be created outside of the current package. "
+ "Files that are specified in rule's outputs do not need to be declared and are "
+ "available through <a href=\"ctx.html#outputs\">ctx.outputs</a>.",
parameters = {
@Param(
name = "filename",
type = String.class,
doc =
"If no 'sibling' provided, path of the new file, relative "
+ "to the current package. Otherwise a base name for a file "
+ "('sibling' determines a directory)."
),
@Param(
name = "sibling",
doc =
"A file that lives in the same directory as the newly created file. "
+ "The file must be in the current package.",
type = Artifact.class,
noneable = true,
positional = false,
named = true,
defaultValue = "None"
)
}
)
public Artifact declareFile(String filename, Object sibling) throws EvalException {
context.checkMutable("actions.declare_file");
Expand Down

0 comments on commit 30f6d44

Please sign in to comment.