2.2
Changelog
- There is now an
excluded_artifacts
attribute inmaven_install
. Artifacts is this list will be excluded across all transitive dependencies during resolution. (thanks @TheMarex) - Fixed a crash when the
http_proxy
environment variable is set, but empty. (thanks @wlx65003) - Better integration with buildozer to fix dependencies on generated targets. (thanks @borkaehw)
- Coursier has been upgraded to v1.1.0-M14-4. (thanks @mandrean)
Usage
In your WORKSPACE file, add:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_JVM_EXTERNAL_TAG = "2.2"
RULES_JVM_EXTERNAL_SHA = "f1203ce04e232ab6fdd81897cf0ff76f2c04c0741424d192f28e65ae752ce2d6"
http_archive(
name = "rules_jvm_external",
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
sha256 = RULES_JVM_EXTERNAL_SHA,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)
load("@rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
artifacts = [
"androidx.test.espresso:espresso-core:3.1.1",
"junit:junit:4.12",
"com.google.inject:guice:4.0",
],
repositories = [
"https://jcenter.bintray.com/",
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
)
In your BUILD file, reference the targets directly:
android_library(
name = "test_deps",
exports = [
"@maven//:androidx_test_espresso_espresso_core",
"@maven//:junit_junit",
"@maven//:com_google_inject_guice",
],
)