Skip to content

Commit

Permalink
Improving docs structure (#339)
Browse files Browse the repository at this point in the history
* Restructure docs
  • Loading branch information
jrudolph authored and chbatey committed Aug 15, 2018
1 parent 6d4b6c9 commit 087b55a
Show file tree
Hide file tree
Showing 23 changed files with 763 additions and 645 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Gradle

To get started with Akka gRPC read the [client](client.md) or [server](server.md) introductions.
To get started with Akka gRPC read the @ref[client](../client/index.md) or @ref[server](../server/index.md) introductions.

## Configuring what to generate

Expand Down
11 changes: 11 additions & 0 deletions docs/src/main/paradox/buildtools/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Build Tool Support

@@toc

@@@index

* [sbt](sbt.md)
* [Gradle](gradle.md)
* [Maven](maven.md)

@@@
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Maven

To get started with Akka gRPC read the [client](client.md) or [server](server.md) introductions.
To get started with Akka gRPC read the @ref[client](../client/index.md) or @ref[server](../server/index.md) introductions.

## Configuring what to generate

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sbt

To get started with Akka gRPC read the [client](client.md) or [server](server.md) introductions.
To get started with Akka gRPC read the @ref[client](../client/index.md) or @ref[server](../server/index.md) introductions.

## Configuring what to generate

Expand All @@ -12,6 +12,7 @@ What language to generate stubs for is also configurable:

@@snip[x](/sbt-plugin/src/sbt-test/gen-scala-server/00-interop/build.sbt) { #languages-scala #languages-java #languages-both }

## Passing parameters to the generator

Passing generator parameters to the underlying ScalaPB generators can be done through `akkaGrpcCodeGeneratorSettings`
setting, any specified options will be passed to all underlying generators that are enabled. By default this setting
Expand All @@ -29,9 +30,9 @@ By default protobuf files are looked for in `src/main/protobuf` (and `src/main/p
You can configure where your .proto files are located like this:

```
// "sourceDirectory in Compile" is "src/main", so this adds "src/main/proto":
// "sourceDirectory in Compile" is "src/main", so this adds "src/main/proto_custom":
inConfig(Compile)(Seq(
PB.protoSources += sourceDirectory.value / "proto"
PB.protoSources += sourceDirectory.value / "proto_custom"
))
```

Expand All @@ -41,24 +42,23 @@ Instead of duplicating the `.proto` definitions between server and client projec
that contain proto definitions to your build:

```scala
libraryDependencies +=
"com.example" %% "my-grpc-service" % "1.0.0" % "protobuf"
libraryDependencies += "com.example" %% "my-grpc-service" % "1.0.0" % "protobuf"
```

## Starting your Akka gRPC server from sbt

As the server requires a special Java agent for ALPN ([see Akka HTTP docs about HTTP/2](https://doc.akka.io/docs/akka-http/current/server-side/http2.html#application-layer-protocol-negotiation-alpn-))
you need to pass this agent with a `-javaagent` flag to the JVM when running the server.

This can be done using the `JavaAgent` sbt plugin.
This can be done automatically using the `JavaAgent` sbt plugin.

Add the plugin `project/plugin.sbt`
Add the plugin to `project/plugin.sbt`

@@snip [plugin.sbt]($root$/../project/plugins.sbt) { #java-agent-plugin }
@@snip [plugin.sbt](/project/plugins.sbt) { #java-agent-plugin }

and then tell it to use the ALPN agent:

@@snip [build.sbt]($root$/../project/ProjectExtensions.scala) { #alpn }
@@snip [build.sbt](/project/ProjectExtensions.scala) { #alpn }

After that you can run it as usual:

Expand Down
302 changes: 0 additions & 302 deletions docs/src/main/paradox/client.md

This file was deleted.

Loading

0 comments on commit 087b55a

Please sign in to comment.