Skip to content
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions Protobuf.Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
LOCAL_DIR := $(ROOT_DIR)/.local
LOCALBIN := $(LOCAL_DIR)/bin
LOCAL_BIN_DIR := $(LOCAL_DIR)/bin

## Versions
PROTOC_VERSION=26.1
# Versions
PROTOC_VERSION := 26.1

# protoc binary installation
PROTOC_ZIP = protoc-$(PROTOC_VERSION)-osx-universal_binary.zip
PROTOC = $(LOCALBIN)/protoc@$(PROTOC_VERSION)/protoc
# Protoc binary installation
PROTOC_ZIP := protoc-$(PROTOC_VERSION)-osx-universal_binary.zip
PROTOC := $(LOCAL_BIN_DIR)/protoc@$(PROTOC_VERSION)/protoc
$(PROTOC):
@echo Downloading protocol buffers...
@mkdir -p $(LOCAL_DIR)
Expand All @@ -16,14 +16,13 @@ $(PROTOC):
@unzip -o $(PROTOC_ZIP) 'include/*' -d $(dir $@)
@rm -f $(PROTOC_ZIP)

protoc_gen_grpc_swift:
swift build --product protoc-gen-grpc-swift

.PHONY: protoc-gen-swift
protoc-gen-swift:
swift build --product protoc-gen-swift
@$(SWIFT) build --product protoc-gen-swift
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SWIFT has to be defined in the environment or the build fails?

I don't see any default definition.

Copy link
Contributor Author

@dkovba dkovba Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protobuf.Makefile is imported by Makefile, where the variables are defined. Other such variables outside changes in this PR - ROOT_DIR and BUILD_BIN_DIR.

@$(SWIFT) build --product protoc-gen-grpc-swift

.PHONY: protos
protos: $(PROTOC) protoc_gen_grpc_swift protoc-gen-swift
protos: $(PROTOC) protoc-gen-swift
@echo Generating protocol buffers source code...
@$(PROTOC) Sources/Containerization/SandboxContext/SandboxContext.proto \
--plugin=protoc-gen-grpc-swift=$(BUILD_BIN_DIR)/protoc-gen-grpc-swift \
Expand All @@ -35,3 +34,7 @@ protos: $(PROTOC) protoc_gen_grpc_swift protoc-gen-swift
--swift_opt=Visibility=Public \
-I.
@"$(MAKE)" update-licenses

.PHONY: clean-protos
clean-protos:
@rm -rf $(LOCAL_DIR)