diff --git a/src/Core/src/nuget/buildTransitive/WinUI.targets b/src/Core/src/nuget/buildTransitive/WinUI.targets index 84feb7671501..1c4737fc300f 100644 --- a/src/Core/src/nuget/buildTransitive/WinUI.targets +++ b/src/Core/src/nuget/buildTransitive/WinUI.targets @@ -18,14 +18,6 @@ - - - + + + <_ProjectArchitectureOutput>Invalid + <_ProjectArchitectureOutput Condition="'$(Platform)' == 'x86'">x86 + <_ProjectArchitectureOutput Condition="'$(Platform)' == 'Win32'">x86 + <_ProjectArchitectureOutput Condition="'$(Platform)' == 'x64'">x64 + <_ProjectArchitectureOutput Condition="'$(Platform)' == 'arm'">arm + <_ProjectArchitectureOutput Condition="'$(Platform)' == 'arm64'">arm64 + + + <_ProjectArchitectureOutput>neutral + <_ProjectArchitectureOutput Condition="'$(RuntimeIdentifier)' == 'win10-x86' or '$(RuntimeIdentifier)' == 'win-x86'">x86 + <_ProjectArchitectureOutput Condition="'$(RuntimeIdentifier)' == 'win10-x64' or '$(RuntimeIdentifier)' == 'win-x64'">x64 + <_ProjectArchitectureOutput Condition="'$(RuntimeIdentifier)' == 'win10-arm' or '$(RuntimeIdentifier)' == 'win-arm'">arm + <_ProjectArchitectureOutput Condition="'$(RuntimeIdentifier)' == 'win10-arm64' or '$(RuntimeIdentifier)' == 'win-arm64'">arm64 + + + + + + + diff --git a/src/TestUtils/src/Microsoft.Maui.IntegrationTests/TemplateTests.cs b/src/TestUtils/src/Microsoft.Maui.IntegrationTests/TemplateTests.cs index 8c85dacda959..566cfa949d61 100644 --- a/src/TestUtils/src/Microsoft.Maui.IntegrationTests/TemplateTests.cs +++ b/src/TestUtils/src/Microsoft.Maui.IntegrationTests/TemplateTests.cs @@ -237,6 +237,37 @@ public void BuildWindowsAppSDKSelfContained(string id, bool wasdkself, bool nets $"Project {Path.GetFileName(projectFile)} failed to build. Check test output/attachments for errors."); } + [Test] + [TestCase("maui", true, "None")] + [TestCase("maui", true, "MSIX")] + [TestCase("maui", false, "None")] + [TestCase("maui", false, "MSIX")] + public void BuildWindowsRidGraph(string id, bool useridgraph, string packageType) + { + if (TestEnvironment.IsMacOS) + Assert.Ignore("This test is designed for testing a windows build."); + + var projectDir = TestDirectory; + var projectFile = Path.Combine(projectDir, $"{Path.GetFileName(projectDir)}.csproj"); + + Assert.IsTrue(DotnetInternal.New(id, projectDir, DotNetCurrent), + $"Unable to create template {id}. Check test output for errors."); + + FileUtilities.ReplaceInFile(projectFile, + "true", + $""" + true + {useridgraph} + {packageType} + """); + + var extendedBuildProps = BuildProps; + extendedBuildProps.Add($"TargetFramework={DotNetCurrent}-windows10.0.19041.0"); + + Assert.IsTrue(DotnetInternal.Build(projectFile, "Release", properties: extendedBuildProps, msbuildWarningsAsErrors: true), + $"Project {Path.GetFileName(projectFile)} failed to build. Check test output/attachments for errors."); + } + [Test] [TestCase("maui", $"{DotNetCurrent}-ios", "ios-arm64")] public void PublishNativeAOT(string id, string framework, string runtimeIdentifier) diff --git a/src/Workload/Microsoft.Maui.Sdk/Sdk/Microsoft.Maui.Sdk.Before.targets b/src/Workload/Microsoft.Maui.Sdk/Sdk/Microsoft.Maui.Sdk.Before.targets index f82e928dc619..540f8d1b0b47 100644 --- a/src/Workload/Microsoft.Maui.Sdk/Sdk/Microsoft.Maui.Sdk.Before.targets +++ b/src/Workload/Microsoft.Maui.Sdk/Sdk/Microsoft.Maui.Sdk.Before.targets @@ -6,7 +6,7 @@ true - true + true @@ -17,7 +17,8 @@ <_SingleProjectHostArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture) <_SingleProjectHostArchitecture>$(_SingleProjectHostArchitecture.ToLower()) - win10-$(_SingleProjectHostArchitecture) + win10-$(_SingleProjectHostArchitecture) + win-$(_SingleProjectHostArchitecture) <_MauiUsingDefaultRuntimeIdentifier>true