YehudaKremer / msix

Create Msix installer for flutter windows-build files.
https://pub.dev/packages/msix
MIT License
276 stars 68 forks source link

Support for custom config file path #223

Closed milindgoel15 closed 9 months ago

milindgoel15 commented 1 year ago

Closes https://github.com/YehudaKremer/msix/issues/220

milindgoel15 commented 1 year ago

One more minor thing, I was going to add a print statement for when the user is really using a custom file location but I removed it before committing to git as I wasn't sure you would like it.

I was adding it to provide some feedback to the user that the msix is using a custom location. So you can choose to add it yourself or leave it as it is.

milindgoel15 commented 1 year ago

Please check if you need any changes.

jherkel commented 9 months ago

@YehudaKremer May I ask to check this pull request, please?

YehudaKremer commented 9 months ago

Hello

The idea is nice and the PR code is good 👍

But adding complexity and responsibility of load different configuration files other then the common one (pubspec.yaml) are out of this package scope.

As an alternative, you can override specific configuration for different environment by using "Command-line argument", for example, my config in my pubspec.yaml is:

msix_config:
  display_name: Flutter App
  msix_version: 1.0.0.0
  certificate_path: C:\path\to\myTESTCertificate.pfx
  certificate_password: 1234
  windows_build_args: --dart-define="DATABASE=development"

So in development environment i will run just dart run msix:create, but in production environment i will run: dart run msix:create --certificate-path "C:\path\to\myPRODertificate.pfx" --windows-build-args --dart-define="DATABASE=production".

This alternative may be less convenient, but I think it covers all use cases.

milindgoel15 commented 9 months ago

This alternative may be less convenient, but I think it covers all use cases.

It's too much hassle for such a little problem when the solution already fixes that. Plus we are not loading any multiple configuration files. It's just 2 files with the aim of reducing the time spent in producing the end msix files.

But it's okay since it's your package and you can choose to not include this pr.