Skip to content

Generated solution should allow specific platforms #17

Closed

Description

@Arlodotexe

Background

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.

Activity

  1. added
    enhancement
    dev loop ➰
    on May 17, 2022
  2. Arlodotexe commented on Jul 20, 2022

    @Arlodotexe
    MemberAuthor

    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.

  3. Arlodotexe commented on Aug 10, 2022

    @Arlodotexe
    MemberAuthor

    #125 is now a prerequisite issue. Please make sure it's complete before starting on this.

  4. Arlodotexe commented on Sep 10, 2024

    @Arlodotexe
    MemberAuthor

    This was fixed in #200

  5. moved this from 📋 Backlog to ✅ Done in Toolkit 8.xon Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev loop ➰enhancementsample app 🖼

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions