Prototype for aar_import_external (downloading without Maven)
This project generates gmaven.bzl, a file containing maven_jar and maven_aar rules for all artifacts in https://maven.google.com.
This project is an interim solution that is supported until Google Maven and AAR support is added to bazel-deps.
To use this from your project, in your WORKSPACE file add
git_repository(
name = 'gmaven_rules',
remote = 'https://github.com/aj-michael/gmaven_rules',
commit = '<FILL IN A COMMIT HERE>',
)
load('@gmaven_rules//:gmaven.bzl', 'gmaven_rules')
gmaven_rules()
You can then reference the generated library targets from your BUILD files like:
load("@gmaven_rules//:defs.bzl", "gmaven_artifact")
android_library(
...
deps = [
gmaven_artifact("com.android.support:design:aar:27.0.2"),
gmaven_artifact("com.android.support:support_annotations:jar:27.0.2"),
gmaven_artifact("com.android.support.test.espresso:espresso_core:aar:3.0.1"),
],
)
You can see the full list of generated targets in gmaven.bzl.
To update gmaven.bzl, run the following command. It will take about 5 minutes.
rm gmaven.bzl && javac GMavenToBazel.java && java GMavenToBazel
Currently, cross-repository dependency resolution is not supported. Some of the artifacts depend on other artifacts that are not present on Google Maven, and these missing dependencies are silently ignored and may cause failures at runtime.