diff options
| author | ruki <[email protected]> | 2020-06-13 10:12:41 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-06-13 10:12:41 +0800 |
| commit | 9636ff2d67111f584a1a4a8e995e672940f3a8b7 (patch) | |
| tree | 32107c46de527cd1b25c41ba3f55d4a6bedf407b /tests | |
| parent | b0dbf85198909ffdcdd086c94ce429a81626a01f (diff) | |
add proto rootdir
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/projects/c++/protobuf/src/subdir/test2.proto | 8 | ||||
| -rw-r--r-- | tests/projects/c++/protobuf/src/test.proto | 2 | ||||
| -rw-r--r-- | tests/projects/c++/protobuf/xmake.lua | 15 | ||||
| -rw-r--r-- | tests/projects/c/protobuf/xmake.lua | 13 |
4 files changed, 12 insertions, 26 deletions
diff --git a/tests/projects/c++/protobuf/src/subdir/test2.proto b/tests/projects/c++/protobuf/src/subdir/test2.proto new file mode 100644 index 000000000..811cdac3e --- /dev/null +++ b/tests/projects/c++/protobuf/src/subdir/test2.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package test2; +message TestCase2 { + string name2 = 4; +} +message Test2 { + repeated TestCase2 case2 = 1; +} diff --git a/tests/projects/c++/protobuf/src/test.proto b/tests/projects/c++/protobuf/src/test.proto index 0f129ea13..0f580b87a 100644 --- a/tests/projects/c++/protobuf/src/test.proto +++ b/tests/projects/c++/protobuf/src/test.proto @@ -1,8 +1,10 @@ syntax = "proto3"; +import "subdir/test2.proto"; package test; message TestCase { string name = 4; } message Test { repeated TestCase case = 1; + repeated test2.TestCase2 case2 = 2; } diff --git a/tests/projects/c++/protobuf/xmake.lua b/tests/projects/c++/protobuf/xmake.lua index ee65ee71f..04bed4fb0 100644 --- a/tests/projects/c++/protobuf/xmake.lua +++ b/tests/projects/c++/protobuf/xmake.lua @@ -1,23 +1,10 @@ - --- add rules: debug and release add_rules("mode.debug", "mode.release") - --- add protobuf add_requires("protobuf-cpp") --- add target target("test") - - -- set kind set_kind("binary") - - -- set languages set_languages("c++11") - - -- add packages add_packages("protobuf-cpp") - - -- add files add_files("src/*.cpp") - add_files("src/*.proto", {rules = "protobuf.cpp"}) + add_files("src/**.proto", {rules = "protobuf.cpp", proto_rootdir = "src"}) diff --git a/tests/projects/c/protobuf/xmake.lua b/tests/projects/c/protobuf/xmake.lua index b32af856c..86e154439 100644 --- a/tests/projects/c/protobuf/xmake.lua +++ b/tests/projects/c/protobuf/xmake.lua @@ -1,20 +1,9 @@ - --- add rules: debug and release add_rules("mode.debug", "mode.release") - --- add protobuf add_requires("protobuf-c") --- add target target("test") - - -- set kind set_kind("binary") - - -- add packages add_packages("protobuf-c") - - -- add files add_files("src/*.c") - add_files("src/**.proto", {rules = "protobuf.c"}) + add_files("src/**.proto", {rules = "protobuf.c", proto_rootdir = "src"}) |
