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