Skip to content

Commit cdff8de

Browse files
committed
Add developer guidance for debugging & running tests
1 parent 28a239c commit cdff8de

File tree

2 files changed

+49
-27
lines changed

2 files changed

+49
-27
lines changed

README.md

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -82,34 +82,9 @@ The client is built around the concept of sources; a set of packages effectively
8282
* The default "msstore" source includes packages in the Microsoft Store.
8383
* It is also possible to host your own private [REST-based](https://github.com/microsoft/winget-cli-restsource) source.
8484

85-
## Building the client
86-
87-
1. Clone the repository
88-
2. Configure your system, please use the [configuration file](.configurations/configuration.dsc.yaml). This can be applied by either:
89-
* [Dev Home](https://github.com/microsoft/devhome)'s machine configuration tool
90-
* WinGet configuration. Run `winget configure .configurations/configuration.dsc.yaml` from the project root so relative paths resolve correctly.
91-
3. Run `vcpkg integrate install` from the Developer Command Prompt for VS 2022. This is a one-time setup step until the configuration file in step 2 is updated to work with vcpkg setup.
92-
93-
### Prerequisites
94-
95-
* Windows 10 1809 (17763) or later
96-
* [Developer Mode enabled](https://docs.microsoft.com/windows/uwp/get-started/enable-your-device-for-development)
97-
* [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)
98-
* Or use WinGet to install it ;) (although you may need to adjust the workloads via Tools->Get Tools and Features...)
99-
* The following workloads:
100-
* .NET Desktop Development
101-
* Desktop Development with C++
102-
* Universal Windows Platform Development
103-
* Check [.vsconfig file](.vsconfig) for full components list
104-
* [Windows SDK for Windows 11 (10.0.22000.194)](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/)
105-
> [!NOTE]
106-
> You can also get it through `winget install Microsoft.WindowsSDK --version 10.0.22000.832` (use --force if you have a newer version installed) or via Visual Studio > Get Tools and Features > Individual Components > Windows 10 SDK (10.0.22000.0)
107-
* The following extensions:
108-
* [Microsoft Visual Studio Installer Projects](https://marketplace.visualstudio.com/items?itemName=VisualStudioClient.MicrosoftVisualStudio2022InstallerProjects)
109-
110-
### Building
85+
## Building the Client
11186

112-
Open `winget-cli\src\AppInstallerCLI.sln` in Visual Studio and build. We currently only build using the solution; command-line methods of building a VS solution should work as well. After the build finishes, deploy the solution from Build > Deploy Solution. You can then run the client from the command line using `wingetdev`.
87+
Please follow our [developer guidance](/doc/Developing.md) to build, run & test the client.
11388

11489
## Credit
11590

doc/Developing.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Developer guidance
2+
3+
## Prerequisites
4+
5+
* Windows 10 1809 (17763) or later
6+
* [Developer Mode enabled](https://docs.microsoft.com/windows/uwp/get-started/enable-your-device-for-development)
7+
* [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)
8+
* Or use WinGet to install it ;) (although you may need to adjust the workloads via Tools->Get Tools and Features...)
9+
* The following workloads:
10+
* .NET Desktop Development
11+
* Desktop Development with C++
12+
* Universal Windows Platform Development
13+
* Check [.vsconfig file](.vsconfig) for full components list
14+
15+
* [Windows SDK for Windows 11 (10.0.22000.194)](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/)
16+
17+
> [!NOTE]
18+
> You can also get it through `winget install Microsoft.WindowsSDK --version 10.0.22000.832` (use --force if you have a newer version installed) or via Visual Studio > Get Tools and Features > Individual Components > Windows 10 SDK (10.0.22000.0)
19+
20+
* The following extensions:
21+
22+
* [Microsoft Visual Studio Installer Projects](https://marketplace.visualstudio.com/items?itemName=VisualStudioClient.MicrosoftVisualStudio2022InstallerProjects)
23+
24+
## Building the client
25+
26+
1. Clone the repository
27+
2. Configure your system, please use the [configuration file](.configurations/configuration.dsc.yaml). This can be applied by either:
28+
* [Dev Home](https://github.com/microsoft/devhome)'s machine configuration tool
29+
* WinGet configuration. Run `winget configure .configurations/configuration.dsc.yaml` from the project root so relative paths resolve correctly.
30+
3. Run `vcpkg integrate install` from the Developer Command Prompt / Developer PowerShell for VS 2022. This is a one-time setup step until the configuration file in step 2 is updated to work with vcpkg setup.
31+
32+
Open `winget-cli\src\AppInstallerCLI.sln` in Visual Studio and build. We currently only build using the solution; command-line methods of building a VS solution should work as well.
33+
34+
## Running and Debugging
35+
36+
After the build finishes, deploy the solution from Build > Deploy Solution. You can then run the client from the command line using `wingetdev`.
37+
38+
You can also directly run the client from Visual Studio by setting the `AppInstallerCLIPackage` project as the startup project and pressing <kbd>F5</kbd>. To prevent the client from exiting as soon as it finishes its execution, you can add the `--wait` command line argument in the project's debug settings.
39+
40+
To enable step-through debugging, right click on `AppInstallerCLIPackage` in the Solution Explorer, select Properties, and navigate to the Debug tab. In the Debugger type selection, change "Application process" and "Background task process" to "Native Only". This will allow you to add breakpoints and step through the code. The main entry point for the client is in `src/AppInstallerCLI/main.cpp`
41+
42+
## Running Unit Tests
43+
44+
The unit tests are located inside the `AppInstallerCLITests` project. When the solution is built, all tests are compiled under `src/<ARCHITECTURE>/<Debug|Release>/AppInstallerCLITests`. An executable `AppInstallerCLITests.exe` is generated in this directory to run the tests. Run `AppInstallerCLITests.exe` from the command line to execute the tests. To see all available options, run `AppInstallerCLITests.exe --help`.
45+
46+
> [!TIP]
47+
> If you just want to run a particular test, you can specify the test name as an argument to the executable. For example, `AppInstallerCLITests.exe EnsureSortedErrorList`.

0 commit comments

Comments
 (0)