Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
README: Add instructions on using opencensus_proto with Bazel. (#140)
Browse files Browse the repository at this point in the history
* README: Add instructions on using opencensus_proto with Bazel.

* Add git_repository instruction.
  • Loading branch information
songy23 authored Oct 15, 2018
1 parent 7c72602 commit bbcfad0
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,37 @@ compile 'io.opencensus:opencensus-proto:0.0.2'
[travis-url]: https://travis-ci.org/census-instrumentation/opencensus-proto
[maven-image]: https://maven-badges.herokuapp.com/maven-central/io.opencensus/opencensus-proto/badge.svg
[maven-url]: https://maven-badges.herokuapp.com/maven-central/io.opencensus/opencensus-proto

### Add the dependencies to Bazel project

In WORKSPACE, add:
```
git_repository(
name = "io_opencensus_proto",
strip_prefix = "src",
tag = "v0.0.2", # CURRENT_OPENCENSUS_PROTO_VERSION
remote = "https://github.com/census-instrumentation/opencensus-proto",
)
```
or

```
http_archive(
name = "io_opencensus_proto",
strip_prefix = "opencensus-proto-master/src",
urls = ["https://github.com/census-instrumentation/opencensus-proto/archive/master.zip"],
)
```

In BUILD.bazel:
```bazel
proto_library(
name = "foo_proto",
srcs = ["foo.proto"],
deps = [
"@io_opencensus_proto//opencensus/proto/metrics/v1:metrics_proto",
"@io_opencensus_proto//opencensus/proto/trace/v1:trace_proto",
# etc.
],
)
```

0 comments on commit bbcfad0

Please sign in to comment.