From 6c2316df44779deb9480c769e3354187660e6736 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Tue, 26 Jul 2022 06:39:21 -0500 Subject: [PATCH] Add some notes on building package from commandline (#13350) I was messing around with trying to build & deploy from the commandline. I discovered this, which is progress. However, the inner-loop commandline build for the Terminal is still egregiously long. * just a docs update * is EIM work --- .github/actions/spelling/allow/apis.txt | 1 + doc/building.md | 15 +++++++++++++++ tools/bcz.cmd | 3 ++- tools/bx.ps1 | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/actions/spelling/allow/apis.txt b/.github/actions/spelling/allow/apis.txt index a84c00408c..c7119047e1 100644 --- a/.github/actions/spelling/allow/apis.txt +++ b/.github/actions/spelling/allow/apis.txt @@ -5,6 +5,7 @@ aclapi alignas alignof APPLYTOSUBMENUS +appxrecipe bitfield bitfields BUILDBRANCH diff --git a/doc/building.md b/doc/building.md index d188a7ec1a..968a6abd8d 100644 --- a/doc/building.md +++ b/doc/building.md @@ -139,3 +139,18 @@ powershell -Command Set-Location -Path %OPENCON%\src\cascadia\CascadiaPackage\Ap (yes, the cmd version is just calling powershell to do the powershell version. Too lazy to convert the rest by hand, I'm already copying from `.vscode\tasks.json`) Building the package from VS generates the loose layout to begin with, and then registers the loose manifest, skipping the msix stop. It's a lot faster than the commandline inner loop here, unfortunately. + +### 2022 Update + +The following command can be used to build the terminal package, and then deploy it. + +```cmd +pushd %OPENCON%\src\cascadia\CascadiaPackage +bx +"C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\DeployAppRecipe.exe" bin\%ARCH%\%_LAST_BUILD_CONF%\CascadiaPackage.build.appxrecipe +popd +``` + +The `bx` will build just the Terminal package, critically, populating the `CascadiaPackage.build.appxrecipe` file. Once that's been built, then the `DeployAppRecipe.exe` command can be used to deploy a loose layout in the same way that Visual Studio does. + +Notably, this method of building the Terminal package can't leverage the FastUpToDate check in Visual Studio, so the builds end up being considerably slower for the whole package, as cppwinrt does a lot of work before confirming that it's up to date and doing nothing. diff --git a/tools/bcz.cmd b/tools/bcz.cmd index c95fbe21ff..46640a725f 100644 --- a/tools/bcz.cmd +++ b/tools/bcz.cmd @@ -72,7 +72,8 @@ if "%_SKIP_NUGET_RESTORE%" == "1" ( nuget.exe restore %OPENCON%\OpenConsole.sln ) -set _BUILD_CMDLINE="%MSBUILD%" %OPENCON%\OpenConsole.sln /t:"%_MSBUILD_TARGET%" /m /p:Configuration=%_LAST_BUILD_CONF% /p:Platform=%ARCH% %_APPX_ARGS% +@rem /p:GenerateAppxPackageOnBuild=false will prevent us from building the whole .msix package when building the wapproj project. +set _BUILD_CMDLINE="%MSBUILD%" %OPENCON%\OpenConsole.sln /t:"%_MSBUILD_TARGET%" /m /p:Configuration=%_LAST_BUILD_CONF% /p:GenerateAppxPackageOnBuild=false /p:Platform=%ARCH% %_APPX_ARGS% echo %_BUILD_CMDLINE% echo Starting build... diff --git a/tools/bx.ps1 b/tools/bx.ps1 index 4bf0596a33..38edab55ac 100644 --- a/tools/bx.ps1 +++ b/tools/bx.ps1 @@ -2,7 +2,7 @@ # in this directory. Parses the solution's .metaproj file looking for the # project file in this directory, to be able to get the project's name. -$projects = Get-Childitem -Path .\ -Filter *.vcxproj -File +$projects = Get-ChildItem -Path * -Include *.vcxproj,*.wapproj if ($projects.length -eq 0) { exit -1