blob: acfd0f5e9e1d1ba0e68b3105fe900a42ab1d5cb3 [file] [log] [blame]
zhangkun9de8e4b2015-01-15 10:29:05 -08001apply plugin: "cpp"
2
zhangkun835e607852015-01-22 12:31:56 -08003description = 'The protoc plugin for gRPC Java'
4
zhangkun9de8e4b2015-01-15 10:29:05 -08005executables {
6 java_plugin {}
7}
8
9binaries.all {
10 if (toolChain in Gcc) {
11 cppCompiler.args "-std=c++11"
Eric Anderson2049e0d2015-01-29 12:41:51 -080012 if (System.env.CXXFLAGS) {
13 cppCompiler.args System.env.CXXFLAGS
14 }
15 if (System.env.CPPFLAGS) {
16 cppCompiler.args System.env.CPPFLAGS
17 }
zhangkun9de8e4b2015-01-15 10:29:05 -080018 linker.args "-lprotoc", "-lprotobuf"
Eric Anderson2049e0d2015-01-29 12:41:51 -080019 if (System.env.LDFLAGS) {
20 linker.args System.env.LDFLAGS
21 }
zhangkun9de8e4b2015-01-15 10:29:05 -080022 }
23}
24
25sources {
26 java_plugin {
27 // Configure an existing CppSourceSet
28 cpp {
29 source {
30 srcDirs "src/"
31 include "**/*.cc"
32 }
33 }
34 }
35}
36
zhangkun835e607852015-01-22 12:31:56 -080037task test(type: Exec, dependsOn: 'java_pluginExecutable') {
38 environment 'TEST_TMP_DIR', temporaryDir
39 commandLine './run_test.sh'
40}