diff options
author | Jingwen Chen <jingwen@google.com> | 2016-09-22 17:46:49 +0000 |
---|---|---|
committer | Laszlo Csomor <laszlocsomor@google.com> | 2016-09-23 08:15:38 +0000 |
commit | 3f0d3b68a273250b1bf70c278d0700a1ed30058c (patch) | |
tree | a42fbe38ccb308930238fea911cef9b1fe2b2370 /WORKSPACE | |
parent | 296ffbde796f00c7a493330089085f9be1442f0b (diff) |
Implementation of maven_jar rule in Skylark.
**Experimental**
This is an initial implementation of the maven_jar rule in Skylark, targeted at
the FRs in issue #1410.
Implemented a wrapper around the maven binary to pull dependencies from
remote repositories into a directory under {output_base}/external.
Attributes `name`, `artifact`, `repository`, `sha1` have been implemented,
but not `server`.
Caveat: this rule assumes that the Maven dependency is installed in the
system. Hence, the maven_skylark_test integration tests are tagged with
"manual" and commented out because the Bazel CI isn't configured with
the Maven binary yet.
Added a serve_not_found helper for 404 response tests.
Usage:
```
load("@bazel_tools//tools/build_defs/repo:maven_rules.bzl", "maven_jar")
maven_jar(
name = "com_google_guava_guava",
artifact = "com.google.guava:guava:18.0",
sha1 = "cce0823396aa693798f8882e64213b1772032b09",
repository = "http://uk.maven.org/maven2",
)
```
With regards to server, there are some limitations with retrieving a
maven_server's attribute at Loading Phase without the use of hacky macros
(issue #1704), and even if macros are used, the maven_server is not treated as
an actual dependency by maven_jar. There is a test (`test_unimplemented_server_attr`)
to ensure that the error message to shown to users if they use the server
attribute with this rule.
--
Change-Id: I167f9d13835c30be971928b4cc60167a8e396893
Reviewed-on: https://bazel-review.googlesource.com/c/5770
MOS_MIGRATED_REVID=133971809
Diffstat (limited to 'WORKSPACE')
-rw-r--r-- | WORKSPACE | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -52,3 +52,8 @@ bind(name = "xcrunwrapper", actual = "@bazel_tools//tools/objc:xcrunwrapper") bind(name = "protobuf/java_runtime", actual = "//third_party/protobuf:protobuf") bind(name = "protobuf/javalite_runtime", actual = "//third_party/protobuf:protobuf-lite") + +# For Skylark tests at //src/test/shell/bazel:maven_skylark_test +# Uncomment the following lines, and the test in src/test/shell/bazel/BUILD to run it. +# load("//tools/build_defs/repo:maven_rules.bzl", "maven_dependency_plugin") +# maven_dependency_plugin() |