|
|
|
@ -85,19 +85,26 @@ void PrintEnumVerifierLogic( |
|
|
|
|
absl::StrCat(enum_verifier_string, terminating_string)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void PrintGencodeVersionValidator(io::Printer* printer) { |
|
|
|
|
const auto& version = GetProtobufJavaVersion(); |
|
|
|
|
printer->Print( |
|
|
|
|
"com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(\n" |
|
|
|
|
" com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,\n" |
|
|
|
|
" $major$,\n" |
|
|
|
|
" $minor$,\n" |
|
|
|
|
" $patch$,\n" |
|
|
|
|
" $suffix$);\n", |
|
|
|
|
"major", absl::StrCat("/* major= */ ", version.major()), "minor", |
|
|
|
|
absl::StrCat("/* minor= */ ", version.minor()), "patch", |
|
|
|
|
absl::StrCat("/* patch= */ ", version.patch()), "suffix", |
|
|
|
|
absl::StrCat("/* suffix= */ \"", version.suffix(), "\"")); |
|
|
|
|
void PrintGencodeVersionValidator(io::Printer* printer, bool oss_runtime) { |
|
|
|
|
if (oss_runtime) { |
|
|
|
|
const auto& version = GetProtobufJavaVersion(); |
|
|
|
|
printer->Print( |
|
|
|
|
"com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(\n" |
|
|
|
|
" com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,\n" |
|
|
|
|
" $major$,\n" |
|
|
|
|
" $minor$,\n" |
|
|
|
|
" $patch$,\n" |
|
|
|
|
" $suffix$);\n", |
|
|
|
|
"major", absl::StrCat("/* major= */ ", version.major()), "minor", |
|
|
|
|
absl::StrCat("/* minor= */ ", version.minor()), "patch", |
|
|
|
|
absl::StrCat("/* patch= */ ", version.patch()), "suffix", |
|
|
|
|
absl::StrCat("/* suffix= */ \"", version.suffix(), "\"")); |
|
|
|
|
} else { |
|
|
|
|
printer->Print( |
|
|
|
|
"com.google.protobuf.RuntimeVersion.validateProtobufGencodeDomain(\n" |
|
|
|
|
" " |
|
|
|
|
"com.google.protobuf.RuntimeVersion.RuntimeDomain.GOOGLE_INTERNAL);\n"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::string UnderscoresToCamelCase(absl::string_view input, |
|
|
|
|