Comments (5)
Should not be too hard to add.
from rules_protobuf.
Implemented in 84f5b46, on master. Can you confirm and close issue?
from rules_protobuf.
@pcj Thanks so much for taking this on, it's looking really good! Quick question and I think this might be a misunderstanding on my part.
When I run blaze build //examples/helloworld/grpc_gateway:swagger
(your newly created target I get the following output:
INFO: Found 1 target...
Target //examples/helloworld/grpc_gateway:swagger up-to-date:
bazel-bin/examples/helloworld/grpc_gateway/helloworld.swagger.json
INFO: Elapsed time: 0.166s, Critical Path: 0.00s
This output makes me think that there should be a target //examples/helloworld/grpc_gateway:helloworld.swagger.json
that I can depend on in another rule. A genrule for example. However when I build //examples/helloworld/grpc_gateway:helloworld.swagger.json
I get the classic error message:
ERROR: no such target '//examples/helloworld/grpc_gateway:helloworld.swagger.json': target 'helloworld.swagger.json' not declared in package 'examples/helloworld/grpc_gateway' defined by /Users/achew22/Projects/rules_protobuf/examples/helloworld/grpc_gateway/BUILD.
Am I doing something weird here? It seems like that file target should exist
from rules_protobuf.
You should be able to depend on the :swagger
target directly in your genrule. This is true of all members of the *_proto_compile family, of which grpc_gateway_swagger_compile
belongs.
All *_proto_library
rules are actually a composition of a proto_compile rule + a library rule. So a go_proto_library
rule named foo
first emits a proto_compile of the form foo.pb
and then depends on the output of that for a go_library
rule. So if you want the compiled foo.a
output, depend on :foo
. If you want the generated files, depend on the implicit target foo.pb
, which yields the *.pb.go
files. In the case of swagger.json, there is no implicit .pb target since you are interacting with the proto_compile rule directly.
Hopefully that was not too longwinded. Curious what your genrule does... What are you feeding it into?
from rules_protobuf.
In the case of a swagger output there isn't a library to be consumed so that seems reasonable. My genrule, as I suspect you know, generates a swagger client library using this as the input. It seems to be working. Thanks so much for doing this. I'll look into open sourcing it. Unfortunately my ambitions are incompatible with my time constraints 😉.
Thank you so much for implementing this, it is hugely appreciated.
from rules_protobuf.
Related Issues (20)
- Can't build GRPC when using cpp_proto_repositories HOT 5
- py_proto_library fails when taking input from a genrule HOT 1
- Not work with rules_go v0.13.0 HOT 3
- Dart support? HOT 4
- Go rules HOT 1
- Can't resolve @go_googleapis//google/api HOT 1
- Custom protoc generators HOT 1
- using imports in py_proto_compile fails: _pb2.py and pb2_grpc.py not created HOT 1
- gogo_proto_library with the "well known types" (google/protobuf) HOT 12
- Non repeatable build for grpc_cli HOT 1
- Update rules_protobuf to rules_go 0.16.0 HOT 7
- Addition of protoc-gen-grpc-web HOT 2
- 32-bit C++ compilation HOT 3
- including well known protos in ruby_proto_compile HOT 4
- support latest grpc version HOT 1
- Bazel deprecated native http_archive rule HOT 2
- Unable to load package for 'org_pubref_rules_protobuf/java/rules.bzl' HOT 1
- name 'FileType' is not defined HOT 2
- BUG: Error in label: label() got unexpected keyword argument 'single_file' HOT 2
- file '//protobuf:rules.bzl' does not contain symbol 'proto_compile'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_protobuf.