Skip to content

Conversation

@stefanadranca
Copy link
Collaborator

Motivation:

Provides an API which takes Structured Swift Representation of a file and generates an object containing the generated code as a String.

Modifications:

  • Brought over RendererProtocol and TextBasedRenderer.
  • Brought over unit tests in Test_TextBasedRenderer.
  • Fixed TypeName bugs that produced errors while building.

Result:

The CodeGenLib will have a code renderer that transforms StructuredSwiftRepresentation into SourceFile.

Motivation:

Provides an API which takes Structured Swift Representation of a file and generates an object containing the generated code as a String.

Modifications:

- Brought over RendererProtocol and TextBasedRenderer.
- Brought over unit tests in Test_TextBasedRenderer.
- Fixed TypeName bugs that produced errors while building.

Result:

The CodeGenLib will have a code renderer that transforms `StructuredSwiftRepresentation` into `SourceFile`.
@stefanadranca stefanadranca marked this pull request as ready for review November 29, 2023 13:30
@@ -0,0 +1,781 @@
/*
Copy link
Collaborator

Choose a reason for hiding this comment

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

GRPCTests are tests for v1. Since GPRCCodeGen is a new target for v2, it should have its own corresponding test target GRPCCodeGenTests.

@glbrntt glbrntt added the version/v2 Relates to v2 label Nov 29, 2023
Package.swift Outdated
.nioTransportServices,
.logging,
.reflectionService,
.grpcCodeGen
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be removed

Package.swift Outdated
.protocGenGRPCSwift,
.grpcSwiftPlugin,
.reflectionService,
.grpcCodeGen,
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: move this down to the // v2 section below .grpcCore.

@@ -0,0 +1,781 @@
/*
Copy link
Collaborator

Choose a reason for hiding this comment

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

re: filename, I know you copy-pasted from OpenAPI, but naming is generally <Foo>Tests.swift, this should be TextBasedRendererTests.swift. We're also trying to keep the hierarchy of library and test code the same so it should be GRPCCodeGenTests/Internal/Renderer/TextBasedRendererTests.swift.

@glbrntt glbrntt merged commit 74794ce into grpc:main Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version/v2 Relates to v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants