-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
1,026 additions
and
420 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
9 changes: 0 additions & 9 deletions
9
codegen/src/main/scala/akka/grpc/gen/javadsl/JavaBothCodeGenerator.scala
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
23 changes: 23 additions & 0 deletions
23
codegen/src/main/scala/akka/grpc/gen/javadsl/JavaInterfaceCodeGenerator.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (C) 2018-2019 Lightbend Inc. <https://www.lightbend.com> | ||
*/ | ||
|
||
package akka.grpc.gen.javadsl | ||
|
||
import akka.grpc.gen.Logger | ||
import com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse | ||
import templates.JavaCommon.txt.ApiInterface | ||
|
||
object JavaInterfaceCodeGenerator extends JavaCodeGenerator { | ||
override def name = "akka-grpc-javadsl-interface" | ||
|
||
override def perServiceContent: Set[(Logger, Service) ⇒ CodeGeneratorResponse.File] = super.perServiceContent + generateServiceFile | ||
|
||
val generateServiceFile: (Logger, Service) ⇒ CodeGeneratorResponse.File = (logger, service) ⇒ { | ||
val b = CodeGeneratorResponse.File.newBuilder() | ||
b.setContent(ApiInterface(service).body) | ||
b.setName(s"${service.packageDir}/${service.name}.java") | ||
logger.info(s"Generating Akka gRPC service interface for [${service.packageName}.${service.name}]") | ||
b.build | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
codegen/src/main/scala/akka/grpc/gen/javadsl/JavaPowerApiInterfaceCodeGenerator.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (C) 2018-2019 Lightbend Inc. <https://www.lightbend.com> | ||
*/ | ||
|
||
package akka.grpc.gen.javadsl | ||
|
||
import akka.grpc.gen.Logger | ||
import com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse | ||
import templates.JavaServer.txt.PowerApiInterface | ||
|
||
object JavaPowerApiInterfaceCodeGenerator extends JavaCodeGenerator { | ||
override def name = "akka-grpc-javadsl-power-api-interface" | ||
|
||
override def perServiceContent: Set[(Logger, Service) ⇒ CodeGeneratorResponse.File] = super.perServiceContent + generatePowerService | ||
|
||
val generatePowerService: (Logger, Service) => CodeGeneratorResponse.File = (logger, service) => { | ||
val b = CodeGeneratorResponse.File.newBuilder() | ||
b.setContent(PowerApiInterface(service).body) | ||
b.setName(s"${service.packageDir}/${service.name}PowerApi.java") | ||
logger.info(s"Generating Akka gRPC service power interface for [${service.packageName}.${service.name}]") | ||
b.build | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
9 changes: 0 additions & 9 deletions
9
codegen/src/main/scala/akka/grpc/gen/scaladsl/ScalaBothCodeGenerator.scala
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
23 changes: 23 additions & 0 deletions
23
codegen/src/main/scala/akka/grpc/gen/scaladsl/ScalaPowerApiTraitCodeGenerator.scala
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com> | ||
*/ | ||
|
||
package akka.grpc.gen.scaladsl | ||
|
||
import akka.grpc.gen.Logger | ||
import com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse | ||
import templates.ScalaServer.txt.PowerApiTrait | ||
|
||
object ScalaPowerApiTraitCodeGenerator extends ScalaCodeGenerator { | ||
override def name = "akka-grpc-scaladsl-power-api-trait" | ||
|
||
override def perServiceContent = super.perServiceContent + generatePowerApiTrait | ||
|
||
val generatePowerApiTrait: (Logger, Service) => CodeGeneratorResponse.File = (logger, service) => { | ||
val b = CodeGeneratorResponse.File.newBuilder() | ||
b.setContent(PowerApiTrait(service).body) | ||
b.setName(s"${service.packageDir}/${service.name}PowerApi.scala") | ||
logger.info(s"Generating Akka gRPC service power API interface for ${service.packageName}.${service.name}") | ||
b.build | ||
} | ||
} |
This file contains 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
Oops, something went wrong.