mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-12-24 02:05:12 +01:00
protoc: fix filename generation for .java
This commit is contained in:
parent
68997828c8
commit
f876a7b18c
14
playground/protoc/inc/msgCaseTest.proto
Normal file
14
playground/protoc/inc/msgCaseTest.proto
Normal file
@ -0,0 +1,14 @@
|
||||
package udp.tc.tests;
|
||||
|
||||
import "message_inc.proto";
|
||||
|
||||
option java_package ="com.udp.tc.tests";
|
||||
option cc_generic_services = false;
|
||||
option java_generic_services = false;
|
||||
option py_generic_services = false;
|
||||
|
||||
message MessageCaseTest {
|
||||
required int32 test = 1;
|
||||
optional uint32 blah = 2;
|
||||
required IncludeMe custom = 3;
|
||||
}
|
@ -57,7 +57,7 @@ def build(bld):
|
||||
features = 'javac protoc',
|
||||
name = 'pbjava',
|
||||
srcdir = 'inc/',
|
||||
source = ['inc/message_inc.proto', 'inc/message.proto'],
|
||||
source = ['inc/message_inc.proto', 'inc/message.proto', 'inc/msgCaseTest.proto' ],
|
||||
use = 'PROTOBUF',
|
||||
protoc_includes = ['inc'])
|
||||
|
||||
|
@ -210,10 +210,12 @@ def process_protoc(self, node):
|
||||
if javacn:
|
||||
nodename += javacn + '.java'
|
||||
else:
|
||||
filenamebase = node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].replace('_','')
|
||||
filenamebase = filenamebase[:1].upper() + filenamebase[1:]
|
||||
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().replace('_','') + 'OuterClass.java'
|
||||
nodename += filenamebase + 'OuterClass.java'
|
||||
else:
|
||||
nodename += node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title().replace('_','') + '.java'
|
||||
nodename += filenamebase + '.java'
|
||||
|
||||
java_node = node.parent.find_or_declare(nodename)
|
||||
out_nodes.append(java_node)
|
||||
|
Loading…
Reference in New Issue
Block a user