apply plugin: 'application' apply plugin: 'protobuf' description = "grpc Examples" buildscript { repositories { mavenCentral() } dependencies { classpath libraries.protobuf_plugin } } dependencies { compile project(':grpc-core'), project(':grpc-netty'), project(':grpc-okhttp'), project(':grpc-stub'), libraries.jsonp } protobufCodeGenPlugins = ["java_plugin:$javaPluginPath"] generateProto.dependsOn ':grpc-compiler:java_pluginExecutable' task routeGuideServer(type: JavaExec) { main = "io.grpc.examples.routeguide.RouteGuideServer" description = "Executes the route guide server." classpath = sourceSets.main.runtimeClasspath } task routeGuideClient(type: JavaExec) { main = "io.grpc.examples.routeguide.RouteGuideClient" description = "Executes the route guide client." classpath = sourceSets.main.runtimeClasspath } task helloWorldServer(type: JavaExec) { main = "io.grpc.examples.helloworld.HelloWorldServer" description = "Executes the hello world server." classpath = sourceSets.main.runtimeClasspath } task helloWorldClient(type: JavaExec) { main = "io.grpc.examples.helloworld.HelloWorldClient" description = "Executes the hello world client." classpath = sourceSets.main.runtimeClasspath } // Allow intellij projects to refer to generated-sources idea { module { // The whole build dir is excluded by default, but we need build/generated-sources, // which contains the generated proto classes. excludeDirs = [file('.gradle')] if (buildDir.exists()) { excludeDirs += files(buildDir.listFiles()) excludeDirs -= file("$buildDir/generated-sources") } } }