Skip to content

Commit

Permalink
Ditching auxiliary protos for googleapis-common-protos.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Jan 7, 2016
1 parent 5fe0325 commit 3c5b059
Show file tree
Hide file tree
Showing 37 changed files with 432 additions and 1,992 deletions.
29 changes: 6 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ generate:
--grpc_out=$(GENERATED_DIR) \
$(PROTOS_DIR)/google/bigtable/v1/bigtable_service.proto \
$(PROTOS_DIR)/google/bigtable/admin/cluster/v1/bigtable_cluster_service.proto \
$(PROTOS_DIR)/google/bigtable/admin/table/v1/bigtable_table_service.proto \
$(PROTOS_DIR)/google/longrunning/operations.proto
$(PROTOS_DIR)/google/bigtable/admin/table/v1/bigtable_table_service.proto
# Generate all *_pb2.py files that do not require gRPC.
$(PROTOC_CMD) \
--proto_path=$(PROTOS_DIR) \
Expand All @@ -34,44 +33,28 @@ generate:
$(PROTOS_DIR)/google/bigtable/admin/cluster/v1/bigtable_cluster_data.proto \
$(PROTOS_DIR)/google/bigtable/admin/cluster/v1/bigtable_cluster_service_messages.proto \
$(PROTOS_DIR)/google/bigtable/admin/table/v1/bigtable_table_data.proto \
$(PROTOS_DIR)/google/bigtable/admin/table/v1/bigtable_table_service_messages.proto \
$(PROTOS_DIR)/google/api/*.proto \
$(PROTOS_DIR)/google/protobuf/any.proto \
$(PROTOS_DIR)/google/protobuf/duration.proto \
$(PROTOS_DIR)/google/protobuf/empty.proto \
$(PROTOS_DIR)/google/protobuf/timestamp.proto \
$(PROTOS_DIR)/google/rpc/status.proto
$(PROTOS_DIR)/google/bigtable/admin/table/v1/bigtable_table_service_messages.proto
# Move the newly generated *_pb2.py files into our library.
mv $(GENERATED_DIR)/google/bigtable/v1/* $(FINAL_DIR)
mv $(GENERATED_DIR)/google/bigtable/admin/cluster/v1/* $(FINAL_DIR)
mv $(GENERATED_DIR)/google/bigtable/admin/table/v1/* $(FINAL_DIR)
mv $(GENERATED_DIR)/google/api/* $(FINAL_DIR)
mv $(GENERATED_DIR)/google/protobuf/any_pb2.py $(FINAL_DIR)
mv $(GENERATED_DIR)/google/protobuf/duration_pb2.py $(FINAL_DIR)
mv $(GENERATED_DIR)/google/protobuf/empty_pb2.py $(FINAL_DIR)
mv $(GENERATED_DIR)/google/protobuf/timestamp_pb2.py $(FINAL_DIR)
mv $(GENERATED_DIR)/google/longrunning/operations_pb2.py $(FINAL_DIR)
mv $(GENERATED_DIR)/google/rpc/status_pb2.py $(FINAL_DIR)
# Remove all existing *.proto files before we replace
rm -f $(FINAL_DIR)/*.proto
# Copy over the *.proto files into our library.
cp $(PROTOS_DIR)/google/bigtable/v1/*.proto $(FINAL_DIR)
cp $(PROTOS_DIR)/google/bigtable/admin/cluster/v1/*.proto $(FINAL_DIR)
cp $(PROTOS_DIR)/google/bigtable/admin/table/v1/*.proto $(FINAL_DIR)
cp $(PROTOS_DIR)/google/api/*.proto $(FINAL_DIR)
cp $(PROTOS_DIR)/google/protobuf/any.proto $(FINAL_DIR)
cp $(PROTOS_DIR)/google/protobuf/duration.proto $(FINAL_DIR)
cp $(PROTOS_DIR)/google/protobuf/empty.proto $(FINAL_DIR)
cp $(PROTOS_DIR)/google/protobuf/timestamp.proto $(FINAL_DIR)
cp $(PROTOS_DIR)/google/longrunning/operations.proto $(FINAL_DIR)
cp $(PROTOS_DIR)/google/rpc/status.proto $(FINAL_DIR)
# Rename all *.proto files in our library with an
# underscore and remove executable bit.
cd $(FINAL_DIR) && \
for filename in *.proto; do \
chmod -x $$filename ; \
mv $$filename _$$filename ; \
done
# Separate the gRPC parts of the operations service from the
# non-gRPC parts so that the protos from `googleapis-common-protos`
# can be used without gRPC.
python scripts/make_operations_grpc.py
# Rewrite the imports in the generated *_pb2.py files.
python scripts/rewrite_imports.py

Expand Down
29 changes: 0 additions & 29 deletions gcloud_bigtable/_generated/_annotations.proto

This file was deleted.

87 changes: 0 additions & 87 deletions gcloud_bigtable/_generated/_any.proto

This file was deleted.

78 changes: 0 additions & 78 deletions gcloud_bigtable/_generated/_duration.proto

This file was deleted.

34 changes: 0 additions & 34 deletions gcloud_bigtable/_generated/_empty.proto

This file was deleted.

0 comments on commit 3c5b059

Please sign in to comment.