Skip to content

feat: sbt plugin 'unmanaged' codegen#401

Merged
raboof merged 2 commits intolightbend:mainfrom
raboof:scala-sbt-unmanaged-codegen
Sep 16, 2021
Merged

feat: sbt plugin 'unmanaged' codegen#401
raboof merged 2 commits intolightbend:mainfrom
raboof:scala-sbt-unmanaged-codegen

Conversation

@raboof
Copy link
Copy Markdown
Contributor

@raboof raboof commented Sep 15, 2021

Not entirely happy with the approach: generating the code from the regular protoc generators, but then 'filtering them out' of the managed sources (that they get added to automatically) afterwards, and copying them over 'manually'. It does save us from duplicating part of the sbt-protoc implementation (in particular finding the correct .proto files and converting them into com.google.protobuf.Descriptors.FileDescriptor instances). Let's try it out, but if it leads to trouble we should definitely consider avoiding the generators and doing that step 'ourselves'.

@raboof raboof changed the title 'unmanaged' codegen feat: sbt plugin 'unmanaged' codegen Sep 15, 2021
Not entirely happy with the approach: generating the code from the regular
protoc generators, but then 'filtering them out' of the managed sources
(that they get added to automatically) afterwards, and copying them over
'manually'.

It does save us from duplicating part of the sbt-protoc implementation
(in particular finding the correct `.proto` files and converting them
into `com.google.protobuf.Descriptors.FileDescriptor` instances).

Let's try it out, but if it leads to trouble we should definitely consider
avoiding the generators and doing that step 'ourselves'.
@raboof raboof force-pushed the scala-sbt-unmanaged-codegen branch from fcd64e5 to 7e3b3fa Compare September 15, 2021 15:45
@raboof raboof marked this pull request as ready for review September 15, 2021 15:45
Copy link
Copy Markdown
Member

@pvlugter pvlugter left a comment

Choose a reason for hiding this comment

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

The filter on the managed sources does seem a little awkward, but sounds good to start with this approach and see how it goes. And the separate task is good for disabling with Compile / generateUnmanaged := ().

@raboof raboof merged commit 085be55 into lightbend:main Sep 16, 2021
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.

2 participants