aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar David Chen <dzc@google.com>2016-11-18 21:29:24 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2016-11-21 19:39:27 +0000
commitc43cbb6ee503215aa1309afda511fa7eb9dbf338 (patch)
tree5d9c344cdd745609f38417ecf1fad505b740995e
parent49473f9e25aa610d6d4022e2c3e93828c9a8970a (diff)
Update documentation of native workspace rules.
-- MOS_MIGRATED_REVID=139615907
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/GitRepositoryRule.java4
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpArchiveRule.java13
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpFileRule.java11
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/HttpJarRule.java7
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/NewGitRepositoryRule.java4
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/workspace/NewHttpArchiveRule.java13
6 files changed, 28 insertions, 24 deletions
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 242eca0b5e..f1cc2bc58b 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 @@ cc_library(
<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 7e9d9c9ee7..37093d47a7 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 @@ public class HttpArchiveRule implements RuleDefinition {
/* <!-- #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 @@ public class HttpArchiveRule implements RuleDefinition {
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 @@ cc_library(
<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 72e163842b..2cda4946a5 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 @@ public class HttpFileRule implements RuleDefinition {
/* <!-- #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 @@ public class HttpFileRule implements RuleDefinition {
<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 fdce57e6ad..86cd1523a6 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 @@ public class HttpJarRule implements RuleDefinition {
/* <!-- #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 @@ public class HttpJarRule implements RuleDefinition {
<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 f3ad2f8fba..de757f5373 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 @@ src/
<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 @@ cc_library(
)
</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 2ccbef8512..45c34dd557 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 @@ public class NewHttpArchiveRule implements RuleDefinition {
/* <!-- #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 @@ public class NewHttpArchiveRule implements RuleDefinition {
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 @@ cc_library(
<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 -->*/