Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Quality: Add a solution configuration for each build of the app #16680

Open
Lamparter opened this issue Jan 7, 2025 · 1 comment
Open

Comments

@Lamparter
Copy link
Contributor

Description

Here's an interesting idea: what if instead of using the Configure-AppxManifest.ps1 script, each "branch" or release channel of the app (Release, Preview, Dev) were literally a solution configuration? For example, instead of choosing Debug|x64, you'd choose Dev|x64. Resources such as the app icon and name would dynamically change rather than needing to be updated using a script.

Concerned code

  • The solution file
  • Areas where there are differences per branch
    • Different features
    • Different app icons

Gains

  • eg. A better readability.
  • eg. Uncoupling concepts X and Y.
  • eg. Clarifying the responsibility of class C.

Requirements

  • Add #if compiler blocks to hide features that are restricted to a channel
  • Using MSBuild property files, the associated app icons could also be dynamically changed

Comments

This would be a good thing to do when a new solution is created.

@0x5bfa
Copy link
Member

0x5bfa commented Jan 8, 2025

Since the script does replacement of strings mostly in Package.appxmanifest, we don't have to care. Also the script is much usable because it finds and replaces strings even in XAML files, where you can't use #if and #endif pre compiler directives. Plus, as far as we use .sln we are not able to avoid making it very long, unreadable and fragile.

Thus, we don't have much gain from this unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants