From ddff8d7a638b6e7110adf6ec3213fe8e56896305 Mon Sep 17 00:00:00 2001 From: Alexandre Zollinger Chohfi Date: Tue, 25 Jun 2024 10:45:34 -0700 Subject: [PATCH 1/2] Fix MAUI packaging. --- MSStore.CLI/ProjectConfigurators/MauiProjectConfigurator.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MSStore.CLI/ProjectConfigurators/MauiProjectConfigurator.cs b/MSStore.CLI/ProjectConfigurators/MauiProjectConfigurator.cs index 38e5906..6a90fc2 100644 --- a/MSStore.CLI/ProjectConfigurators/MauiProjectConfigurator.cs +++ b/MSStore.CLI/ProjectConfigurators/MauiProjectConfigurator.cs @@ -250,8 +250,7 @@ await AnsiConsole.Status().StartAsync("Restoring packages...", async ctx => { var runtime = $"win10-{appxBundlePlatform.ToLowerInvariant()}"; - // Maybe switch AppxPackageTestDir to bin\Release\{targetFramework}\{runtime}\AppPackages\? - msBuildParamsList.Add($"publish -f {properties.WindowsTargetFramework} -r {runtime} --self-contained /p:Configuration=Release;AppxBundle=Always;Platform={appxBundlePlatform};AppxBundlePlatforms={appxBundlePlatform};AppxPackageDir={escapedOutput}\\;UapAppxPackageBuildMode=StoreUpload;GenerateAppxPackageOnBuild=true;AppxPackageTestDir={escapedOutput}\\{projectName}_{version.ToVersionString()}_{appxBundlePlatform}_Test\\"); + msBuildParamsList.Add($"publish -f {properties.WindowsTargetFramework} --self-contained -c Release -p:AppxBundle=Always -p:AppxBundlePlatforms={appxBundlePlatform} -p:AppxPackageDir={escapedOutput}\\ -p:UapAppxPackageBuildMode=StoreUpload -p:AppxPackageTestDir={escapedOutput}\\{projectName}_{version.ToVersionString()}_{appxBundlePlatform}_Test\\ -p:RuntimeIdentifierOverride={runtime}"); } ExternalCommandExecutionResult? result = null; From 9b766e01fb811f33d340209e92c40bed35d893b3 Mon Sep 17 00:00:00 2001 From: Alexandre Zollinger Chohfi Date: Tue, 25 Jun 2024 11:05:40 -0700 Subject: [PATCH 2/2] Fix tests. --- MSStore.CLI.UnitTests/PackageCommandUnitTests.cs | 6 +++--- MSStore.CLI/ProjectConfigurators/MauiProjectConfigurator.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MSStore.CLI.UnitTests/PackageCommandUnitTests.cs b/MSStore.CLI.UnitTests/PackageCommandUnitTests.cs index 03115fd..7cd4579 100644 --- a/MSStore.CLI.UnitTests/PackageCommandUnitTests.cs +++ b/MSStore.CLI.UnitTests/PackageCommandUnitTests.cs @@ -263,7 +263,7 @@ public async Task PackageCommandForMauiAppsShouldCallMSBuildIfWindows() ExternalCommandExecutor .Setup(x => x.RunAsync( It.Is(s => s == "dotnet"), - It.Is(s => s.Contains("publish -f net8.0-windows10.0.19041.0 -r win10-x64 --self-contained /p:Configuration=Release")), + It.Is(s => s.Contains("publish -f net8.0-windows10.0.19041.0 -p:RuntimeIdentifierOverride=win10-x64 --self-contained -c Release")), It.Is(s => s == dirInfo.FullName), It.IsAny())) .ReturnsAsync(new Services.ExternalCommandExecutionResult @@ -305,8 +305,8 @@ public async Task PackageCommandForMauiAppsShouldCallMSBuildWithOutputParameterI ExternalCommandExecutor .Setup(x => x.RunAsync( It.Is(s => s == "dotnet"), - It.Is(s => s.Contains("publish -f net8.0-windows10.0.19041.0 -r win10-x64 --self-contained /p:Configuration=Release") - && s.Contains($"AppxPackageDir={customPath}\\;") + It.Is(s => s.Contains("publish -f net8.0-windows10.0.19041.0 -p:RuntimeIdentifierOverride=win10-x64 --self-contained -c Release") + && s.Contains($"AppxPackageDir={customPath}\\") && s.EndsWith($"AppxPackageTestDir={customPath}\\MauiProject_1.0.0.0_X64_Test\\")), It.Is(s => s == dirInfo.FullName), It.IsAny())) diff --git a/MSStore.CLI/ProjectConfigurators/MauiProjectConfigurator.cs b/MSStore.CLI/ProjectConfigurators/MauiProjectConfigurator.cs index 6a90fc2..c461457 100644 --- a/MSStore.CLI/ProjectConfigurators/MauiProjectConfigurator.cs +++ b/MSStore.CLI/ProjectConfigurators/MauiProjectConfigurator.cs @@ -250,7 +250,7 @@ await AnsiConsole.Status().StartAsync("Restoring packages...", async ctx => { var runtime = $"win10-{appxBundlePlatform.ToLowerInvariant()}"; - msBuildParamsList.Add($"publish -f {properties.WindowsTargetFramework} --self-contained -c Release -p:AppxBundle=Always -p:AppxBundlePlatforms={appxBundlePlatform} -p:AppxPackageDir={escapedOutput}\\ -p:UapAppxPackageBuildMode=StoreUpload -p:AppxPackageTestDir={escapedOutput}\\{projectName}_{version.ToVersionString()}_{appxBundlePlatform}_Test\\ -p:RuntimeIdentifierOverride={runtime}"); + msBuildParamsList.Add($"publish -f {properties.WindowsTargetFramework} -p:RuntimeIdentifierOverride={runtime} --self-contained -c Release -p:AppxBundle=Always -p:AppxBundlePlatforms={appxBundlePlatform} -p:AppxPackageDir={escapedOutput}\\ -p:UapAppxPackageBuildMode=StoreUpload -p:AppxPackageTestDir={escapedOutput}\\{projectName}_{version.ToVersionString()}_{appxBundlePlatform}_Test\\"); } ExternalCommandExecutionResult? result = null;