diff --git a/build-tools/create-packs/ConfigureLocalWorkload.targets b/build-tools/create-packs/ConfigureLocalWorkload.targets index 14933f0f82d..6da3f32be4e 100644 --- a/build-tools/create-packs/ConfigureLocalWorkload.targets +++ b/build-tools/create-packs/ConfigureLocalWorkload.targets @@ -16,14 +16,16 @@ <_RuntimeListOutputs Include="$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.%(AndroidAbiAndRuntimeFlavor.AndroidRuntime).$(AndroidDefaultTargetDotnetApiLevel).%(AndroidAbiAndRuntimeFlavor.AndroidRID)\$(AndroidPackVersion)\data\RuntimeList.xml" AndroidRID="%(AndroidAbiAndRuntimeFlavor.AndroidRID)" AndroidRuntime="%(AndroidAbiAndRuntimeFlavor.AndroidRuntime)" /> <_RuntimeListOutputs Include="$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.%(AndroidAbiAndRuntimeFlavor.AndroidRuntime).$(AndroidLatestStableApiLevel).%(AndroidAbiAndRuntimeFlavor.AndroidRID)\$(AndroidPackVersion)\data\RuntimeList.xml" AndroidRID="%(AndroidAbiAndRuntimeFlavor.AndroidRID)" AndroidRuntime="%(AndroidAbiAndRuntimeFlavor.AndroidRuntime)" /> <_RuntimeListOutputs Include="$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.%(AndroidAbiAndRuntimeFlavor.AndroidRuntime).$(AndroidLatestUnstableApiLevel).%(AndroidAbiAndRuntimeFlavor.AndroidRID)\$(AndroidPackVersion)\data\RuntimeList.xml" AndroidRID="%(AndroidAbiAndRuntimeFlavor.AndroidRID)" AndroidRuntime="%(AndroidAbiAndRuntimeFlavor.AndroidRuntime)" /> + <_ManagedRuntimeListOutputs Include="$(BuildOutputDirectory)lib\packs\Microsoft.Android.Runtime.$(AndroidApiLevel).android\$(AndroidPackVersion)\data\RuntimeList.xml" /> + Outputs="@(_RuntimeListOutputs);@(_ManagedRuntimeListOutputs)"> + + + + diff --git a/build-tools/create-packs/Microsoft.Android.Runtime.Managed.proj b/build-tools/create-packs/Microsoft.Android.Runtime.Managed.proj new file mode 100644 index 00000000000..eee0cc6a692 --- /dev/null +++ b/build-tools/create-packs/Microsoft.Android.Runtime.Managed.proj @@ -0,0 +1,63 @@ + + + + + + + netstandard2.0 + android + $(AndroidRID) + Microsoft.Android.Runtime.$(AndroidApiLevel).$(AndroidRID) + $(PackageId) + RuntimePack + Microsoft.Android managed runtime components for API $(AndroidApiLevel). Please do not reference directly. + <_AndroidRuntimePackAssemblyPath>runtimes/$(AndroidRID)/lib/$(DotNetTargetFramework) + <_AndroidRuntimePackNativePath>runtimes/$(AndroidRID)/native + + + + + _GetDefaultPackageVersion; + $(BeforePack); + + + + + + + $(DotNetTargetFramework) + + + + + + <_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETDefaultOutDir)Java.Interop.dll" /> + <_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETDefaultOutDir)Mono.Android.dll" /> + <_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETDefaultOutDir)Mono.Android.Runtime.dll" /> + + <_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETOutputRoot)$(AndroidLatestStableApiLevel)\Mono.Android.Export.dll" /> + <_AndroidRuntimePackAssemblies + Include="$(_MonoAndroidNETOutputRoot)$(AndroidLatestStableApiLevel)\System.IO.Hashing.dll" + NoSymbols="true" + /> + + + + + + + + + + diff --git a/build-tools/create-packs/Microsoft.Android.Runtime.proj b/build-tools/create-packs/Microsoft.Android.Runtime.proj index 155cf90fd37..e279b7f1563 100644 --- a/build-tools/create-packs/Microsoft.Android.Runtime.proj +++ b/build-tools/create-packs/Microsoft.Android.Runtime.proj @@ -4,7 +4,7 @@ Microsoft.Android.Runtime.proj This project file is used to create Microsoft.Android.Runtime.[Mono|NativeAOT|etc.].[API].[RID] NuGets, which are runtime packs that contain the assets required for a self-contained publish of -projects that use the Microsoft.Android framework in .NET 6+. +projects that use the Microsoft.Android.Runtimes framework in .NET 6+. *********************************************************************************************** --> @@ -19,6 +19,8 @@ projects that use the Microsoft.Android framework in .NET 6+. Microsoft.Android.Runtime.$(AndroidRuntime).$(AndroidApiLevel).$(AndroidRID) $(PackageId) RuntimePack + Microsoft.Android.Runtimes + .NET $(DotNetTargetFrameworkVersion) - $(SharedFrameworkName) Microsoft.Android runtime components for API $(AndroidApiLevel). Please do not reference directly. <_AndroidRuntimePackAssemblyPath>runtimes/$(AndroidRID)/lib/$(DotNetTargetFramework) <_AndroidRuntimePackNativePath>runtimes/$(AndroidRID)/native @@ -47,22 +49,6 @@ projects that use the Microsoft.Android framework in .NET 6+. <_RuntimeFlavorDirName Condition=" '$(AndroidRuntime)' == 'Mono' Or '$(AndroidRuntime)' == '' ">mono - - <_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETDefaultOutDir)Java.Interop.dll" /> - <_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETDefaultOutDir)Mono.Android.dll" /> - <_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETDefaultOutDir)Mono.Android.Runtime.dll" /> - - <_AndroidRuntimePackAssemblies - Include="$(_MonoAndroidNETOutputRoot)$(AndroidLatestStableApiLevel)\Microsoft.Android.Runtime.NativeAOT.dll" - Condition=" '$(AndroidRuntime)' == 'NativeAOT' " - /> - <_AndroidRuntimePackAssemblies - Include="$(_MonoAndroidNETOutputRoot)$(AndroidLatestStableApiLevel)\System.IO.Hashing.dll" - NoSymbols="true" - /> - <_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETOutputRoot)$(AndroidLatestStableApiLevel)\Mono.Android.Export.dll" /> - - @@ -86,6 +72,10 @@ projects that use the Microsoft.Android framework in .NET 6+. + + <_AndroidRuntimePackAssemblies Include="$(_MonoAndroidNETOutputRoot)$(AndroidLatestStableApiLevel)\Microsoft.Android.Runtime.NativeAOT.dll" /> + + diff --git a/src/Microsoft.Android.Runtime.NativeAOT/Microsoft.Android.Runtime.NativeAOT.csproj b/src/Microsoft.Android.Runtime.NativeAOT/Microsoft.Android.Runtime.NativeAOT.csproj index 3de6e147a17..44ab97c6194 100644 --- a/src/Microsoft.Android.Runtime.NativeAOT/Microsoft.Android.Runtime.NativeAOT.csproj +++ b/src/Microsoft.Android.Runtime.NativeAOT/Microsoft.Android.Runtime.NativeAOT.csproj @@ -39,7 +39,6 @@ <_RuntimePackFiles Include="$(OutputPath)Microsoft.Android.Runtime.NativeAOT.dll" AndroidRID="%(AndroidAbiAndRuntimeFlavor.AndroidRID)" AndroidRuntime="%(AndroidAbiAndRuntimeFlavor.AndroidRuntime)" /> - - - <_RuntimePackFiles Include="$(OutputPath)Mono.Android.Export.dll" AndroidRID="%(AndroidAbiAndRuntimeFlavor.AndroidRID)" AndroidRuntime="%(AndroidAbiAndRuntimeFlavor.AndroidRuntime)" /> - - diff --git a/src/Mono.Android.Runtime/Mono.Android.Runtime.targets b/src/Mono.Android.Runtime/Mono.Android.Runtime.targets index 9ab9e293f02..b96c611d639 100644 --- a/src/Mono.Android.Runtime/Mono.Android.Runtime.targets +++ b/src/Mono.Android.Runtime/Mono.Android.Runtime.targets @@ -23,18 +23,14 @@ - - <_RuntimePackFiles Include="$(OutputPath)Mono.Android.Runtime.dll" AndroidRID="%(AndroidAbiAndRuntimeFlavor.AndroidRID)" AndroidRuntime="%(AndroidAbiAndRuntimeFlavor.AndroidRuntime)" /> - - diff --git a/src/Mono.Android/Mono.Android.csproj b/src/Mono.Android/Mono.Android.csproj index 3468c64a5d5..ec9eff97c93 100644 --- a/src/Mono.Android/Mono.Android.csproj +++ b/src/Mono.Android/Mono.Android.csproj @@ -420,7 +420,6 @@ <_SourceFiles Include="$(OutputPath)Mono.Android.*" /> <_SourceFiles Include="$(OutputPath)Java.Interop.*" /> <_SourceFiles Include="$(OutputPath)System.IO.Hashing.dll" /> - <_RuntimePackFiles Include="@(_SourceFiles)" AndroidRID="%(AndroidAbiAndRuntimeFlavor.AndroidRID)" AndroidRuntime="%(AndroidAbiAndRuntimeFlavor.AndroidRuntime)" /> + + diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json index 5f9e689ad17..798288ae646 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json @@ -7,10 +7,15 @@ "Microsoft.Android.Sdk.net10", "Microsoft.Android.Sdk.net9", "Microsoft.Android.Ref.36", + "Microsoft.Android.Runtime.36.android", "Microsoft.Android.Runtime.Mono.36.android-arm", "Microsoft.Android.Runtime.Mono.36.android-arm64", "Microsoft.Android.Runtime.Mono.36.android-x86", "Microsoft.Android.Runtime.Mono.36.android-x64", + "Microsoft.Android.Runtime.CoreCLR.36.android-arm64", + "Microsoft.Android.Runtime.CoreCLR.36.android-x64", + "Microsoft.Android.Runtime.NativeAOT.36.android-arm64", + "Microsoft.Android.Runtime.NativeAOT.36.android-x64", "Microsoft.Android.Templates" ], "platforms": [ "win-x64", "win-arm64", "linux-x64", "linux-arm64", "osx-x64", "osx-arm64" ], @@ -76,6 +81,10 @@ "kind": "framework", "version": "@WORKLOAD_VERSION@" }, + "Microsoft.Android.Runtime.36.android": { + "kind": "framework", + "version": "@WORKLOAD_VERSION@" + }, "Microsoft.Android.Runtime.Mono.36.android-arm": { "kind": "framework", "version": "@WORKLOAD_VERSION@" diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs index 7083193406d..8a3111c0991 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs @@ -111,10 +111,6 @@ public void BasicApplicationBuildCoreCLR ([Values (true, false)] bool isRelease) { var proj = new XamarinAndroidApplicationProject { IsRelease = isRelease, - // Add locally downloaded CoreCLR packs - ExtraNuGetConfigSources = { - Path.Combine (XABuildPaths.BuildOutputDirectory, "nuget-unsigned"), - } }; proj.SetProperty ("UseMonoRuntime", "false"); // Enables CoreCLR var b = CreateApkBuilder (); @@ -146,10 +142,6 @@ public void BasicApplicationPublishReadyToRun (bool isComposite, string rid) { var proj = new XamarinAndroidApplicationProject { IsRelease = true, - // Add locally downloaded CoreCLR packs - ExtraNuGetConfigSources = { - Path.Combine (XABuildPaths.BuildOutputDirectory, "nuget-unsigned"), - } }; proj.SetProperty ("RuntimeIdentifier", rid); 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 20e919022ee..a59dd7ab355 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 @@ -252,8 +252,8 @@ public void DotNetPublish ([Values (false, true)] bool isRelease, [ValueSource(n // TODO: We could parameterize this later const string runtime = "Mono"; var runtimeApiLevel = (apiLevel == XABuildConfig.AndroidDefaultTargetDotnetApiLevel && apiLevel < XABuildConfig.AndroidLatestStableApiLevel) ? XABuildConfig.AndroidLatestStableApiLevel : apiLevel; - var runtimeDirectory = Directory.GetDirectories (Path.Combine (TestEnvironment.DotNetPreviewPacksDirectory, $"Microsoft.Android.Runtime.{runtime}.{runtimeApiLevel}.{runtimeIdentifier}")).LastOrDefault (); - var expectedMonoAndroidRuntimePath = Path.Combine (runtimeDirectory, "runtimes", runtimeIdentifier, "lib", dotnetVersion, "Mono.Android.dll"); + var runtimeDirectory = Directory.GetDirectories (Path.Combine (TestEnvironment.DotNetPreviewPacksDirectory, $"Microsoft.Android.Runtime.{runtimeApiLevel}.android")).LastOrDefault (); + var expectedMonoAndroidRuntimePath = Path.Combine (runtimeDirectory, "runtimes", "android", "lib", dotnetVersion, "Mono.Android.dll"); Assert.IsTrue (dotnet.LastBuildOutput.ContainsText (expectedMonoAndroidRuntimePath), $"Build should be using {expectedMonoAndroidRuntimePath}"); } diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/XamarinAndroidApplicationProject.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/XamarinAndroidApplicationProject.cs index a2112ab413c..5213062dd21 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/XamarinAndroidApplicationProject.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/XamarinAndroidApplicationProject.cs @@ -180,15 +180,6 @@ public void SetPublishAot (bool value, string androidNdkPath) IsRelease = true; PublishAot = value; SetProperty ("AndroidNdkDirectory", androidNdkPath); - - // NuGet feed needed as Microsoft.Android.Runtime.NativeAOT packs not installed in workload by default - var source = Path.Combine (XABuildPaths.BuildOutputDirectory, "nuget-unsigned"); - if (value) { - if (!ExtraNuGetConfigSources.Contains (source)) - ExtraNuGetConfigSources.Add (source); - } else { - ExtraNuGetConfigSources.Remove (source); - } } public string AndroidManifest { get; set; }