diff options
author | Kun Zhang <zhangkun@google.com> | 2015-04-17 10:49:11 -0700 |
---|---|---|
committer | Kun Zhang <zhangkun@google.com> | 2015-04-17 16:35:23 -0700 |
commit | 4bc2d6d9a4f3a0c8e035393d6de5c999472cfc45 (patch) | |
tree | 8a691e8153d1b4a37d5198cb742d1b28da46bf56 | |
parent | 0c2ea1550b1d60a8c81ec907209445ae6d71a482 (diff) | |
download | grpc-grpc-java-4bc2d6d9a4f3a0c8e035393d6de5c999472cfc45.tar.gz |
Remove call sites of Os.isFamily(). Use osdetector instead
-rw-r--r-- | build.gradle | 15 | ||||
-rw-r--r-- | compiler/build.gradle | 10 |
2 files changed, 15 insertions, 10 deletions
diff --git a/build.gradle b/build.gradle index 6d77d24ac..4e497486e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,19 @@ -import org.apache.tools.ant.taskdefs.condition.Os +buildscript { + repositories { + mavenCentral() + mavenLocal() + } + dependencies { + classpath 'com.google.gradle:osdetector-gradle-plugin:1.2.1' + } +} subprojects { apply plugin: "checkstyle" apply plugin: "java" apply plugin: "maven" apply plugin: "idea" + apply plugin: "osdetector" apply plugin: "signing" group = "io.grpc" @@ -58,12 +67,12 @@ subprojects { alpnboot_package_name = 'org.mortbay.jetty.alpn:alpn-boot:' + alpnboot_version - def exeSuffix = Os.isFamily(Os.FAMILY_WINDOWS) ? ".exe" : "" + def exeSuffix = osdetector.os == 'windows' ? ".exe" : "" // The split is to workaround everything after the colon in C:\ being // removed due to a bug in the protobuf plugin. // https://github.com/aantono/gradle-plugin-protobuf/issues/23 def splitRootDir = rootDir - if (Os.isFamily(Os.FAMILY_WINDOWS)) { + if (osdetector.os == 'windows') { splitRootDir = splitRootDir.getPath().split(":", 2)[1] } protocPluginBaseName = 'protoc-gen-grpc-java' diff --git a/compiler/build.gradle b/compiler/build.gradle index aca19ae15..f0ab72c2f 100644 --- a/compiler/build.gradle +++ b/compiler/build.gradle @@ -1,9 +1,6 @@ apply plugin: "cpp" -apply plugin: "osdetector" apply plugin: "protobuf" -import org.apache.tools.ant.taskdefs.condition.Os - description = 'The protoc plugin for gRPC Java' buildscript { @@ -12,8 +9,7 @@ buildscript { mavenLocal() } dependencies { - classpath libraries.protobuf_plugin, - 'com.google.gradle:osdetector-gradle-plugin:1.2.1' + classpath libraries.protobuf_plugin } } @@ -201,12 +197,12 @@ protobufCodeGenPlugins = ["java_plugin:$javaPluginPath"] generateTestProto.dependsOn 'local_archJava_pluginExecutable' // Ignore test for the moment on Windows. It will be easier to run once the // gradle protobuf plugin can support nano. -if (!Os.isFamily(Os.FAMILY_WINDOWS)) { +if (osdetector.os != 'windows') { test.dependsOn('testGolden','testNanoGolden') } task testGolden(type: Exec, dependsOn: 'generateTestProto') { - if (!Os.isFamily(Os.FAMILY_WINDOWS)) { + if (osdetector.os != 'windows') { executable "diff" } else { executable "fc" |