forked from bazelbuild/bazel-skylib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate docs + remove maprule.md (bazelbuild#137)
Maprule is hidden, see bazelbuild@3721d32
- Loading branch information
1 parent
4c26bf4
commit 084758f
Showing
5 changed files
with
223 additions
and
574 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
## copy_file | ||
|
||
<pre> | ||
copy_file(<a href="#copy_file-name">name</a>, <a href="#copy_file-src">src</a>, <a href="#copy_file-out">out</a>, <a href="#copy_file-is_executable">is_executable</a>, <a href="#copy_file-kwargs">kwargs</a>) | ||
</pre> | ||
|
||
Copies a file to another location. | ||
|
||
`native.genrule()` is sometimes used to copy files (often wishing to rename them). The 'copy_file' rule does this with a simpler interface than genrule. | ||
|
||
This rule uses a Bash command on Linux/macOS/non-Windows, and a cmd.exe command on Windows (no Bash is required). | ||
|
||
|
||
### Parameters | ||
|
||
<table class="params-table"> | ||
<colgroup> | ||
<col class="col-param" /> | ||
<col class="col-description" /> | ||
</colgroup> | ||
<tbody> | ||
<tr id="copy_file-name"> | ||
<td><code>name</code></td> | ||
<td> | ||
required. | ||
<p> | ||
Name of the rule. | ||
</p> | ||
</td> | ||
</tr> | ||
<tr id="copy_file-src"> | ||
<td><code>src</code></td> | ||
<td> | ||
required. | ||
<p> | ||
A Label. The file to make a copy of. (Can also be the label of a rule | ||
that generates a file.) | ||
</p> | ||
</td> | ||
</tr> | ||
<tr id="copy_file-out"> | ||
<td><code>out</code></td> | ||
<td> | ||
required. | ||
<p> | ||
Path of the output file, relative to this package. | ||
</p> | ||
</td> | ||
</tr> | ||
<tr id="copy_file-is_executable"> | ||
<td><code>is_executable</code></td> | ||
<td> | ||
optional. default is <code>False</code> | ||
<p> | ||
A boolean. Whether to make the output file executable. When | ||
True, the rule's output can be executed using `bazel run` and can be | ||
in the srcs of binary and test rules that require executable sources. | ||
</p> | ||
</td> | ||
</tr> | ||
<tr id="copy_file-kwargs"> | ||
<td><code>kwargs</code></td> | ||
<td> | ||
optional. | ||
<p> | ||
further keyword arguments, e.g. `visibility` | ||
</p> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
## diff_test | ||
|
||
<pre> | ||
diff_test(<a href="#diff_test-name">name</a>, <a href="#diff_test-file1">file1</a>, <a href="#diff_test-file2">file2</a>, <a href="#diff_test-expect_same">expect_same</a>, <a href="#diff_test-kwargs">kwargs</a>) | ||
</pre> | ||
|
||
A test that compares the contents of two files. | ||
|
||
The test succeeds when the files are expected to be the same (with regard to | ||
file contents) and are in fact the same, or when the files are expected to | ||
be different and are in fact so. | ||
|
||
|
||
### Parameters | ||
|
||
<table class="params-table"> | ||
<colgroup> | ||
<col class="col-param" /> | ||
<col class="col-description" /> | ||
</colgroup> | ||
<tbody> | ||
<tr id="diff_test-name"> | ||
<td><code>name</code></td> | ||
<td> | ||
required. | ||
<p> | ||
The name of the test rule. | ||
</p> | ||
</td> | ||
</tr> | ||
<tr id="diff_test-file1"> | ||
<td><code>file1</code></td> | ||
<td> | ||
required. | ||
<p> | ||
Label of the file to compare to <code>file2</code>. | ||
</p> | ||
</td> | ||
</tr> | ||
<tr id="diff_test-file2"> | ||
<td><code>file2</code></td> | ||
<td> | ||
required. | ||
<p> | ||
Label of the file to compare to <code>file1</code>. | ||
</p> | ||
</td> | ||
</tr> | ||
<tr id="diff_test-expect_same"> | ||
<td><code>expect_same</code></td> | ||
<td> | ||
optional. default is <code>True</code> | ||
<p> | ||
Whether the files are expected to be the same or not. The | ||
test passes if this is True and the files are the same, or if this is | ||
False and the files are not the same. | ||
</p> | ||
</td> | ||
</tr> | ||
<tr id="diff_test-kwargs"> | ||
<td><code>kwargs</code></td> | ||
<td> | ||
optional. | ||
<p> | ||
The <a href="https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes-tests">common attributes for tests</a>. | ||
</p> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
|
Oops, something went wrong.