Skip to content

Commit

Permalink
use archive instead of submodule (#4263)
Browse files Browse the repository at this point in the history
* remove opentelemetry-proto submodule

* ensure opentelemetry-proto files are not checked in

* cleanup comment
  • Loading branch information
Alex Boten committed Oct 26, 2021
1 parent 2cf0fbd commit 28d64f7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ coverage.html
# Wix
*.wixobj
*.wixpdb

# OpenTelemetry proto files which are normally cleaned up
model/internal/opentelemetry-proto
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "model/internal/opentelemetry-proto"]
path = model/internal/opentelemetry-proto
url = https://github.com/open-telemetry/opentelemetry-proto
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ gendependabot: $(eval SHELL:=/bin/bash)
# The source directory for OTLP ProtoBufs.
OPENTELEMETRY_PROTO_SRC_DIR=model/internal/opentelemetry-proto

# The SHA matching the current version of the proto to use
OPENTELEMETRY_PROTO_VERSION=v0.11.0

# Find all .proto files.
OPENTELEMETRY_PROTO_FILES := $(subst $(OPENTELEMETRY_PROTO_SRC_DIR)/,,$(wildcard $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1/*.proto))

Expand All @@ -323,13 +326,18 @@ DOCKER_PROTOBUF ?= otel/build-protobuf:0.4.1
PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD}/$(PROTO_INTERMEDIATE_DIR) ${DOCKER_PROTOBUF} --proto_path=${PWD}
PROTO_INCLUDES := -I/usr/include/github.com/gogo/protobuf -I./

# Cleanup temporary directory
genproto-cleanup:
rm -Rf ${OPENTELEMETRY_PROTO_SRC_DIR}

# Generate OTLP Protobuf Go files. This will place generated files in PROTO_TARGET_GEN_DIR.
genproto:
git submodule update --init
# Call a sub-make to ensure OPENTELEMETRY_PROTO_FILES is populated after the submodule
# files are present.
genproto: genproto-cleanup
mkdir -p ${OPENTELEMETRY_PROTO_SRC_DIR}
curl -sSL https://api.github.com/repos/open-telemetry/opentelemetry-proto/tarball/${OPENTELEMETRY_PROTO_VERSION} | tar xz --strip 1 -C ${OPENTELEMETRY_PROTO_SRC_DIR}
# Call a sub-make to ensure OPENTELEMETRY_PROTO_FILES is populated
$(MAKE) genproto_sub
$(MAKE) fmt
$(MAKE) genproto-cleanup

genproto_sub:
@echo Generating code for the following files:
Expand Down
1 change: 0 additions & 1 deletion model/internal/opentelemetry-proto
Submodule opentelemetry-proto deleted from b43e9b

0 comments on commit 28d64f7

Please sign in to comment.