Electron-builder: `--dist` by default and remove this flag in favour of `--target=dir`

Created on 17 May 2016  Â·  2Comments  Â·  Source: electron-userland/electron-builder

A lot of users complain about it. Since mas was implemented, we have new target option in the configuration. And it will be soon supported for other OS — zip, 7z targets.

Proposal:

  • Add --osx, --linux and --win flags. Value: list of supported os-specific targets.
  • Add --target flag. Value: list of common targets (zip) or unique target (mas, dmg).
  • Remove --dist flag. Replacement: --target=dir if you want to get unpacked app. i.e. by default we will build in distributable format.
  • Hide --platform flag (we cannot remove to be compatible with electron-packager, so, we just hide it). Replacement: --win or --osx. To build all platforms: --target=default (i.e. if target is common or has special meaning (default means use default target)).

Result:

  • improve user-friendly — since we will build in a distributable format by default.
  • clear CLI — remove --dist/--platform flags in favour of unified --target.
  • ability to set target (e.g. mas) using CLI (if you want to experiment and don't want to change package.json yet).

cc @d9k @nickhudkins

Most helpful comment

I like the idea of changing --platform in favor of specific OS flags. It's way cleaner for use.
Maybe something like:

build --osx [ia32|x64] --win [ia32|x64] --linux [ia32|x64]

Architecture specification is optional. If not defined, it can build both by default. So you can kick out --arch as well.

Currently, you'll get .dmg and .zip for OSX, and .exe and .nupkg for Windows, right? I mean, if mas is only exception, would it be easy to define --mas? So for folks that want to make OSX builds, they just do:

build --osx --mas --win 

...which would create binaries for Win, OSX and App store.

Even better:

-o --osx
-w --win
-l --linux

then you can do extra cool: build -owl :-D

All 2 comments

I like the idea of changing --platform in favor of specific OS flags. It's way cleaner for use.
Maybe something like:

build --osx [ia32|x64] --win [ia32|x64] --linux [ia32|x64]

Architecture specification is optional. If not defined, it can build both by default. So you can kick out --arch as well.

Currently, you'll get .dmg and .zip for OSX, and .exe and .nupkg for Windows, right? I mean, if mas is only exception, would it be easy to define --mas? So for folks that want to make OSX builds, they just do:

build --osx --mas --win 

...which would create binaries for Win, OSX and App store.

Even better:

-o --osx
-w --win
-l --linux

then you can do extra cool: build -owl :-D

@Vj3k0 Thanks, so, I will do it.

I mean, if mas is only exception

No, numerous targets — https://github.com/electron-userland/electron-builder/issues/414#issuecomment-220761121

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ccorcos picture ccorcos  Â·  3Comments

NPellet picture NPellet  Â·  3Comments

philcockfield picture philcockfield  Â·  3Comments

JohnWeisz picture JohnWeisz  Â·  3Comments

alexstrat picture alexstrat  Â·  3Comments