diff --git a/playground/protoc/increcurse/increc/message.proto b/playground/protoc/increcurse/increc/message.proto new file mode 100644 index 00000000..4dbfd1a2 --- /dev/null +++ b/playground/protoc/increcurse/increc/message.proto @@ -0,0 +1,15 @@ +package udp.tc.tests; + +import "message_inc.proto"; + +option java_package ="com.udp.tc.tests"; +option java_outer_classname= "MessageProtos"; +option cc_generic_services = false; +option java_generic_services = false; +option py_generic_services = false; + +message Message { + required int32 test = 1; + optional uint32 blah = 2; + required IncludeMe custom = 3; +} diff --git a/playground/protoc/increcurse/increc/message_inc.proto b/playground/protoc/increcurse/increc/message_inc.proto new file mode 100644 index 00000000..5da32dfd --- /dev/null +++ b/playground/protoc/increcurse/increc/message_inc.proto @@ -0,0 +1,14 @@ +package udp.tc.tests; + +option java_package = "com.udp.tc.tests"; +option java_outer_classname = "MessageInc"; +option cc_generic_services = false; +option java_generic_services = false; +option py_generic_services = false; + + +message IncludeMe { + required int32 test = 1; + optional uint32 blah = 2; + optional uint32 justinc = 3; +} diff --git a/playground/protoc/increcurse/wscript b/playground/protoc/increcurse/wscript new file mode 100644 index 00000000..226009a7 --- /dev/null +++ b/playground/protoc/increcurse/wscript @@ -0,0 +1,9 @@ +#! /usr/bin/env python + + +def build(bld): + bld( + features = 'py', + name = 'pbpyrec', + source = ['increc/message.proto'], + protoc_includes = ['increc']) diff --git a/playground/protoc/wscript b/playground/protoc/wscript index a21e4f95..e5fe1b51 100644 --- a/playground/protoc/wscript +++ b/playground/protoc/wscript @@ -53,3 +53,5 @@ def build(bld): source = ['inc/message_inc.proto', 'inc/message.proto'], use = 'PROTOBUF', protoc_includes = ['inc']) + + bld.recurse('increcurse') diff --git a/waflib/extras/protoc.py b/waflib/extras/protoc.py index f3cb4d86..a367f4f3 100644 --- a/waflib/extras/protoc.py +++ b/waflib/extras/protoc.py @@ -104,7 +104,7 @@ class protoc(Task): if 'py' in self.generator.features or 'javac' in self.generator.features: for incpath in getattr(self.generator, 'protoc_includes', []): - search_nodes.append(self.generator.bld.path.find_node(incpath)) + search_nodes.append(self.generator.path.find_node(incpath)) def parse_node(node): if node in seen: @@ -219,7 +219,12 @@ def process_protoc(self, node): # For C++ standard include files dirs are used, # but this doesn't apply to Python for example for incpath in getattr(self, 'protoc_includes', []): - incdirs.append(self.path.find_node(incpath).bldpath()) + incpath_node = self.path.find_node(incpath) + if incpath_node: + incdirs.append(incpath_node.bldpath()) + else: + raise Errors.WafError('protoc: include path %r does not exist' % incpath) + tsk.env.PROTOC_INCPATHS = incdirs # PR2115: protoc generates output of .proto files in nested