-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix v5 in remote import path for .proto files
- Loading branch information
1 parent
008503f
commit 687f86d
Showing
6 changed files
with
449 additions
and
438 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
# Rakefile for agent-payload | ||
|
||
root_dir = File.dirname(__FILE__) | ||
|
||
# where the proto code is first generated as we declare packages with v5 | ||
v5_dir=File.join(root_dir, "v5") | ||
|
||
# where all toolchains (protobuf compilers, protobuf plugins,etc) are stored | ||
toolchain_dir=File.join(File.dirname(__FILE__), "toolchains") | ||
toolchain_dir=File.join(root_dir, "toolchains") | ||
|
||
# binaries | ||
toolchain_bin_dir=File.join(toolchain_dir, "bin") | ||
|
@@ -93,6 +98,10 @@ BASH | |
export GO111MODULE=auto | ||
# These .proto can be imported by other repositories (not only generated code). To have a consistent import path, we use the GOPATH and we add a /v5/ folder as declared packaged in `go.mod` is ../v5 | ||
mkdir -p #{v5_dir} | ||
ln -sf #{root_dir}/proto #{v5_dir}/proto | ||
echo "Generating logs proto" | ||
PATH=#{toolchain_bin_dir} #{protoc_binary} --proto_path=$GOPATH/src:#{gogo_dir}/src:. --gogofast_out=$GOPATH/src proto/logs/agent_logs_payload.proto | ||
|
@@ -111,13 +120,11 @@ BASH | |
GOPATH=#{toolchain_dir} go install google.golang.org/protobuf/cmd/[email protected] | ||
GOPATH=#{toolchain_dir} go install github.com/chrusty/protoc-gen-jsonschema/cmd/protoc-gen-jsonschema@#{protoc_jsonschema_version} | ||
echo "Generating contlcycle proto" | ||
PATH=#{toolchain_bin_dir} #{protoc_binary} --proto_path=#{toolchain_include_dir}:. --go_out=$GOPATH/src proto/contlcycle/contlcycle.proto | ||
echo "Generating kubernetes autoscaling proto" | ||
# These .proto can be imported by other repositories (not only generated code). To have a consistent import path, we use the GOPATH. | ||
PATH=#{toolchain_bin_dir} #{protoc_binary} --proto_path=#{toolchain_include_dir}:proto/deps:$GOPATH/src --go_out=$GOPATH/src --jsonschema_out=type_names_with_no_package:jsonschema $GOPATH/src/github.com/DataDog/agent-payload/proto/autoscaling/kubernetes/*.proto | ||
PATH=#{toolchain_bin_dir} #{protoc_binary} --proto_path=#{toolchain_include_dir}:proto/deps:$GOPATH/src --go_out=$GOPATH/src --jsonschema_out=type_names_with_no_package:jsonschema $GOPATH/src/github.com/DataDog/agent-payload/v5/proto/autoscaling/kubernetes/*.proto | ||
echo "Generating contimage proto" | ||
PATH=#{toolchain_bin_dir} #{protoc_binary} --proto_path=#{toolchain_include_dir}:. --go_out=$GOPATH/src proto/contimage/contimage.proto | ||
|
@@ -142,6 +149,7 @@ BASH | |
--go-vtproto_opt=pool=github.com/DataDog/agent-payload/v5/cws/dumpsv1.ProcessInfo \ | ||
proto/cws/dumpsv1/activity_dump.proto | ||
rm -f #{v5_dir}/proto | ||
cp -r v5/* . | ||
rm -rf v5 | ||
BASH | ||
|
Oops, something went wrong.