You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Xamarin.Android.Build.Tasks] Design-Time Build <dimen/> support (#1786)
Fixes: https://devdiv.visualstudio.com/0bdbc590-a062-4c3f-b0f6-9383f67865ee/_workitems/edit/628467Fixes: #1784
We were not correctly processing `<dimen/>` resource items when
parsing the actual resources, via the Design-Time Build and
ManagedResourceParser. We did however process `dimen` resources
correctly when processing the `R.txt` or `R.java` files, so *full*
builds worked as expected.
Update the `ManagedResourceParser` to handle `<dimen/>` resources.
@@ -1178,6 +1185,7 @@ public void BuildAppWithManagedResourceParserAndLibraries ()
1178
1185
StringAssert.Contains("Icon",designerContents,$"{designerFile} should contain Resources.Drawable.Icon");
1179
1186
StringAssert.Contains("Main",designerContents,$"{designerFile} should contain Resources.Layout.Main");
1180
1187
StringAssert.Contains("material_grey_50",designerContents,$"{designerFile} should contain Resources.Color.material_grey_50");
1188
+
StringAssert.DoesNotContain("main_text_item_size",designerContents,$"{designerFile} should not contain Resources.Dimension.main_text_item_size");
1181
1189
StringAssert.DoesNotContain("theme_devicedefault_background",designerContents,$"{designerFile} should not contain Resources.Color.theme_devicedefault_background");
1182
1190
libBuilder.Target="Build";
1183
1191
Assert.IsTrue(libBuilder.Build(libProj),"Library project should have built");
@@ -1197,7 +1205,9 @@ public void BuildAppWithManagedResourceParserAndLibraries ()
1197
1205
StringAssert.Contains("Icon",designerContents,$"{designerFile} should contain Resources.Drawable.Icon");
1198
1206
StringAssert.Contains("Main",designerContents,$"{designerFile} should contain Resources.Layout.Main");
1199
1207
StringAssert.Contains("material_grey_50",designerContents,$"{designerFile} should contain Resources.Color.material_grey_50");
1208
+
StringAssert.Contains("main_text_item_size",designerContents,$"{designerFile} should contain Resources.Dimension.main_text_item_size");
1200
1209
StringAssert.Contains("theme_devicedefault_background",designerContents,$"{designerFile} should contain Resources.Color.theme_devicedefault_background");
1210
+
StringAssert.Contains("main_text_item_size",designerContents,$"{designerFile} should contain Resources.Dimension.main_text_item_size");
1201
1211
StringAssert.Contains("SomeColor",designerContents,$"{designerFile} should contain Resources.Color.SomeColor");
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Expected/GenerateDesignerFileExpected.cs
0 commit comments