From 548d868cae095fd4f6037f856d15ca46c45743f3 Mon Sep 17 00:00:00 2001 From: Darshak Bhatti <47045043+dabhattimsft@users.noreply.github.com> Date: Thu, 9 May 2024 16:59:07 -0700 Subject: [PATCH] Move back to non-WAP solution and fix package size increase caused by bringing PowerToys utilities (#2844) * Remove WAP * sign script * pr feedback --------- Co-authored-by: Nick Eubanks Co-authored-by: Darshak Bhatti --- .github/workflows/DevHome-CI.yml | 2 +- Build.ps1 | 14 +-- DevHome.sln | 20 --- Packaging/Packaging.wapproj | 119 ------------------ Test.ps1 | 2 +- build/azure-pipelines.yml | 6 +- .../BuildDevSetupAgentHelper.ps1 | 1 - extensionsdk/BuildSDKHelper.ps1 | 1 - src/DevHome.csproj | 2 +- {Packaging => src}/Package.appinstaller | 0 {Packaging => src}/Package.appxmanifest | 33 ++--- ...upFlow.ElevatedComponent.Projection.csproj | 7 +- .../HostsFileEditorSettingsWindow.xaml.cs | 2 +- .../RegistryPreviewMainWindow.xaml.cs | 2 +- .../ViewModels/UtilitiesMainPageViewModel.cs | 6 +- 15 files changed, 26 insertions(+), 191 deletions(-) delete mode 100644 Packaging/Packaging.wapproj rename {Packaging => src}/Package.appinstaller (100%) rename {Packaging => src}/Package.appxmanifest (90%) diff --git a/.github/workflows/DevHome-CI.yml b/.github/workflows/DevHome-CI.yml index 32679beddb..3bc86b7f1c 100644 --- a/.github/workflows/DevHome-CI.yml +++ b/.github/workflows/DevHome-CI.yml @@ -84,7 +84,7 @@ jobs: run: Compress-Archive -Force -Path extensions\HyperVExtension\src\DevSetupAgent\bin\arm64\${{ matrix.configuration }}\net8.0-windows10.0.22621.0\win-arm64\* -DestinationPath "extensions\HyperVExtension\src\DevSetupAgent\bin\arm64\${{ matrix.configuration }}\DevSetupAgent_arm64.zip" - name: Build_DevHome - run: cmd /c "$env:VSDevCmd" "&" msbuild /p:Configuration=${{ matrix.configuration }},Platform=${{ matrix.platform }} /m:1 DevHome.sln + run: cmd /c "$env:VSDevCmd" "&" msbuild /p:Configuration=${{ matrix.configuration }},Platform=${{ matrix.platform }} DevHome.sln - name: Find vstest.console.exe if: ${{ matrix.platform != 'arm64' }} diff --git a/Build.ps1 b/Build.ps1 index 127d59c1a1..5e7ca5eb83 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -128,7 +128,7 @@ Try { $uapAppExtension = [System.Xml.Linq.XName]::Get("{http://schemas.microsoft.com/appx/manifest/uap/windows10/3}AppExtension"); # Update the appxmanifest - $appxmanifestPath = (Join-Path $env:Build_RootDirectory "Packaging\Package.appxmanifest") + $appxmanifestPath = (Join-Path $env:Build_RootDirectory "src\Package.appxmanifest") $appxmanifest = [System.Xml.Linq.XDocument]::Load($appxmanifestPath) $appxmanifest.Root.Element($xIdentity).Attribute("Version").Value = $env:msix_version if (-not ([string]::IsNullOrEmpty($newPackageName))) { @@ -169,11 +169,7 @@ Try { ("/p:Configuration="+$configuration), ("/restore"), ("/binaryLogger:DevHome.$platform.$configuration.binlog"), - ("/p:AppxBundle=Never"), - ("/p:AppxPackageName=DevHome-$platform"), - ("/p:AppxBundlePlatforms="+$platform), - ("/p:AppxPackageDir=" + $appxPackageDir), - ("/p:AppxPackageTestDir=" + (Join-Path $appxPackageDir "DevHome\")), + ("/p:AppxPackageOutput=$appxPackageDir\DevHome-$platform.msix"), ("/p:AppxPackageSigningEnabled=false"), ("/p:GenerateAppxPackageOnBuild=true"), ("/p:BuildRing=$buildRing") @@ -188,7 +184,7 @@ Try { & $msbuildPath $msbuildArgs if (-not($IsAzurePipelineBuild) -And $isAdmin) { - Invoke-SignPackage "$appxPackageDir\DevHome\DevHome-$platform.msix" + Invoke-SignPackage "$appxPackageDir\DevHome-$platform.msix" } } } @@ -241,7 +237,7 @@ Try { if (($BuildStep -ieq "all") -Or ($BuildStep -ieq "msixbundle")) { foreach ($configuration in $env:Build_Configuration.Split(",")) { - .\build\scripts\Create-AppxBundle.ps1 -InputPath (Join-Path $env:Build_RootDirectory "AppxPackages\$configuration\DevHome") -ProjectName DevHome -BundleVersion ([version]$env:msix_version) -OutputPath (Join-Path $env:Build_RootDirectory ("AppxBundles\$configuration\DevHome_" + $env:msix_version + "_8wekyb3d8bbwe.msixbundle")) + .\build\scripts\Create-AppxBundle.ps1 -InputPath (Join-Path $env:Build_RootDirectory "AppxPackages\$configuration") -ProjectName DevHome -BundleVersion ([version]$env:msix_version) -OutputPath (Join-Path $env:Build_RootDirectory ("AppxBundles\$configuration\DevHome_" + $env:msix_version + "_8wekyb3d8bbwe.msixbundle")) if (-not($IsAzurePipelineBuild) -And $isAdmin) { Invoke-SignPackage ("AppxBundles\$configuration\DevHome_" + $env:msix_version + "_8wekyb3d8bbwe.msixbundle") } @@ -265,7 +261,7 @@ WARNING: Cert signing requires admin privileges. To sign, run the following in "@ -ForegroundColor GREEN foreach ($platform in $env:Build_Platform.Split(",")) { foreach ($configuration in $env:Build_Configuration.Split(",")) { - $appxPackageFile = (Join-Path $env:Build_RootDirectory ("AppxPackages\$configuration\DevHome\DevHome-$platform.msix")) + $appxPackageFile = (Join-Path $env:Build_RootDirectory "AppxPackages\$configuration\DevHome-$platform.msix") Write-Host @" powershell -command "& { . build\scripts\CertSignAndInstall.ps1; Invoke-SignPackage $appxPackageFile }" "@ -ForegroundColor GREEN diff --git a/DevHome.sln b/DevHome.sln index d6696dd943..dac61696af 100644 --- a/DevHome.sln +++ b/DevHome.sln @@ -11,8 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Solution.props = Solution.props EndProjectSection EndProject -Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "Packaging", "Packaging\Packaging.wapproj", "{05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome", "src\DevHome.csproj", "{60E0FD98-5396-436D-BAB7-187A853A5DC6}" ProjectSection(ProjectDependencies) = postProject {0689521A-1686-46DB-81E1-3B84AA0EF1AC} = {0689521A-1686-46DB-81E1-3B84AA0EF1AC} @@ -154,24 +152,6 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Debug|arm64.ActiveCfg = Debug|ARM64 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Debug|arm64.Build.0 = Debug|ARM64 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Debug|arm64.Deploy.0 = Debug|ARM64 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Debug|x64.ActiveCfg = Debug|x64 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Debug|x64.Build.0 = Debug|x64 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Debug|x64.Deploy.0 = Debug|x64 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Debug|x86.ActiveCfg = Debug|x86 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Debug|x86.Build.0 = Debug|x86 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Debug|x86.Deploy.0 = Debug|x86 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Release|arm64.ActiveCfg = Release|ARM64 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Release|arm64.Build.0 = Release|ARM64 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Release|arm64.Deploy.0 = Release|ARM64 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Release|x64.ActiveCfg = Release|x64 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Release|x64.Build.0 = Release|x64 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Release|x64.Deploy.0 = Release|x64 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Release|x86.ActiveCfg = Release|x86 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Release|x86.Build.0 = Release|x86 - {05D4C6E5-D33D-4C15-91FE-3DD2B6A5D61C}.Release|x86.Deploy.0 = Release|x86 {60E0FD98-5396-436D-BAB7-187A853A5DC6}.Debug|arm64.ActiveCfg = Debug|arm64 {60E0FD98-5396-436D-BAB7-187A853A5DC6}.Debug|arm64.Build.0 = Debug|arm64 {60E0FD98-5396-436D-BAB7-187A853A5DC6}.Debug|arm64.Deploy.0 = Debug|arm64 diff --git a/Packaging/Packaging.wapproj b/Packaging/Packaging.wapproj deleted file mode 100644 index 3ceb546e0a..0000000000 --- a/Packaging/Packaging.wapproj +++ /dev/null @@ -1,119 +0,0 @@ - - - - - 15.0 - - - - Debug - x86 - - - Release - x86 - - - Debug - x64 - - - Release - x64 - - - Debug - ARM - - - Release - ARM - - - Debug - ARM64 - - - Release - ARM64 - - - - $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\ - - - - 05d4c6e5-d33d-4c15-91fe-3dd2b6a5d61c - - 10.0.22621.0 - 10.0.19041.0 - en-US - True - $(NoWarn);NU1702 - ..\src\DevHome.csproj - False - SHA256 - False - True - x86|x64 - 0 - Dev - False - - - - 100 - - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Test.ps1 b/Test.ps1 index bc2a73b590..3964c17c2e 100644 --- a/Test.ps1 +++ b/Test.ps1 @@ -98,7 +98,7 @@ try { Remove-AppPackage -Package $DevHomePackage.PackageFullName } Write-Host "Installing Dev Home" - Add-AppPackage (Join-Path "AppxPackages" "$configuration\DevHome\DevHome-$platform.msix") + Add-AppPackage (Join-Path "AppxPackages" "$configuration\DevHome-$platform.msix") if ($true) { # Start/stop the app once so that WinAppDriver doesn't time out during first time setup diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 3c32fd295c..6d6f669bb1 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -225,7 +225,7 @@ extends: - task: EsrpCodeSigning@2 inputs: ConnectedServiceName: 'Xlang Code Signing' - FolderPath: '$(appxPackageDir)\${{ configuration }}\DevHome' + FolderPath: '$(appxPackageDir)\${{ configuration }}' Pattern: '*.msix' signConfigType: 'inlineSignParams' inlineOperation: | @@ -351,7 +351,7 @@ extends: - output: pipelineArtifact displayName: Publish MSIX Artifact artifactName: msix_${{ platform }}_${{ configuration }} - targetPath: $(appxPackageDir)\${{ configuration }}\DevHome + targetPath: $(appxPackageDir)\${{ configuration }} sbomPackageName: devhome.msixpackage sbomPackageVersion: $(MSIXVersion) @@ -367,7 +367,7 @@ extends: inputs: buildType: 'current' artifactName: msix_${{ platform }}_${{ configuration }} - targetPath: $(appxPackageDir)\${{ configuration }}\DevHome + targetPath: $(appxPackageDir)\${{ configuration }} - task: PowerShell@2 displayName: Create Stub Directory diff --git a/extensions/HyperVExtension/BuildDevSetupAgentHelper.ps1 b/extensions/HyperVExtension/BuildDevSetupAgentHelper.ps1 index 183df101a2..0fef8bda84 100644 --- a/extensions/HyperVExtension/BuildDevSetupAgentHelper.ps1 +++ b/extensions/HyperVExtension/BuildDevSetupAgentHelper.ps1 @@ -80,7 +80,6 @@ Try { $msbuildArgs = @( ("extensions\HyperVExtension\DevSetupAgent.sln"), - ("/m"), ("/p:Platform="+$platform), ("/p:Configuration="+$configuration), ("/restore"), diff --git a/extensionsdk/BuildSDKHelper.ps1 b/extensionsdk/BuildSDKHelper.ps1 index 9a0f134d6b..f5a5d66d81 100644 --- a/extensionsdk/BuildSDKHelper.ps1 +++ b/extensionsdk/BuildSDKHelper.ps1 @@ -59,7 +59,6 @@ Try { foreach ($config in $Configuration.Split(",")) { $msbuildArgs = @( ("$PSScriptRoot\DevHomeSDK.sln"), - ("/m"), ("/p:Platform="+$platform), ("/p:Configuration="+$config), ("/binaryLogger:DevHome.SDK.$platform.$config.binlog"), diff --git a/src/DevHome.csproj b/src/DevHome.csproj index 9a6992147b..2185386a5a 100644 --- a/src/DevHome.csproj +++ b/src/DevHome.csproj @@ -19,7 +19,7 @@ enable enable true - false + true true $(DefineConstants);DISABLE_XAML_GENERATED_MAIN diff --git a/Packaging/Package.appinstaller b/src/Package.appinstaller similarity index 100% rename from Packaging/Package.appinstaller rename to src/Package.appinstaller diff --git a/Packaging/Package.appxmanifest b/src/Package.appxmanifest similarity index 90% rename from Packaging/Package.appxmanifest rename to src/Package.appxmanifest index a59ea2a833..9d26a5e0c8 100644 --- a/Packaging/Package.appxmanifest +++ b/src/Package.appxmanifest @@ -20,27 +20,12 @@ - - - - - - - - - - - - - - - - + - + @@ -76,21 +61,21 @@ - + - + - + @@ -301,7 +286,7 @@ - + @@ -314,7 +299,7 @@ - + @@ -327,7 +312,7 @@ - + @@ -353,4 +338,4 @@ - + \ No newline at end of file diff --git a/tools/SetupFlow/DevHome.SetupFlow.ElevatedComponent.Projection/DevHome.SetupFlow.ElevatedComponent.Projection.csproj b/tools/SetupFlow/DevHome.SetupFlow.ElevatedComponent.Projection/DevHome.SetupFlow.ElevatedComponent.Projection.csproj index 851a696d81..609b9dc59d 100644 --- a/tools/SetupFlow/DevHome.SetupFlow.ElevatedComponent.Projection/DevHome.SetupFlow.ElevatedComponent.Projection.csproj +++ b/tools/SetupFlow/DevHome.SetupFlow.ElevatedComponent.Projection/DevHome.SetupFlow.ElevatedComponent.Projection.csproj @@ -15,14 +15,9 @@ DevHome.SetupFlow.ElevatedComponent - - + - - - - diff --git a/tools/Utilities/HostsUtility/Views/HostsFileEditorSettingsWindow.xaml.cs b/tools/Utilities/HostsUtility/Views/HostsFileEditorSettingsWindow.xaml.cs index cf0dcadb42..12ef47c1dd 100644 --- a/tools/Utilities/HostsUtility/Views/HostsFileEditorSettingsWindow.xaml.cs +++ b/tools/Utilities/HostsUtility/Views/HostsFileEditorSettingsWindow.xaml.cs @@ -22,7 +22,7 @@ public HostsFileEditorSettingsWindow() ExtendsContentIntoTitleBar = true; - var stringResource = new StringResource(Path.Combine(AppContext.BaseDirectory, "..\\DevHome\\DevHome.HostsFileEditor.pri"), "Resources/Hosts_Settings_Title"); + var stringResource = new StringResource(Path.Combine(AppContext.BaseDirectory, "DevHome.HostsFileEditor.pri"), "Resources/Hosts_Settings_Title"); WindowTitle = stringResource.GetLocalized("Text"); Title = WindowTitle; AppWindow.SetIcon(Path.Combine(AppContext.BaseDirectory, "Assets/HostsUILib/Hosts.ico")); diff --git a/tools/Utilities/RegPreviewUtility/RegistryPreviewMainWindow.xaml.cs b/tools/Utilities/RegPreviewUtility/RegistryPreviewMainWindow.xaml.cs index 5d497c5f5b..f574ae40da 100644 --- a/tools/Utilities/RegPreviewUtility/RegistryPreviewMainWindow.xaml.cs +++ b/tools/Utilities/RegPreviewUtility/RegistryPreviewMainWindow.xaml.cs @@ -36,7 +36,7 @@ public RegistryPreviewMainWindow(Guid activityId) ExtendsContentIntoTitleBar = true; SetTitleBar(AppTitleBar); - var stringResource = new StringResource(Path.Combine(AppContext.BaseDirectory, "..\\DevHome\\DevHome.RegistryPreview.pri"), "Resources"); + var stringResource = new StringResource(Path.Combine(AppContext.BaseDirectory, "DevHome.RegistryPreview.pri"), "Resources"); AppName = stringResource.GetLocalized("RegistryPreviewAppDisplayName"); Title = AppName; diff --git a/tools/Utilities/src/ViewModels/UtilitiesMainPageViewModel.cs b/tools/Utilities/src/ViewModels/UtilitiesMainPageViewModel.cs index 10e7315f30..8f5906a902 100644 --- a/tools/Utilities/src/ViewModels/UtilitiesMainPageViewModel.cs +++ b/tools/Utilities/src/ViewModels/UtilitiesMainPageViewModel.cs @@ -24,21 +24,21 @@ public UtilitiesMainPageViewModel() Title = stringResource.GetLocalized("HostsFileEditorUtilityTitle"), Description = stringResource.GetLocalized("HostsFileEditorUtilityDesc"), NavigateUri = "https://aka.ms/PowerToysOverview_HostsFileEditor", - ImageSource = Path.Combine(AppContext.BaseDirectory, "..\\DevHome.HostsFileEditor\\Assets\\HostsUILib", "Hosts.ico"), + ImageSource = Path.Combine(AppContext.BaseDirectory, "Assets\\HostsUILib", "Hosts.ico"), }, new("DevHome.RegistryPreviewApp.exe") { Title = stringResource.GetLocalized("RegistryPreviewUtilityTitle"), Description = stringResource.GetLocalized("RegistryPreviewUtilityDesc"), NavigateUri = "https://aka.ms/PowerToysOverview_RegistryPreview", - ImageSource = Path.Combine(AppContext.BaseDirectory, "..\\DevHome.RegistryPreview\\Assets\\RegistryPreview", "RegistryPreview.ico"), + ImageSource = Path.Combine(AppContext.BaseDirectory, "Assets\\RegistryPreview", "RegistryPreview.ico"), }, new("DevHome.EnvironmentVariablesApp.exe") { Title = stringResource.GetLocalized("EnvVariablesEditorUtilityTitle"), Description = stringResource.GetLocalized("EnvVariablesEditorUtilityDesc"), NavigateUri = "https://aka.ms/PowerToysOverview_EnvironmentVariables", - ImageSource = Path.Combine(AppContext.BaseDirectory, "..\\DevHome.EnvironmentVariables\\Assets\\EnvironmentVariables", "EnvironmentVariables.ico"), + ImageSource = Path.Combine(AppContext.BaseDirectory, "Assets\\EnvironmentVariables", "EnvironmentVariables.ico"), }, }; }