-
Notifications
You must be signed in to change notification settings - Fork 3
Add generic protoc plugin support #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
evg-tso
wants to merge
4
commits into
master
Choose a base branch
from
generic-plugin-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or 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
- 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
- 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
amitlus
reviewed
Dec 10, 2025
test/leiningen/protodeps_test.clj
Outdated
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))))) |
There was a problem hiding this comment.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added
:pluginsconfiguration optionlang=javafor protoc-gen-validate):additional-flagsconfiguration option for plugins requiring extra protoc flags (e.g.,protoc-gen-doc's--doc_opt)Changed
protoc-optsfunction now accepts a vector of plugins~/.lein-protodeps/plugins-installations/<plugin-name>/<version>/for all plugins including gRPCosx/darwin,aarch_64/arm64) until one succeedsRemoved
get-grpc-plugin!anddownload-grpc-plugin!functionsFixed
.tar.gz,.gz, and plain executable formats