grpc-java/compiler/build.gradle

41 lines
758 B
Groovy

apply plugin: "cpp"
description = 'The protoc plugin for gRPC Java'
executables {
java_plugin {}
}
binaries.all {
if (toolChain in Gcc) {
cppCompiler.args "-std=c++11"
if (System.env.CXXFLAGS) {
cppCompiler.args System.env.CXXFLAGS
}
if (System.env.CPPFLAGS) {
cppCompiler.args System.env.CPPFLAGS
}
linker.args "-lprotoc", "-lprotobuf"
if (System.env.LDFLAGS) {
linker.args System.env.LDFLAGS
}
}
}
sources {
java_plugin {
// Configure an existing CppSourceSet
cpp {
source {
srcDirs "src/"
include "**/*.cc"
}
}
}
}
task test(type: Exec, dependsOn: 'java_pluginExecutable') {
environment 'TEST_TMP_DIR', temporaryDir
commandLine './run_test.sh'
}