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

Fixes in idlGen header, docs and tests #208

Merged
merged 3 commits into from
Mar 26, 2018
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
8 changes: 4 additions & 4 deletions docs/src/main/tut/idl-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permalink: /docs/rpc/idl-generation

Before entering implementation details, we mentioned that the [frees-rpc] ecosystem brings the ability to generate `.proto` files from the Scala definition, in order to maintain compatibility with other languages and systems outside of Scala.

This responsibility relies on `idlGen`, an sbt plugin to generate Protobuf and Avro IDL files from the [frees-rpc] service definitions.
This relies on `idlGen`, an sbt plugin to generate Protobuf and Avro IDL files from the [frees-rpc] service definitions.

### Plugin Installation

Expand Down Expand Up @@ -47,8 +47,8 @@ Let's take our previous service, and add an Avro-specific request and some usefu
```tut:silent
import freestyle.rpc.protocol._

@option(name = "java_multiple_files", value = true)
@option(name = "java_outer_classname", value = "Quickstart")
@option("java_multiple_files", true)
@option("java_outer_classname", "Quickstart")
@outputName("GreeterService")
@outputPackage("quickstart")
object service {
Expand Down Expand Up @@ -96,8 +96,8 @@ Using this example, the resulting Protobuf IDL would be generated in `/src/main/

syntax = "proto3";

option java_package = "quickstart";
option java_multiple_files = true;
option java_outer_class_name = "Quickstart";

package quickstart;

Expand Down
2 changes: 1 addition & 1 deletion modules/idlgen/core/src/main/scala/Application.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object Application {
val Separator: String = "-" * 80

def main(args: Array[String]): Unit = {
require(args.length >= 2, s"Usage: ${getClass.getName} inputPath outputPath")
require(args.length >= 2, s"\nUsage: ${getClass.getName.replace("$", "")} inputPath outputPath")
val inputPath = new File(args(0)).requireExisting
val outputPath = new File(args(1)).requireExisting
inputPath.allMatching(_.getName.endsWith(ScalaFileExtension)).foreach { inputFile =>
Expand Down
2 changes: 1 addition & 1 deletion modules/idlgen/core/src/main/scala/ProtoGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object ProtoGenerator extends Generator {
private val HeaderLines = Seq(
"// This file has been automatically generated for use by",
"// the idlGen plugin, from frees-rpc service definitions.",
"// Read more at: http://frees.io/docs/rpc/",
"// Read more at: http://frees.io/docs/rpc",
"",
"syntax = \"proto3\";",
""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file has been automatically generated for use by
// the idlGen plugin, from frees-rpc service definitions.
// Read more at: http://frees.io/docs/rpc/
// Read more at: http://frees.io/docs/rpc

syntax = "proto3";

Expand Down
2 changes: 1 addition & 1 deletion modules/idlgen/core/src/test/scala/IdlGenTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class IdlGenTests extends RpcBaseTestSuite {
}
}

"$Generator.generateFrom()" should {
"Generator.generateFrom()" should {
"generate correct Protobuf syntax from RPC definitions" in {
val expected = resource("/proto/GreeterService.proto").getLines.toList
val output = Generator.generateFrom(greeterRpcs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
src/main/resources/proto/
src/main/resources/avro/
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
$ exists src/main/resources/proto/model.proto

$ delete src/main/resources/proto/model.proto

$ exists src/main/resources/avro/model.avpr

$ delete src/main/resources/avro/model.avpr