|
1 | 1 | GENERATED_DIR=$(shell pwd)/generated_python |
2 | | -FINAL_DIR=gcloud/bigtable/_generated |
| 2 | +FINAL_DIR=$(shell pwd)/gcloud/bigtable/_generated |
3 | 3 | GRPC_PLUGIN=grpc_python_plugin |
| 4 | +PROTOC_CMD=protoc |
4 | 5 |
|
5 | 6 | help: |
6 | 7 | @echo 'Makefile for gcloud-python Bigtable protos ' |
@@ -15,56 +16,99 @@ generate: |
15 | 16 | mkdir -p $(GENERATED_DIR) |
16 | 17 | # Data API |
17 | 18 | cd cloud-bigtable-client/bigtable-protos/src/main/proto && \ |
18 | | - protoc --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
19 | | - --plugin=protoc-gen-grpc=$(GRPC_PLUGIN) google/bigtable/v1/*.proto |
| 19 | + $(PROTOC_CMD) --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
| 20 | + --plugin=protoc-gen-grpc=$(GRPC_PLUGIN) google/bigtable/v1/*.proto && \ |
| 21 | + cp google/bigtable/v1/bigtable_data.proto \ |
| 22 | + $(FINAL_DIR)/_bigtable_data.proto && \ |
| 23 | + cp google/bigtable/v1/bigtable_service.proto \ |
| 24 | + $(FINAL_DIR)/_bigtable_service.proto && \ |
| 25 | + cp google/bigtable/v1/bigtable_service_messages.proto \ |
| 26 | + $(FINAL_DIR)/_bigtable_service_messages.proto && \ |
| 27 | + chmod -x $(FINAL_DIR)/_bigtable_data.proto && \ |
| 28 | + chmod -x $(FINAL_DIR)/_bigtable_service.proto && \ |
| 29 | + chmod -x $(FINAL_DIR)/_bigtable_service_messages.proto |
20 | 30 | mv $(GENERATED_DIR)/google/bigtable/v1/* $(FINAL_DIR) |
21 | 31 | # Cluster API |
22 | 32 | cd cloud-bigtable-client/bigtable-protos/src/main/proto && \ |
23 | | - protoc --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
| 33 | + $(PROTOC_CMD) --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
24 | 34 | --plugin=protoc-gen-grpc=$(GRPC_PLUGIN) \ |
25 | | - google/bigtable/admin/cluster/v1/*.proto |
| 35 | + google/bigtable/admin/cluster/v1/*.proto && \ |
| 36 | + cp google/bigtable/admin/cluster/v1/bigtable_cluster_data.proto \ |
| 37 | + $(FINAL_DIR)/_bigtable_cluster_data.proto && \ |
| 38 | + cp google/bigtable/admin/cluster/v1/bigtable_cluster_service.proto \ |
| 39 | + $(FINAL_DIR)/_bigtable_cluster_service.proto && \ |
| 40 | + cp google/bigtable/admin/cluster/v1/bigtable_cluster_service_messages.proto \ |
| 41 | + $(FINAL_DIR)/_bigtable_cluster_service_messages.proto && \ |
| 42 | + chmod -x $(FINAL_DIR)/_bigtable_cluster_data.proto && \ |
| 43 | + chmod -x $(FINAL_DIR)/_bigtable_cluster_service.proto && \ |
| 44 | + chmod -x $(FINAL_DIR)/_bigtable_cluster_service_messages.proto |
26 | 45 | mv $(GENERATED_DIR)/google/bigtable/admin/cluster/v1/* $(FINAL_DIR) |
27 | 46 | # Table API |
28 | 47 | cd cloud-bigtable-client/bigtable-protos/src/main/proto && \ |
29 | | - protoc --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
| 48 | + $(PROTOC_CMD) --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
30 | 49 | --plugin=protoc-gen-grpc=$(GRPC_PLUGIN) \ |
31 | | - google/bigtable/admin/table/v1/*.proto |
| 50 | + google/bigtable/admin/table/v1/*.proto && \ |
| 51 | + cp google/bigtable/admin/table/v1/bigtable_table_data.proto \ |
| 52 | + $(FINAL_DIR)/_bigtable_table_data.proto && \ |
| 53 | + cp google/bigtable/admin/table/v1/bigtable_table_service.proto \ |
| 54 | + $(FINAL_DIR)/_bigtable_table_service.proto && \ |
| 55 | + cp google/bigtable/admin/table/v1/bigtable_table_service_messages.proto \ |
| 56 | + $(FINAL_DIR)/_bigtable_table_service_messages.proto && \ |
| 57 | + chmod -x $(FINAL_DIR)/_bigtable_table_data.proto && \ |
| 58 | + chmod -x $(FINAL_DIR)/_bigtable_table_service.proto && \ |
| 59 | + chmod -x $(FINAL_DIR)/_bigtable_table_service_messages.proto |
32 | 60 | mv $(GENERATED_DIR)/google/bigtable/admin/table/v1/* $(FINAL_DIR) |
33 | 61 | # Auxiliary protos |
34 | 62 | cd cloud-bigtable-client/bigtable-protos/src/main/proto && \ |
35 | | - protoc --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
| 63 | + $(PROTOC_CMD) --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
36 | 64 | --plugin=protoc-gen-grpc=$(GRPC_PLUGIN) \ |
37 | | - google/api/*.proto |
| 65 | + google/api/*.proto && \ |
| 66 | + cp google/api/annotations.proto $(FINAL_DIR)/_annotations.proto && \ |
| 67 | + cp google/api/http.proto $(FINAL_DIR)/_http.proto && \ |
| 68 | + chmod -x $(FINAL_DIR)/_annotations.proto && \ |
| 69 | + chmod -x $(FINAL_DIR)/_http.proto |
38 | 70 | mv $(GENERATED_DIR)/google/api/* $(FINAL_DIR) |
39 | 71 | cd cloud-bigtable-client/bigtable-protos/src/main/proto && \ |
40 | | - protoc --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
| 72 | + $(PROTOC_CMD) --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
41 | 73 | --plugin=protoc-gen-grpc=$(GRPC_PLUGIN) \ |
42 | | - google/protobuf/any.proto |
| 74 | + google/protobuf/any.proto && \ |
| 75 | + cp google/protobuf/any.proto $(FINAL_DIR)/_any.proto && \ |
| 76 | + chmod -x $(FINAL_DIR)/_any.proto |
43 | 77 | mv $(GENERATED_DIR)/google/protobuf/any_pb2.py $(FINAL_DIR) |
44 | 78 | cd cloud-bigtable-client/bigtable-protos/src/main/proto && \ |
45 | | - protoc --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
| 79 | + $(PROTOC_CMD) --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
46 | 80 | --plugin=protoc-gen-grpc=$(GRPC_PLUGIN) \ |
47 | | - google/protobuf/duration.proto |
| 81 | + google/protobuf/duration.proto && \ |
| 82 | + cp google/protobuf/duration.proto $(FINAL_DIR)/_duration.proto && \ |
| 83 | + chmod -x $(FINAL_DIR)/_duration.proto |
48 | 84 | mv $(GENERATED_DIR)/google/protobuf/duration_pb2.py $(FINAL_DIR) |
49 | 85 | cd cloud-bigtable-client/bigtable-protos/src/main/proto && \ |
50 | | - protoc --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
| 86 | + $(PROTOC_CMD) --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
51 | 87 | --plugin=protoc-gen-grpc=$(GRPC_PLUGIN) \ |
52 | | - google/protobuf/empty.proto |
| 88 | + google/protobuf/empty.proto && \ |
| 89 | + cp google/protobuf/empty.proto $(FINAL_DIR)/_empty.proto && \ |
| 90 | + chmod -x $(FINAL_DIR)/_empty.proto |
53 | 91 | mv $(GENERATED_DIR)/google/protobuf/empty_pb2.py $(FINAL_DIR) |
54 | 92 | cd cloud-bigtable-client/bigtable-protos/src/main/proto && \ |
55 | | - protoc --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
| 93 | + $(PROTOC_CMD) --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
56 | 94 | --plugin=protoc-gen-grpc=$(GRPC_PLUGIN) \ |
57 | | - google/protobuf/timestamp.proto |
| 95 | + google/protobuf/timestamp.proto && \ |
| 96 | + cp google/protobuf/timestamp.proto $(FINAL_DIR)/_timestamp.proto && \ |
| 97 | + chmod -x $(FINAL_DIR)/_timestamp.proto |
58 | 98 | mv $(GENERATED_DIR)/google/protobuf/timestamp_pb2.py $(FINAL_DIR) |
59 | 99 | cd cloud-bigtable-client/bigtable-protos/src/main/proto && \ |
60 | | - protoc --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
| 100 | + $(PROTOC_CMD) --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
61 | 101 | --plugin=protoc-gen-grpc=$(GRPC_PLUGIN) \ |
62 | | - google/longrunning/operations.proto |
| 102 | + google/longrunning/operations.proto && \ |
| 103 | + cp google/longrunning/operations.proto $(FINAL_DIR)/_operations.proto && \ |
| 104 | + chmod -x $(FINAL_DIR)/_operations.proto |
63 | 105 | mv $(GENERATED_DIR)/google/longrunning/operations_pb2.py $(FINAL_DIR) |
64 | 106 | cd cloud-bigtable-client/bigtable-protos/src/main/proto && \ |
65 | | - protoc --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
| 107 | + $(PROTOC_CMD) --python_out=$(GENERATED_DIR) --grpc_out=$(GENERATED_DIR) \ |
66 | 108 | --plugin=protoc-gen-grpc=$(GRPC_PLUGIN) \ |
67 | | - google/rpc/status.proto |
| 109 | + google/rpc/status.proto && \ |
| 110 | + cp google/rpc/status.proto $(FINAL_DIR)/_status.proto && \ |
| 111 | + chmod -x $(FINAL_DIR)/_status.proto |
68 | 112 | mv $(GENERATED_DIR)/google/rpc/status_pb2.py $(FINAL_DIR) |
69 | 113 | python scripts/rewrite_imports.py |
70 | 114 |
|
|