Skip to content

Conversation

@evg-tso
Copy link
Member

@evg-tso evg-tso commented Dec 9, 2025

Added

  • Generic protoc plugin support via :plugins configuration option
  • Auto-download plugins from configurable URL templates
  • Plugin-specific options support (e.g., lang=java for protoc-gen-validate)
  • Multiple plugins can run simultaneously
  • Test coverage for plugin functionality
  • Plugin :additional-flags configuration option for plugins requiring extra protoc flags (e.g., protoc-gen-doc's --doc_opt)

Changed

  • protoc-opts function now accepts a vector of plugins
  • Legacy gRPC configuration converted to plugin format internally
  • Unified plugin installation directory to ~/.lein-protodeps/plugins-installations/<plugin-name>/<version>/ for all plugins including gRPC
  • Plugin downloads try multiple platform naming conventions automatically (osx/darwin, aarch_64/arm64) until one succeeds

Removed

  • Removed get-grpc-plugin! and download-grpc-plugin! functions

Fixed

  • Plugin binaries always have execute permissions set, even when previously downloaded
  • Plugin downloads handle .tar.gz, .gz, and plain executable formats
  • Plugin downloads try all platform name variants before failing

- Add :plugins configuration option for generic protoc plugins
- Auto-download plugins from configurable URL templates with platform detection
- Support plugin-specific options (e.g., lang=java for protoc-gen-validate)
- Add :additional-flags for plugins requiring extra protoc flags (e.g., protoc-gen-doc)
- Unified plugin installation directory for all plugins including gRPC
- Plugin downloads try multiple platform naming conventions automatically
- Handle .tar.gz, .gz, and plain executable formats
- Backward compatible with existing :compile-grpc? and :grpc-version config
- Add comprehensive test coverage for plugin functionality
@evg-tso evg-tso changed the title Add generic protoc plugin support (v1.1.0) Add generic protoc plugin support Dec 9, 2025
- Add test proto file with validation rules (user.proto)
- Test that Validator files are NOT generated without the plugin
- Test that Validator files ARE generated with the plugin
- Use git dependency for validate.proto from protoc-gen-validate repo
Maven Central uses hyphens for all separators in gRPC binaries:
- Wrong: protoc-gen-grpc-java-1.68.1-linux_x86_64.exe
- Correct: protoc-gen-grpc-java-1.68.1-linux-x86_64.exe

This fixes GitLab CI failures on Linux x86_64
@evg-tso evg-tso changed the title Add generic protoc plugin support Draft: Add generic protoc plugin support Dec 9, 2025
@evg-tso evg-tso marked this pull request as draft December 9, 2025 13:44
@evg-tso evg-tso changed the title Draft: Add generic protoc plugin support Add generic protoc plugin support Dec 9, 2025
Comment on lines 120 to 126
(deftest plugin-options-formatting-test
(testing "Format plugin options as key=value pairs"
(is (= "lang=java" (@#'sut/format-plugin-options {:lang "java"})))
(is (= "lang=java,paths=source_relative"
(@#'sut/format-plugin-options {:lang "java" :paths "source_relative"})))
(is (nil? (@#'sut/format-plugin-options {})))
(is (nil? (@#'sut/format-plugin-options nil)))))
Copy link

Choose a reason for hiding this comment

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

A suggestion - you can use are style in this test:

Suggested change
(deftest plugin-options-formatting-test
(testing "Format plugin options as key=value pairs"
(is (= "lang=java" (@#'sut/format-plugin-options {:lang "java"})))
(is (= "lang=java,paths=source_relative"
(@#'sut/format-plugin-options {:lang "java" :paths "source_relative"})))
(is (nil? (@#'sut/format-plugin-options {})))
(is (nil? (@#'sut/format-plugin-options nil)))))
(deftest plugin-options-formatting-test
(testing "Format plugin options as key=value pairs"
(are [input expected] (= expected (@#'sut/format-plugin-options input))
{:lang "java"} "lang=java"
{:lang "java" :paths "source_relative"} "lang=java,paths=source_relative"
{} nil
nil nil)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants