Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions docs/rules/lib/builtins/repository_ctx.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
layout: "doc"
title: "repository_ctx"
---

## repository_ctx

A context object for repository rule implementations.

### download_and_extract

<pre>
struct repository_ctx.download_and_extract(url, output, sha256, type, strip_prefix, strip_components, allow_fail, canonical_id, auth, headers, integrity, rename_files)
</pre>

Downloads a file, extracts it, and returns a struct with success information.

**PARAMETERS**

| Parameter | Description |
| :------------- | :------------- |
| `strip_prefix` | A directory prefix to strip from the extracted files. Many archives contain a top-level directory that contains all files in the archive. Instead of needing to specify this prefix over and over in the `build_file`, this field can be used to strip it from extracted files. <p>For compatibility, this parameter may also be used under the deprecated name `stripPrefix`. Only one of `strip_prefix` or `strip_components` can be used.</p> |
| `strip_components` | Strip the given number of leading components from file paths on extraction. Only one of `strip_components` or `strip_prefix` can be used. |
| *other parameters* | ... |


### extract

<pre>
None repository_ctx.extract(archive, output, strip_prefix, strip_components, rename_files, watch_archive, type)
</pre>

Extract an archive to the repository directory.

**PARAMETERS**

| Parameter | Description |
| :------------- | :------------- |
| `strip_prefix` | A directory prefix to strip from the extracted files. Many archives contain a top-level directory that contains all files in the archive. Instead of needing to specify this prefix over and over in the `build_file`, this field can be used to strip it from extracted files. <p>For compatibility, this parameter may also be used under the deprecated name `stripPrefix`. Only one of `strip_prefix` or `strip_components` can be set.</p> |
| `strip_components` | Strip the given number of leading components from file paths on extraction. Only one of `strip_components` or `strip_prefix` can be set. |
| *other parameters* | ... |
41 changes: 41 additions & 0 deletions site/en/rules/lib/builtins/repository_ctx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
layout: "doc"
title: "repository_ctx"
---

## repository_ctx

A context object for repository rule implementations.

### download_and_extract

<pre>
struct repository_ctx.download_and_extract(url, output, sha256, type, strip_prefix, strip_components, allow_fail, canonical_id, auth, headers, integrity, rename_files)
</pre>

Downloads a file, extracts it, and returns a struct with success information.

**PARAMETERS**

| Parameter | Description |
| :------------- | :------------- |
| `strip_prefix` | A directory prefix to strip from the extracted files. Many archives contain a top-level directory that contains all files in the archive. Instead of needing to specify this prefix over and over in the `build_file`, this field can be used to strip it from extracted files. <p>For compatibility, this parameter may also be used under the deprecated name `stripPrefix`. Only one of `strip_prefix` or `strip_components` can be used.</p> |
| `strip_components` | Strip the given number of leading components from file paths on extraction. Only one of `strip_components` or `strip_prefix` can be used. |
| *other parameters* | ... |


### extract

<pre>
None repository_ctx.extract(archive, output, strip_prefix, strip_components, rename_files, watch_archive, type)
</pre>

Extract an archive to the repository directory.

**PARAMETERS**

| Parameter | Description |
| :------------- | :------------- |
| `strip_prefix` | A directory prefix to strip from the extracted files. Many archives contain a top-level directory that contains all files in the archive. Instead of needing to specify this prefix over and over in the `build_file`, this field can be used to strip it from extracted files. <p>For compatibility, this parameter may also be used under the deprecated name `stripPrefix`. Only one of `strip_prefix` or `strip_components` can be set.</p> |
| `strip_components` | Strip the given number of leading components from file paths on extraction. Only one of `strip_components` or `strip_prefix` can be set. |
| *other parameters* | ... |
Loading