google / google/protobuf-gradle-plugin

integration with protoc-gen-go

Open
#257 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
Groovy
Stars
1.8k
Forks
288
PR merge metrics
No merged PRs in 30d

Description

I have a src folders with multiple proto packages. It is all nice and working with C# and Java generation, but to generate Go sources, I need to be able to run protoc separately per each folder (package) without including any *.proto files from subfolders, since protoc-gen-go only allows to build 1 package at the time (please see https://github.com/golang/protobuf/issues/39, but it does not look too promising)

As a short example, I have something similar to the following tree structure
```
server/common.proto (package server)
server/service1/service1.proto (package server.service1)
server/service1/service1_utils.proto (package server.service1)
server/service2/service2.proto (package server.service2)
server/service2/service2_utils.proto (package server.service2)
```

Is it possible to do it through this plugin and some magic (with sourceSets?) or I am out of luck?

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the sourceSets configuration and the protoc-gen-go limitation described in the issue and linked protobuf discussion. Use the example server/service1 and server/service2 tree to determine whether each package can be generated separately without including proto files from subfolders; done means the required configuration or limitation is clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.