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
The `AndroidUpdateResourcesTest.CheckFilesAreRemoved` test was failing
with:
Resources\values\Theme.xml error XA2001: Source file 'Resources\values\Theme.xml' could not be found.
When looking through logs, I noticed lots of differences in build
ordering from legacy projects.
1. `$(BuildDependsOn)` ordering - In legacy projects
`ImplicitlyExpandDesignTimeFacades` is listed last, while it was in
the middle for .NET 5+ projects.
This was caused by the ordering of `<Import/>`.
`Microsoft.Android.Sdk.BuildOrder.targets` needs to be imported before
`Xamarin.Android.Common.targets`.
2. `$(BuildDependsOn)` also listed these targets in legacy projects:
_CheckTargetFramework;
_RemoveLegacyDesigner;
`_CheckTargetFramework` is not needed, but it needs to be moved to
`Xamarin.Android.Legacy.targets`.
`_RemoveLegacyDesigner` should be listed in `$(BuildDependsOn)`.
3. `_UpdateAndroidResources` had different values for `DependsOnTargets`.
In c87ef95, I removed `$(CoreResolveReferencesDependsOn)` to just
simplify things. It turns out `_UpdateAndroidResources` uses this
property. I put things back the way they were.
After fixing the build ordering, the test still failed.
Then I noticed the *actual* cause to the failing test... There were
additional `@(AndroidResource)` items in the `.csproj` file.
`BuildItem.Deleted` wasn't being checked when short-form `.csproj`
files are generated. We should omit build items with this flag set.
After doing this, we can run a couple additional tests under `dotnet`
context.
Assert.IsTrue(text.Count(x =>x.Contains("Library1.Resource.String.library_name"))==2,"library_name resource should be present exactly once for each library");
52
65
Assert.IsTrue(text.Count(x =>x=="extern alias Lib1A;"||x=="extern alias Lib1B;")<=1,"No more than one extern alias should be present for each library.");
53
66
}
@@ -799,6 +812,7 @@ public void CheckAaptErrorRaisedForDuplicateResourceinApp ()
799
812
}
800
813
801
814
[Test]
815
+
[Category("dotnet")]
802
816
publicvoidCheckFilesAreRemoved(){
803
817
804
818
varproj=newXamarinAndroidApplicationProject(){
@@ -818,9 +832,9 @@ public void CheckFilesAreRemoved () {
Assert.IsTrue(appBuilder.Build(appProj),"Application Build should have succeeded.");
887
900
Assert.IsFalse(appBuilder.Output.IsTargetSkipped("_UpdateAndroidResgen"),"_UpdateAndroidResgen target not should be skipped.");
888
901
foo.Timestamp=DateTimeOffset.UtcNow;
@@ -912,8 +925,9 @@ public string GetFoo () {
912
925
Assert.IsFalse(libBuilder.Output.IsTargetSkipped("_CreateManagedLibraryResourceArchive"),"_CreateManagedLibraryResourceArchive should not be skipped.");
913
926
appBuilder.BuildLogFile="build2.log";
914
927
Assert.IsTrue(appBuilder.Build(appProj,doNotCleanupOnUpdate:true,saveProject:false),"Application Build should have succeeded.");
<WarningCode="XA0109"Text="Unsupported or invalid %24(TargetFrameworkVersion) value of 'v4.5'. Please update your Project Options."Condition=" '$(TargetFrameworkVersion)' == 'v4.5' "/>
<WarningCode="XA0109"Text="Unsupported or invalid %24(TargetFrameworkVersion) value of 'v4.5'. Please update your Project Options."Condition=" '$(TargetFrameworkVersion)' == 'v4.5' "/>
0 commit comments