2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 09:57:15 +01:00

protoc: protoc (ver 2 and 3) strips underscores when generating .java file names. consider this in node name generation otherwise the generated java file will not be found

This commit is contained in:
fedepell 2018-03-09 15:55:34 +01:00 committed by ita1024
parent 9e2da12800
commit adbee3f23a

View File

@ -191,9 +191,9 @@ def process_protoc(self, node):
nodename += javacn + '.java'
else:
if self.env.PROTOC_MAJOR > '2' and node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title() in messages:
nodename += node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title() + 'OuterClass.java'
nodename += node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title().replace('_','') + 'OuterClass.java'
else:
nodename += node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title() + '.java'
nodename += node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title().replace('_','') + '.java'
java_node = node.parent.find_or_declare(nodename)
out_nodes.append(java_node)