Skip to content

Commit

Permalink
Do not update remove .workspace.resource module from memory state unt…
Browse files Browse the repository at this point in the history
…il updateProjectStructure do that

PiperOrigin-RevId: 352077098
  • Loading branch information
Googler authored and copybara-github committed Jan 15, 2021
1 parent 23a9947 commit 7370e97
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,22 @@ private static void updateInMemoryState(
Module module;
if (BlazeAndroidWorkspaceImporter.WORKSPACE_RESOURCES_TARGET_KEY.equals(
androidResourceModule.targetKey)) {
// For workspace resource module, give it a dummy package name, and set module
// directory to workspace root. No manifest is attached to this module
// Until ~Jan 2021, we used to create a separate module (.workspace.resources) that included
// resources that were used by project, but not included in any other resource module.
// Starting with cl/350385526, these resources are attached to the workspace module itself
// and we don't create a separate module for workspace resources.
modulePackage = BlazeAndroidWorkspaceImporter.WORKSPACE_RESOURCES_MODULE_PACKAGE;
moduleDirectory = workspaceRoot.directory();
module = workspaceModule;
// b/177279296 revealed an issue when we removed the workspace module. To work around this
// we still use the workspace.resources module as long as such a module still exists in the
// project. Hopefully, in a couple of months, there won't be any projects around with the
// resources module, and we can delete this code.
module =
moduleFinder.findModuleByName(
moduleNameForAndroidModule(androidResourceModule.targetKey));
if (module == null) {
module = workspaceModule;
}
} else {
TargetIdeInfo target =
Preconditions.checkNotNull(
Expand Down

0 comments on commit 7370e97

Please sign in to comment.