diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/DecompressorValue.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/DecompressorValue.java index c1eb7df009ddfc..760cfc4a4d0908 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/repository/DecompressorValue.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/DecompressorValue.java @@ -92,7 +92,10 @@ public int hashCode() { static Decompressor getDecompressor(Path archivePath) throws RepositoryFunctionException { String baseName = archivePath.getBaseName(); - if (baseName.endsWith(".zip") || baseName.endsWith(".jar") || baseName.endsWith(".war")) { + if (baseName.endsWith(".zip") + || baseName.endsWith(".jar") + || baseName.endsWith(".war") + || baseName.endsWith(".aar")) { return ZipDecompressor.INSTANCE; } else if (baseName.endsWith(".tar")) { return TarFunction.INSTANCE; @@ -105,8 +108,8 @@ static Decompressor getDecompressor(Path archivePath) } else { throw new RepositoryFunctionException( Starlark.errorf( - "Expected a file with a .zip, .jar, .war, .tar, .tar.gz, .tgz, .tar.xz, .txz, or " - + ".tar.bz2 suffix (got %s)", + "Expected a file with a .zip, .jar, .war, .aar, .tar, .tar.gz, .tgz, .tar.xz, .txz, " + + "or .tar.bz2 suffix (got %s)", archivePath), Transience.PERSISTENT); } diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/repository/StarlarkRepositoryContextApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/repository/StarlarkRepositoryContextApi.java index 45d595d63e8bcb..dc7df73f08466d 100644 --- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/repository/StarlarkRepositoryContextApi.java +++ b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/repository/StarlarkRepositoryContextApi.java @@ -502,7 +502,8 @@ void extract(Object archive, Object output, String stripPrefix, StarlarkThread t + " 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\", \"war\", \"tar.gz\", \"tgz\", \"tar.bz2\", or \"tar.xz\" here."), + + " \"jar\", \"war\", \"aar\", \"tar.gz\", \"tgz\", \"tar.bz2\", or \"tar.xz\"" + + " here."), @Param( name = "stripPrefix", defaultValue = "''", diff --git a/tools/build_defs/repo/http.bzl b/tools/build_defs/repo/http.bzl index a3d3aa4e73d3cf..25c6b8ad1de5aa 100644 --- a/tools/build_defs/repo/http.bzl +++ b/tools/build_defs/repo/http.bzl @@ -278,7 +278,7 @@ match a directory in the archive, Bazel will return an error.""", By default, the archive type is determined from the file extension of the URL. If the file has no extension, you can explicitly specify one of the -following: `"zip"`, `"jar"`, `"war"`, `"tar"`, `"tar.gz"`, `"tgz"`, +following: `"zip"`, `"jar"`, `"war"`, `"aar"`, `"tar"`, `"tar.gz"`, `"tgz"`, `"tar.xz"`, or `tar.bz2`.""", ), "patches": attr.label_list( @@ -367,8 +367,8 @@ http_archive = repository_rule( """Downloads a Bazel repository as a compressed archive file, decompresses it, and makes its targets available for binding. -It supports the following file extensions: `"zip"`, `"jar"`, `"war"`, `"tar"`, -`"tar.gz"`, `"tgz"`, `"tar.xz"`, and `tar.bz2`. +It supports the following file extensions: `"zip"`, `"jar"`, `"war"`, `"aar"`, +`"tar"`, `"tar.gz"`, `"tgz"`, `"tar.xz"`, and `tar.bz2`. Examples: Suppose the current repository contains the source code for a chat program,