diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets
index de356268f77..6719f0961be 100644
--- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets
+++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets
@@ -14,6 +14,16 @@ _ResolveAssemblies MSBuild target.
+
+
+
+ <_ProblematicRIDs Include="linux-arm;linux-arm64;linux-x86;linux-x64" />
+
+
+
+
+
$(_OuterOutputPath)
$(_OuterOutputPath)
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs
index 492df957658..d340b621ddd 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs
@@ -387,14 +387,16 @@ public void DotNetBuild (string runtimeIdentifiers, bool isRelease, bool aot)
var proj = new XASdkProject {
IsRelease = isRelease,
ExtraNuGetConfigSources = {
- "https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json"
+ // Microsoft.AspNetCore.Components.WebView is not in dotnet-public
+ "https://api.nuget.org/v3/index.json",
},
PackageReferences = {
- new Package { Id = "Xamarin.AndroidX.AppCompat", Version = "1.2.0.7-net6preview01" },
- new Package { Id = "Microsoft.AspNetCore.Components.WebView", Version = "6.0.0-preview.5.21301.17" },
- new Package { Id = "Microsoft.Extensions.FileProviders.Embedded", Version = "6.0.0-preview.6.21306.3" },
- new Package { Id = "Microsoft.JSInterop", Version = "6.0.0-preview.6.21306.3" },
- new Package { Id = "System.Text.Json", Version = "6.0.0-preview.7.21323.3" },
+ new Package { Id = "Xamarin.AndroidX.AppCompat", Version = "1.3.1.1" },
+ // Using * here, so we explicitly get newer packages
+ new Package { Id = "Microsoft.AspNetCore.Components.WebView", Version = "6.0.0-*" },
+ new Package { Id = "Microsoft.Extensions.FileProviders.Embedded", Version = "6.0.0-*" },
+ new Package { Id = "Microsoft.JSInterop", Version = "6.0.0-*" },
+ new Package { Id = "System.Text.Json", Version = "6.0.0-*" },
},
Sources = {
new BuildItem ("EmbeddedResource", "Foo.resx") {
@@ -637,14 +639,14 @@ public void MauiTargetFramework ([Values ("net6.0-android", "net6.0-android30",
var library = new XASdkProject (outputType: "Library") {
TargetFramework = targetFramework,
};
- library.ExtraNuGetConfigSources.Add ("https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json");
library.Sources.Clear ();
library.Sources.Add (new BuildItem.Source ("Foo.cs") {
TextContent = () =>
-@"using Microsoft.Maui;
-using Microsoft.Maui.Handlers;
+@"public abstract partial class ViewHandler { }
-public abstract class Foo : AbstractViewHandler
+public interface IView { }
+
+public abstract class Foo : ViewHandler
where TVirtualView : class, IView
#if ANDROID
where TNativeView : Android.Views.View
@@ -652,17 +654,9 @@ public abstract class Foo : AbstractViewHandler c.Name.LocalName.ToLowerInvariant () == "add"
&& c.Attributes ().Any (a => a.Name.LocalName.ToLowerInvariant () == "key" && a.Value.ToLowerInvariant () == "globalpackagesfolder"));
if (gpfElement != default (XElement)) {
@@ -442,18 +439,37 @@ public void CopyNuGetConfig (string relativeDirectory)
doc.Root.Add (configParentElement);
}
}
- doc.Save (projNugetConfig);
}
+
+ doc.Save (projNugetConfig);
}
}
///
/// Updates a NuGet.config based on sources in ExtraNuGetConfigSources
+ /// Removes the dotnet6 source, which should not be needed by tests
///
protected void AddNuGetConfigSources (XDocument doc)
{
+ const string elementName = "packageSources";
+ XElement pkgSourcesElement = doc.Root.Elements ().FirstOrDefault (d => string.Equals (d.Name.LocalName, elementName, StringComparison.OrdinalIgnoreCase));
+ if (pkgSourcesElement == null) {
+ doc.Root.Add (pkgSourcesElement= new XElement (elementName));
+ }
+
+ // Remove dotnet6 feed
+ foreach (XElement element in pkgSourcesElement.Elements ()) {
+ XAttribute value = element.Attribute ("value");
+ if (value != null && value.Value == "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json") {
+ element.Remove ();
+ break;
+ }
+ }
+
+ // Add extra sources
+ if (ExtraNuGetConfigSources == null)
+ return;
int sourceIndex = 0;
- XElement pkgSourcesElement = doc.Descendants ().FirstOrDefault (d => d.Name.LocalName.ToLowerInvariant () == "packagesources");
foreach (var source in ExtraNuGetConfigSources) {
var sourceElement = new XElement ("add");
sourceElement.SetAttributeValue ("key", $"testsource{++sourceIndex}");