Status Update
Comments
je...@google.com <je...@google.com>
al...@google.com <al...@google.com> #2
As I understand it, we need to migrate namespace definitions both from AndroidManifest.xml
and from implicit definitions from applicationId
/ testApplicationId
? Is that right? So an 8.0 project would have a
namespace <n>
testNamespace <tn>
where <n> is taken from AndroidManifest.xml
package
definitions if present, and applicationId
if not, and <tn>
is testApplicationId
if present and <n>.test
if not?
al...@google.com <al...@google.com>
al...@google.com <al...@google.com> #3
Sorry for the confusion. AGP would change how it computes the namespace for the androidTest variant. All the Upgrade assistant would need to do is update the source code for the import of the R
class.
al...@google.com <al...@google.com>
xa...@google.com <xa...@google.com> #4
OK! And, I think, this should happen at the same time as the namespace
declaration is migrated from AndroidManifest.xml
?
sa...@google.com <sa...@google.com> #5
It's unrelated, but it is possible that we move 8.0 to also only declare the namespace into the DSL. I would make it a separate refactoring because they are not tied at all.
sa...@google.com <sa...@google.com> #6
I would consider first adding the right new value to models (as a new property) and then, to avoid Studio interpreting manifests and build configurations, just update to whatever the synced value of this new property is.
Description
Using a basic project with 1 app and 1 lib, using AGP 7.4.0 alpha 2, we see the following manifest files after a build:
The fact that we have 3 intermediate manifests in the app and (more importantly) 2 in the library is probably something we can optimize, in some cases.
The most important aspect here is the library as we need this for scaling. If the reason to have 2 is something we can put behind an opt-in feature that would be better.