You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Generated solution should allow specific platforms #17
Using the GenerateAllSolution.ps1 script, we take a template of a solution file, dynamically add all sample projects to it, and spit out a working solution.
The problem
There are a few issues here that, if fixed, would improve the dev experience for our users.
The UseTargetFrameworks.ps1 file is not called as part of this script, meaning the user must manually enter the common/Scripts/ folder and execute it before generating the solution.
The script copies all platform heads from the template into the solution, even if the TargetFrameworks haven't been enabled and they wouldn't build.
When building the all-sample solution, some users may be in environments where not all heads can be built or deployed (missing tooling, on a specific OS, etc), or they might just not care about building a specific target framework.
The solution
To minimize the dependencies needed to build a platform head, we should adjust the script that generates the all-sample solution to also take a targets parameter, similar to the UseTargetFrameworks script:
Param (
[Parameter(HelpMessage="The target frameworks to enable.")]
[ValidateSet('all','wasm','uwp','winappsdk','wpf','gtk','macos','ios','droid')]
[string[]]$targets,
)
This should generate a solution with only the requested platforms and target frameworks present.
It should be noted that the UseTargetFramework.ps1 script is not being called internally when generating a solution, at all. Features that depend on non-default target frameworks might not work.
Luckily, the build system is smart enough to pick netstandard2.0 as the next best candidate when building most platforms, which Uno does support. We just lose some platform-specific functionality until we fix this.
Activity
Arlodotexe commentedon Jul 20, 2022
It should be noted that the
UseTargetFramework.ps1script is not being called internally when generating a solution, at all. Features that depend on non-default target frameworks might not work.Luckily, the build system is smart enough to pick
netstandard2.0as the next best candidate when building most platforms, which Uno does support. We just lose some platform-specific functionality until we fix this.Arlodotexe commentedon Aug 10, 2022
#125 is now a prerequisite issue. Please make sure it's complete before starting on this.
Arlodotexe commentedon Sep 10, 2024
This was fixed in #200