Merge "Do not rename R.java package" into rvc-dev am: 5c8dd641ba am: 98b076b85d am: 1da72bfb6c am: 9bb6fa9e89

Change-Id: I128110df8aa4c7f0d9abd144be3f4078e6d87ad6
This commit is contained in:
Ryan Mitchell
2020-05-08 18:41:04 +00:00
committed by Automerger Merge Worker

View File

@@ -1762,16 +1762,23 @@ class Linker {
return 1;
}
// Determine the package name under which to merge resources.
if (options_.rename_resources_package) {
context_->SetCompilationPackage(options_.rename_resources_package.value());
} else if (Maybe<AppInfo> maybe_app_info =
// First extract the Package name without modifying it (via --rename-manifest-package).
if (Maybe<AppInfo> maybe_app_info =
ExtractAppInfoFromManifest(manifest_xml.get(), context_->GetDiagnostics())) {
// Extract the package name from the manifest ignoring the value of --rename-manifest-package.
const AppInfo& app_info = maybe_app_info.value();
context_->SetCompilationPackage(app_info.package);
}
// Determine the package name under which to merge resources.
if (options_.rename_resources_package) {
if (!options_.custom_java_package) {
// Generate the R.java under the original package name instead of the package name specified
// through --rename-resources-package.
options_.custom_java_package = context_->GetCompilationPackage();
}
context_->SetCompilationPackage(options_.rename_resources_package.value());
}
// Now that the compilation package is set, load the dependencies. This will also extract
// the Android framework's versionCode and versionName, if they exist.
if (!LoadSymbolsFromIncludePaths()) {