diff options
-rw-r--r-- | build.gradle | 2 | ||||
-rw-r--r-- | compiler/build.gradle | 66 | ||||
-rw-r--r-- | gradle/wrapper/gradle-wrapper.properties | 4 |
3 files changed, 38 insertions, 34 deletions
diff --git a/build.gradle b/build.gradle index 77cabac5c..4a64e3005 100644 --- a/build.gradle +++ b/build.gradle @@ -52,7 +52,7 @@ subprojects { ext { def exeSuffix = osdetector.os == 'windows' ? ".exe" : "" protocPluginBaseName = 'protoc-gen-grpc-java' - javaPluginPath = "$rootDir/compiler/build/binaries/java_pluginExecutable/$protocPluginBaseName$exeSuffix" + javaPluginPath = "$rootDir/compiler/build/exe/java_plugin/$protocPluginBaseName$exeSuffix" protobufVersion = '3.0.0-beta-1' protobufNanoVersion = '3.0.0-alpha-4' diff --git a/compiler/build.gradle b/compiler/build.gradle index 462529255..fa77d346a 100644 --- a/compiler/build.gradle +++ b/compiler/build.gradle @@ -71,6 +71,41 @@ model { baseName "$protocPluginBaseName" } } + + binaries { + all { + if (toolChain in Gcc || toolChain in Clang) { + cppCompiler.args "--std=c++0x" + addEnvArgs("CXXFLAGS", cppCompiler.args) + addEnvArgs("CPPFLAGS", cppCompiler.args) + if (osdetector.os == "osx") { + cppCompiler.args "-mmacosx-version-min=10.7", "-stdlib=libc++" + addLibraryIfNotLinked('protoc', linker.args) + addLibraryIfNotLinked('protobuf', linker.args) + } else if (osdetector.os == "windows") { + linker.args "-static", "-lprotoc", "-lprotobuf", "-static-libgcc", "-static-libstdc++", + "-s" + } else { + // Link protoc, protobuf, libgcc and libstdc++ statically. + // Link other (system) libraries dynamically. + // Clang under OSX doesn't support these options. + linker.args "-Wl,-Bstatic", "-lprotoc", "-lprotobuf", "-static-libgcc", + "-static-libstdc++", + "-Wl,-Bdynamic", "-lpthread", "-s" + } + addEnvArgs("LDFLAGS", linker.args) + } else if (toolChain in VisualCpp) { + cppCompiler.args "/EHsc", "/MT" + if (rootProject.hasProperty('vcProtobufInclude')) { + cppCompiler.args "/I${rootProject.vcProtobufInclude}" + } + linker.args "libprotobuf.lib", "libprotoc.lib" + if (rootProject.hasProperty('vcProtobufLibs')) { + linker.args "/LIBPATH:${rootProject.vcProtobufLibs}" + } + } + } + } } configurations { @@ -133,37 +168,6 @@ checkstyleTestNano { println "*** Building codegen requires Protobuf version ${protobufVersion}" println "*** Please refer to https://github.com/grpc/grpc-java/blob/master/COMPILING.md#how-to-build-code-generation-plugin" -binaries.all { - if (toolChain in Gcc || toolChain in Clang) { - cppCompiler.args "--std=c++0x" - addEnvArgs("CXXFLAGS", cppCompiler.args) - addEnvArgs("CPPFLAGS", cppCompiler.args) - if (osdetector.os == "osx") { - cppCompiler.args "-mmacosx-version-min=10.7", "-stdlib=libc++" - addLibraryIfNotLinked('protoc', linker.args) - addLibraryIfNotLinked('protobuf', linker.args) - } else if (osdetector.os == "windows") { - linker.args "-static", "-lprotoc", "-lprotobuf", "-static-libgcc", "-static-libstdc++", "-s" - } else { - // Link protoc, protobuf, libgcc and libstdc++ statically. - // Link other (system) libraries dynamically. - // Clang under OSX doesn't support these options. - linker.args "-Wl,-Bstatic", "-lprotoc", "-lprotobuf", "-static-libgcc", "-static-libstdc++", - "-Wl,-Bdynamic", "-lpthread", "-s" - } - addEnvArgs("LDFLAGS", linker.args) - } else if (toolChain in VisualCpp) { - cppCompiler.args "/EHsc", "/MT" - if (rootProject.hasProperty('vcProtobufInclude')) { - cppCompiler.args "/I${rootProject.vcProtobufInclude}" - } - linker.args "libprotobuf.lib", "libprotoc.lib" - if (rootProject.hasProperty('vcProtobufLibs')) { - linker.args "/LIBPATH:${rootProject.vcProtobufLibs}" - } - } -} - task buildArtifacts(type: Copy) { dependsOn 'java_pluginExecutable' from("$buildDir/binaries") { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5aecc6c17..a63c629dc 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Oct 23 10:41:33 PDT 2015 +#Tue Jan 26 12:09:52 PST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip |