diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2020-05-19 14:52:52 -0700 |
---|---|---|
committer | Liz Kammer <eakammer@google.com> | 2020-05-21 12:06:25 -0700 |
commit | ad19790515bf4ceacc5ebdf582e71d76272b4b36 (patch) | |
tree | b4ee55b59fe53f73ecfe31d082f127cda8655613 /tools | |
parent | 682de559627a619e0c14aabcf7607633548da6f3 (diff) |
Do not rename R.java package
Cherry picks the rest of Id9d10e16f32533da1b67ab72ac846791526e7a76.
When the --rename-resources-package flag is used, only rename the
package name within the resources.arsc. Generate the R.java under
the package name defined by the manifest unless --custom-package is
used.
Test: manual
Bug: 147434671
Merged-In: Iab30ff9d3d136fa1e5464913f8d493df22c5c1c4
Change-Id: I896b8c69793cff714a950081fd8521e4acf0cf25
Diffstat (limited to 'tools')
-rw-r--r-- | tools/aapt2/cmd/Link.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/aapt2/cmd/Link.cpp b/tools/aapt2/cmd/Link.cpp index e8970d48e404..7afb0000aea1 100644 --- a/tools/aapt2/cmd/Link.cpp +++ b/tools/aapt2/cmd/Link.cpp @@ -1659,10 +1659,8 @@ 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(); |