Update documentation of native workspace rules.
--
MOS_MIGRATED_REVID=139615907
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/GitRepositoryRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/GitRepositoryRule.java
index 242eca0..f1cc2bc 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/GitRepositoryRule.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/GitRepositoryRule.java
@@ -109,12 +109,12 @@
<pre class="code">
git_repository(
- name = "my-ssl",
+ name = "my_ssl",
remote = "http://example.com/openssl/openssl.git",
tag = "v1.0.2",
)
</pre>
-<p>Then targets would specify <code>@my-ssl//src:openssl-lib</code> as a dependency.</p>
+<p>Then targets would specify <code>@my_ssl//src:openssl-lib</code> as a dependency.</p>
<!-- #END_BLAZE_RULE -->*/
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpArchiveRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpArchiveRule.java
index 7e9d9c9..37093d4 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpArchiveRule.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpArchiveRule.java
@@ -38,8 +38,9 @@
/* <!-- #BLAZE_RULE(http_archive).ATTRIBUTE(url) -->
A URL referencing an archive file containing a Bazel repository.
- <p>Archives of type .zip, .jar, .war, .tar.gz or .tgz are supported. There is no support
- for authentication.</p>
+ <p>This must be a file, http, or https URL. Archives of the following types are allowed:
+ `"zip"`, `"jar"`, `"war"`, `"tar.gz"`, `"tgz"`, `"tar.xz"`, and `tar.bz2`. Redirects
+ are followed. There is no support for authentication.</p>
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(attr("url", STRING).mandatory())
/* <!-- #BLAZE_RULE(http_archive).ATTRIBUTE(sha256) -->
@@ -55,8 +56,8 @@
The archive type of the downloaded file.
<p>By default, the archive type is determined from the file extension of the URL. If the
- file has no extension, you can explicitly specify either "zip", "jar", "tar.gz", or
- "tgz" here.</p>
+ file has no extension, you can explicitly specify one of the following: `"zip"`, `"jar"`,
+ `"war"`, `"tar.gz"`, `"tgz"`, `"tar.xz"`, and `tar.bz2`</p>
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(attr("type", STRING))
/* <!-- #BLAZE_RULE(http_archive).ATTRIBUTE(strip_prefix) -->
@@ -135,12 +136,12 @@
<pre class="code">
http_archive(
- name = "my-ssl",
+ name = "my_ssl",
url = "http://example.com/openssl.zip",
sha256 = "03a58ac630e59778f328af4bcc4acb4f80208ed4",
)
</pre>
-<p>Then targets would specify <code>@my-ssl//src:openssl-lib</code> as a dependency.</p>
+<p>Then targets would specify <code>@my_ssl//src:openssl-lib</code> as a dependency.</p>
<!-- #END_BLAZE_RULE -->*/
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpFileRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpFileRule.java
index 72e1638..2cda494 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpFileRule.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpFileRule.java
@@ -39,7 +39,8 @@
/* <!-- #BLAZE_RULE(http_file).ATTRIBUTE(url) -->
A URL to a file that will be made available to Bazel.
- <p>This must be an http or https URL. Authentication is not supported.</p>
+ <p>This must be a file, http or https URL. Redirects are followed. Authentication is not
+ supported.</p>
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(attr("url", STRING).mandatory())
/* <!-- #BLAZE_RULE(http_file).ATTRIBUTE(sha256) -->
@@ -81,12 +82,12 @@
<pre class="code">
http_file(
- name = "my-deb",
- url = "http://example.com/package.deb",
- sha256 = "03a58ac630e59778f328af4bcc4acb4f80208ed4",
+ name = "my_deb",
+ url = "http://example.com/package.deb",
+ sha256 = "03a58ac630e59778f328af4bcc4acb4f80208ed4",
)
</pre>
- <p>Targets would specify <code>@my-deb//file</code> as a dependency to depend on this file.</p>
+ <p>Targets would specify <code>@my_deb//file</code> as a dependency to depend on this file.</p>
<!-- #END_BLAZE_RULE -->*/
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpJarRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpJarRule.java
index fdce57e..86cd152 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpJarRule.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpJarRule.java
@@ -38,7 +38,8 @@
/* <!-- #BLAZE_RULE(http_jar).ATTRIBUTE(url) -->
A URL to an archive file containing a Bazel repository.
- <p>This must be an http or https URL that ends with .jar.</p>
+ <p>This must be a file, http or https URL that ends with .jar. Redirections are
+ followed. There is no support for authentication.</p>
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(attr("url", STRING).mandatory())
/* <!-- #BLAZE_RULE(http_jar).ATTRIBUTE(sha256) -->
@@ -81,12 +82,12 @@
<pre class="code">
http_jar(
- name = "my-ssl",
+ name = "my_ssl",
url = "http://example.com/openssl-0.2.jar",
sha256 = "03a58ac630e59778f328af4bcc4acb4f80208ed4",
)
</pre>
-<p>Targets would specify <code>@my-ssl//jar</code> as a dependency to depend on this jar.</p>
+<p>Targets would specify <code>@my_ssl//jar</code> as a dependency to depend on this jar.</p>
<!-- #END_BLAZE_RULE -->*/
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/NewGitRepositoryRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/NewGitRepositoryRule.java
index f3ad2f8..de757f5 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/NewGitRepositoryRule.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/NewGitRepositoryRule.java
@@ -113,7 +113,7 @@
<pre class="code">
new_git_repository(
- name = "my-ssl",
+ name = "my_ssl",
remote = "http://example.com/openssl/openssl.git",
tag = "v1.0.2",
build_file_content = """
@@ -125,6 +125,6 @@
)
</pre>
-<p>Then targets would specify <code>@my-ssl//:openssl-lib</code> as a dependency.</p>
+<p>Then targets would specify <code>@my_ssl//:openssl-lib</code> as a dependency.</p>
<!-- #END_BLAZE_RULE -->*/
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/NewHttpArchiveRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/NewHttpArchiveRule.java
index 2ccbef8..45c34dd 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/NewHttpArchiveRule.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/NewHttpArchiveRule.java
@@ -35,8 +35,9 @@
/* <!-- #BLAZE_RULE(new_http_archive).ATTRIBUTE(url) -->
A URL referencing an archive file containing a Bazel repository.
- <p>Archives of type .zip, .jar, .war, .tar.gz or .tgz are supported. There is no support
- for authentication.</p>
+ <p>This must be a file, http, or https URL. Archives of the following types are allowed:
+ `"zip"`, `"jar"`, `"war"`, `"tar.gz"`, `"tgz"`, `"tar.xz"`, and `tar.bz2`. Redirects
+ are followed. There is no support for authentication.</p>
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(attr("url", STRING).mandatory())
/* <!-- #BLAZE_RULE(new_http_archive).ATTRIBUTE(sha256) -->
@@ -68,8 +69,8 @@
The archive type of the downloaded file.
<p>By default, the archive type is determined from the file extension of the URL. If the
- file has no extension, you can explicitly specify either "zip", "jar", "tar.gz", or
- "tgz" here.</p>
+ file has no extension, you can explicitly specify one of the following: `"zip"`, `"jar"`,
+ `"war"`, `"tar.gz"`, `"tgz"`, `"tar.xz"`, and `tar.bz2`</p>
<!-- #END_BLAZE_RULE.ATTRIBUTE --> */
.add(attr("type", STRING))
/* <!-- #BLAZE_RULE(new_http_archive).ATTRIBUTE(strip_prefix) -->
@@ -144,14 +145,14 @@
<pre class="code">
new_http_archive(
- name = "my-ssl",
+ name = "my_ssl",
url = "http://example.com/openssl.zip",
sha256 = "03a58ac630e59778f328af4bcc4acb4f80208ed4",
build_file = "BUILD.ssl",
)
</pre>
-<p>Targets would specify <code>@my-ssl//:openssl-lib</code> as a dependency to depend on this
+<p>Targets would specify <code>@my_ssl//:openssl-lib</code> as a dependency to depend on this
jar.</p>
<!-- #END_BLAZE_RULE -->*/