-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_bindings.sh
executable file
·63 lines (47 loc) · 1.93 KB
/
create_bindings.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
set -Eeuo pipefail
msg() {
echo >&2 -e "${1-}"
}
# make sure protoc is installed
if ! command -v protoc &>/dev/null; then
msg "protoc could not be found - install it via brew install protobuf"
exit
fi
msg "Testing protobuf definition…"
protoc --encode com.passulo.v1.Token com/passulo/token.proto <test/payload.txt >test/proto.bin
protoc --decode_raw <test/proto.bin &>/dev/null
protoc --decode com.passulo.v1.Token com/passulo/token.proto <test/proto.bin &>/dev/null
msg "✅"
msg "Creating Bindings for Obj-C"
protoc com/passulo/token.proto --objc_out=bindings/objc
msg "Creating Bindings for Java"
protoc com/passulo/token.proto --java_out=bindings/java
msg "Creating Bindings for C++"
protoc com/passulo/token.proto --cpp_out=bindings/cpp
msg "Creating Bindings for C#"
protoc com/passulo/token.proto --csharp_out=bindings/csharp
msg "Creating Bindings for Kotlin"
protoc com/passulo/token.proto --kotlin_out=bindings/kotlin
msg "Creating Bindings for JavaScript"
protoc com/passulo/token.proto --js_out=bindings/javascript
msg "Creating Bindings for Python"
protoc com/passulo/token.proto --python_out=bindings/python
msg "Creating Bindings for PHP"
protoc com/passulo/token.proto --php_out=bindings/php
msg "Creating Bindings for Ruby"
protoc com/passulo/token.proto --ruby_out=bindings/ruby
if command -v protoc-gen-go --version &>/dev/null; then
msg "Creating Bindings for Go"
protoc com/passulo/token.proto --go_out=bindings/go
else
msg "⚠️ protoc-gen-go could not be found - install it via brew install protoc-gen-go"
fi
if command -v protoc-gen-swift --version &>/dev/null; then
msg "Creating Bindings for Swift"
protoc com/passulo/token.proto --swift_out=bindings/swift
else
msg "⚠️ protoc-gen-swift could not be found - install it via brew install protoc-gen-swift"
fi
msg "Creating Bindings for Scala"
protoc com/passulo/token.proto --plugin=bindings/scala/protoc-gen-scala --scala_out=bindings/scala