Skip to content
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

fix: enable codegen with new annotation #373

Merged
merged 1 commit into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ object DescriptorSet {
Using[FileInputStream, Either[CannotOpen, Iterable[Either[ReadFailure, Descriptors.FileDescriptor]]]](
new FileInputStream(file)) { fis =>
val registry = ExtensionRegistry.newInstance()
registry.add(kalix.Annotations.codegen)
Copy link
Member Author

Choose a reason for hiding this comment

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

Was just missing this registration. Model building already added.

registry.add(kalix.Annotations.service)
registry.add(kalix.Annotations.file)
registry.add(kalix.Annotations.method)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ object Cli {
val protobufDescriptor =
config.descriptorSetOutputDirectory.resolve(config.descriptorSetFileName).toFile
if (protobufDescriptor.exists) {
println("Inspecting proto file descriptor for entity generation...")
println("Inspecting proto file descriptor for Kalix code generation...")
val _ = DescriptorSet.fileDescriptors(protobufDescriptor) match {
case Right(fileDescriptors) =>
val model =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ object SourceGenerator extends PrettyPrinter {
"import" <+> generatedComponentArray <+> "from" <+> dquotes(generatedComponentIndex) <> semi
<> line <> line <>
"const" <+> "server" <+> equal <+> "new" <+> "Kalix" <> parens(emptyDoc) <> semi <> line <> line <>
"// This generatedComponentArray array contains all generated Actions, Views or Entities," <> line <>
"// This generatedComponents array contains all generated Actions, Views or Entities," <> line <>
"// and is kept up-to-date with any changes in your protobuf definitions." <> line <>
"// If you prefer, you may remove this line and manually register these components." <> line <>
generatedComponentArray <> dot <> "forEach" <> parens(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class SourceGeneratorSuite extends munit.FunSuite {
|
|const server = new Kalix();
|
|// This generatedComponentArray array contains all generated Actions, Views or Entities,
|// This generatedComponents array contains all generated Actions, Views or Entities,
|// and is kept up-to-date with any changes in your protobuf definitions.
|// If you prefer, you may remove this line and manually register these components.
|generatedComponents.forEach((component) => {
Expand Down Expand Up @@ -262,7 +262,7 @@ class SourceGeneratorSuite extends munit.FunSuite {
|
|const server = new Kalix();
|
|// This generatedComponentArray array contains all generated Actions, Views or Entities,
|// This generatedComponents array contains all generated Actions, Views or Entities,
|// and is kept up-to-date with any changes in your protobuf definitions.
|// If you prefer, you may remove this line and manually register these components.
|generatedComponents.forEach((component) => {
Expand Down