| apply plugin: 'protobuf' |
| apply plugin:'application' |
| |
| description = "gRPC: Integration Testing" |
| |
| // Add dependency on the protobuf plugin |
| buildscript { |
| repositories { |
| mavenCentral() |
| } |
| dependencies { |
| classpath libraries.protobuf_plugin |
| } |
| } |
| |
| configurations { |
| alpnboot |
| } |
| |
| dependencies { |
| compile project(':grpc-core'), |
| project(':grpc-netty'), |
| project(':grpc-okhttp'), |
| project(':grpc-stub'), |
| project(':grpc-testing'), |
| libraries.junit, |
| libraries.mockito |
| |
| // Determine the correct version of Jetty ALPN boot to use based |
| // on the Java version. |
| def alpnboot_prefix = 'org.mortbay.jetty.alpn:alpn-boot:' |
| def alpnboot_version = '8.1.2.v20141202' |
| if (JavaVersion.current().ordinal() < JavaVersion.VERSION_1_8.ordinal()) { |
| alpnboot_version = '7.1.2.v20141202' |
| } |
| |
| alpnboot alpnboot_prefix + alpnboot_version |
| } |
| |
| // Allow execution of test client and server. |
| task execute(dependsOn: classes, type:JavaExec) { |
| main = project.hasProperty('mainClass') ? project.mainClass : '' |
| classpath = sourceSets.main.runtimeClasspath |
| jvmArgs = ["-Xbootclasspath/p:" + configurations.alpnboot.asPath] |
| workingDir = project.rootDir |
| |
| // If appArgs were provided, set the program arguments. |
| if (project.hasProperty("appArgs")) { |
| args = Eval.me(appArgs) |
| } |
| } |
| |
| // 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") |
| } |
| } |
| } |