-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Background
So far, Labs is set up to work with
- UWP - WinUI 2 (Windows)
- WinAppSDK - WinUI 3 (Windows)
- Uno Platform (WinUI 2 AND 3, all other platforms)
The problem
While devs can easily add nuget packages to the library code for their experiment, it's not currently possible to add nuget packages that work under Uno and accommodate both WinUI 2 and 3.
The cause
Under everything except UWP and WinAppSDK, the projects share a target framework between WinUI 2 and 3.
Possible solutions
We fixed this for labs itself in #75 by using a powershell script. The script UseUnoWinUI.ps1 modified the Labs.Uno.props file to switch between the WinUI 2 and WinUI 3 versions of the Uno packages, then suppresses git changes to prevent the user from changing the default for everyone else.
Doing this exact same setup for experiment dependencies would quickly get a mess due to the user changing the file + git suppressing changes.
Instead, we should try something like this:
Experiment.Lib.csproj
| Imports
v
Deps.props - Swap WinUI 2/3 import via pwsh, suppress git changes
|
/\
/ \
| | Imports
v v
WinUI2.props WinUI3.props - Allow user to freely modify
Then, in the UseUnoWinUI.ps1 script, in addition to modifying Labs.Uno.props, it would check each experiment and modify the Deps.props file to swap between importing WinUI2.props and WinUI3.props.
The ProjectTemplate will need to be adjusted for this, as well as all existing experiments.
Final note - pick better file names than the provided ones. They're shortened to fit in the graphic.