Electron-builder: Different architectures for different platforms

Created on 1 Mar 2017  Â·  7Comments  Â·  Source: electron-userland/electron-builder

For example I want to create nsis installer for Windovs --ia32 --x64 and Linux deb --x64;
Perhaps there is a way to specify in the configuration area to build? Something like this:

{
  "appId": "com.electron.app",
  "compression": "maximum",
  "platforms": {
    "win": ["ia32", "x64"],
    "linux": "x64"
  }
}

In this case there is no need to specify the architecture of the platform and the command line.
Instead of this

build -wl --x64 --ia32

Suffice it to perform


feature

Most helpful comment

To build x64 Deb & ia32/x64 NSIS, the final syntax looks something like:

    "win": {
      "target": [
        {
          "target": "nsis",
          "arch": ["ia32", "x64"]
        }
      ]
    },
    "linux": {
      "target": [
        {
          "target": "deb",
          "arch": ["x64"]
        }
      ]
    },

All 7 comments

Proposed solution: targets and n the config should accepts not only name, but object — name, arch. It also will simplify programmatic API.

Thanks for nice feature request. Will be implemented when I will return from vacation. Or PR welcome.

@develar It shout be somsing like this:

"targets": [{
    "arch": ["ia32", "x64"],
    "platform": "win",
    "target": "nsis"
  },{
    "arch": ["ia32", "x64"],
    "platform": "linux",
    "target": "deb"
  }{
    "arch": ["x64"],
    "platform": "linux",
    "target": "snap"
  }]

After compilation we get 3 installation file:

  • .exe
  • .deb
  • .snap

@cawa-93 We currently already have targets in the platform specific options, so, targets will be specified in the corresponding platform specific (e.g. win, mac or linux).

So, I propose:

{
 "target": "nsis",
  "arch": ["ia32", "x64"],
}

without "platform". And you are right — target instead of name is better.

Then maybe it should be done as follows:

{
  "win": {
    "targets": [{
      "target": "nsis",
      "arch": ["ia32", "x64"],
    }]
  },
  "linux": {
    "targets": [{
      "target": "deb",
      "arch": ["ia32", "x64"],
    }, {
      "target": "snap",
      "arch": ["x64"],
    }]
  }

The idea is to be able specify architecture to individually for each platform and each target

BTW, -w default:ia32 is supported :)

You still need to specify platforms in the command line. build -wl --x64 --ia32 => build -wl

To build x64 Deb & ia32/x64 NSIS, the final syntax looks something like:

    "win": {
      "target": [
        {
          "target": "nsis",
          "arch": ["ia32", "x64"]
        }
      ]
    },
    "linux": {
      "target": [
        {
          "target": "deb",
          "arch": ["x64"]
        }
      ]
    },
Was this page helpful?
0 / 5 - 0 ratings