Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bazelbuild/gmaven_rules
This repository is deprecated. Please instead use https://github.com/bazelbuild/rules_jvm_external
https://github.com/bazelbuild/gmaven_rules
Last synced: 11 days ago
JSON representation
This repository is deprecated. Please instead use https://github.com/bazelbuild/rules_jvm_external
- Host: GitHub
- URL: https://github.com/bazelbuild/gmaven_rules
- Owner: bazelbuild
- License: apache-2.0
- Archived: true
- Created: 2019-03-13T17:48:39.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-03-13T17:56:49.000Z (over 5 years ago)
- Last Synced: 2024-07-31T07:15:52.106Z (3 months ago)
- Language: Python
- Homepage:
- Size: 1.47 MB
- Stars: 3
- Watchers: 10
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
- Authors: AUTHORS
Awesome Lists containing this project
- awesome-bazel - bazelbuild/gmaven_rules - Transitive WORKSPACE rules for Google's Maven repository (Tooling / Migration)
README
# gmaven_rules
This project provides support for easily depending on common Android libraries in Bazel.
It hosts `gmaven.bzl`, a file containing external repository
targets for all artifacts in [Google Maven Repository](https://maven.google.com) plus their
dependencies, and the supporting tools for generating it.This project is an interim solution until Google Maven and AAR support is added to
[bazel-deps](https://github.com/johnynek/bazel-deps). See also
[Bazel External Deps Roadmap](https://www.bazel.build/roadmaps/external-deps.html).# Usage instructions
Please see the
[releases](https://github.com/bazelbuild/gmaven_rules/releases/latest) page for
instructions on using the latest snapshot.To use this from your project, in your `WORKSPACE` file add
```
# Google Maven Repository
GMAVEN_TAG = "20180607-1" # or the tag from the latest releasehttp_archive(
name = "gmaven_rules",
strip_prefix = "gmaven_rules-%s" % GMAVEN_TAG,
url = "https://github.com/bazelbuild/gmaven_rules/archive/%s.tar.gz" % GMAVEN_TAG,
)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`](https://raw.githubusercontent.com/aj-michael/gmaven_rules/master/gmaven.bzl).# Updating gmaven.bzl
To update `gmaven.bzl`, run the following command. It will take about 3 minutes.
```
bazel run //:gmaven_to_bazel && cp bazel-bin/gmaven_to_bazel.runfiles/__main__/gmaven.bzl .
```# Known issues
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.