Skip to content
Closed
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
31 changes: 10 additions & 21 deletions buildscripts/kokoro/unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,17 @@ if [[ -z "${SKIP_TESTS:-}" ]]; then
# --batch-mode reduces log spam
mvn verify --batch-mode
popd
pushd examples/example-alts
../gradlew build $GRADLE_FLAGS
popd
pushd examples/example-hostname
../gradlew build $GRADLE_FLAGS
mvn verify --batch-mode
popd
pushd examples/example-tls
../gradlew build $GRADLE_FLAGS
mvn verify --batch-mode
popd
pushd examples/example-jwt-auth
../gradlew build $GRADLE_FLAGS
mvn verify --batch-mode
popd
pushd examples/example-xds
../gradlew build $GRADLE_FLAGS
popd
for f in examples/example-*
do
pushd "$f"
../gradlew build $GRADLE_FLAGS
if [ -f "pom.xml" ]; then
# --batch-mode reduces log spam
mvn verify --batch-mode
fi
popd
done
# TODO(zpencer): also build the GAE examples
pushd examples/example-orca
../gradlew build $GRADLE_FLAGS
popd
fi

LOCAL_MVN_TEMP=$(mktemp -d)
Expand Down
35 changes: 35 additions & 0 deletions examples/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ java_grpc_library(
deps = [":hello_streaming_java_proto"],
)

proto_library(
name = "echo_proto",
srcs = ["src/main/proto/echo.proto"],
)

java_proto_library(
name = "echo_java_proto",
deps = [":recho_proto"],
)

java_grpc_library(
name = "echo_java_grpc",
srcs = [":echo_proto"],
deps = [":echo_java_proto"],
)

proto_library(
name = "route_guide_proto",
srcs = ["src/main/proto/route_guide.proto"],
Expand Down Expand Up @@ -68,6 +84,8 @@ java_library(
":hello_streaming_java_proto",
":helloworld_java_grpc",
":helloworld_java_proto",
":echo_java_grpc",
":echo_java_proto",
":route_guide_java_grpc",
":route_guide_java_proto",
"@com_google_protobuf//:protobuf_java",
Expand Down Expand Up @@ -172,3 +190,20 @@ java_binary(
],
)

java_binary(
name = "deadline-server",
testonly = 1,
main_class = "io.grpc.examples.deadline.DeadlineServer",
runtime_deps = [
":examples",
],
)

java_binary(
name = "deadline-client",
testonly = 1,
main_class = "io.grpc.examples.deadline.DeadlineClient",
runtime_deps = [
":examples",
],
)
4 changes: 4 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ before trying out the examples.

- [Error handling](src/main/java/io/grpc/examples/errorhandling)

- [Client and Server Sharing](src/main/java/io/grpc/examples/multiplex)

- [Compression](src/main/java/io/grpc/examples/experimental)

- [Flow control](src/main/java/io/grpc/examples/manualflowcontrol)
Expand Down Expand Up @@ -117,6 +119,8 @@ before trying out the examples.

</details>

- [Keep Alive](src/main/java/io/grpc/examples/keepalive)

### <a name="to-build-the-examples"></a> To build the examples

1. **[Install gRPC Java library SNAPSHOT locally, including code generation plugin](../COMPILING.md) (Only need this step for non-released versions, e.g. master HEAD).**
Expand Down
50 changes: 50 additions & 0 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,48 @@ task nameResolveClient(type: CreateStartScripts) {
classpath = startScripts.classpath
}

task multiplexingServer(type: CreateStartScripts) {
mainClass = 'io.grpc.examples.multiplex.MultiplexingServer'
applicationName = 'multiplexing-server'
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task sharingClient(type: CreateStartScripts) {
mainClass = 'io.grpc.examples.multiplex.SharingClient'
applicationName = 'sharing-client'
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task deadlineServer(type: CreateStartScripts) {
mainClass = 'io.grpc.examples.deadline.DeadlineServer'
applicationName = 'deadline-server'
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task deadlineClient(type: CreateStartScripts) {
mainClass = 'io.grpc.examples.deadline.DeadlineClient'
applicationName = 'deadline-client'
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task keepAliveServer(type: CreateStartScripts) {
mainClass = 'io.grpc.examples.keepalive.KeepAliveServer'
applicationName = 'keep-alive-server'
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

task keepAliveClient(type: CreateStartScripts) {
mainClass = 'io.grpc.examples.keepalive.KeepAliveClient'
applicationName = 'keep-alive-client'
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

applicationDistribution.into('bin') {
from(routeGuideServer)
from(routeGuideClient)
Expand All @@ -183,5 +225,13 @@ applicationDistribution.into('bin') {
from(loadBalanceClient)
from(nameResolveServer)
from(nameResolveClient)
from(multiplexingServer)
from(sharingClient)
from(deadlineServer)
from(deadlineClient)
from(keepAliveServer)
from(keepAliveClient)
from(multiplexingServer)
from(sharingClient)
fileMode = 0755
}
Loading