MauiAppAccelerator icon indicating copy to clipboard operation
MauiAppAccelerator copied to clipboard

Maybe we can add a function to choose the platform which to use?

Open mstouk57g opened this issue 9 months ago • 2 comments

We can delete dome codes from csproj File to chose which platforms to compile and use. Like this ,which deleted the support of Windows and Tizen :

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>

And when we compiling or debugging, it won't shows Windows and Tizen.

Image

So that we can choose which platform to use, and decline to compile the platforms which we don't need.

mstouk57g avatar Feb 21 '25 15:02 mstouk57g

This may look like it should be a simple change, but it has big issues with how everything works internally with the wizard.

It's not just that there are the extra options to test against, there are other features that include platform-specific files. e.g. if Windows was unselected in the wizard but then the audio plugin was selected, the wizard would have to not include the changes to the appxmainfest in the Windows platform folder. I don't yet have logic for this and expect it to get complicated allowing for all the combinations of options and the fact that files are currently expected to be there.

If you don't need or want Windows support, I recommend you comment it out in the project file. However, I find having the Windows option, and using it for testing and debugging can be much quicker than deploying to an emulator or tethered device for things where you don't need something specific to a device or other OS.

Basically, it will be a load of work, will make future maintenance and testing much harder, and I think it will provide only a small benefit when it's already possible to go in and manually edit the csproj. Unless there's a really good reason to do this that I'm not currently aware of, this is highly unlikely to get done.

X-Ref #11

mrlacey avatar Feb 24 '25 17:02 mrlacey

Maybe you're right. It's easy to select the platforms in the csproj file. And it will only provide a small convenience. Just an advice? I'm looking forward to this function. (because uno-platform has this function and I think it's convenient)

mstouk57g avatar Mar 03 '25 06:03 mstouk57g