How to use the electron-builder.Platform function in electron-builder

To help you get started, we’ve selected a few electron-builder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sulu-one / sulu / lib / build.js View on Github external
"use strict"

const path = require("path")
const builder = require("electron-builder")
const Platform = builder.Platform

var argv = require('minimist')(process.argv.slice(2));
console.dir();

var fs = require('fs');
var os = argv.os.toUpperCase() // "ia32"
var arch = argv.arch // "ia32"
var p = require("./../package.json");
var fn = path.join(__dirname, "../dist","sulu Setup " + p.version + ".exe");
var fn2 = path.join(__dirname, "../dist","sulu-fileexplorer-" + os + "-" + arch + "-" + p.version + "." + p.stability + ".exe");
var p2 = path.join(__dirname, "../app","package.json");


console.info("patch ", p2, p.version);
var pp2 = JSON.parse(fs.readFileSync(p2).toString())
pp2.version = p.version
github microsoft / BotFramework-Emulator / packages / app / main / gulpfile.js View on Github external
gulp.task('stage:mac', function () {
  var builder = require('electron-builder');
  const config = getConfig("mac", "dir");
  console.log(`Electron mirror: ${getElectronMirrorUrl()}`);
  return builder.build({
    targets: builder.Platform.MAC.createTarget(["dir"]),
    config
  });
});
github microsoft / BotFramework-Emulator / packages / app / main / gulpfile.js View on Github external
gulp.task('stage:windows', function () {
  var builder = require('electron-builder');
  const config = getConfig("windows", "dir");
  console.log(`Electron mirror: ${getElectronMirrorUrl()}`);
  return builder.build({
    targets: builder.Platform.WINDOWS.createTarget(["dir"], builder.Arch.ia32, builder.Arch.x64),
    config
  });
});
github ethereum / mist / scripts / build-dist.js View on Github external
const argv = require('yargs').parse(process.argv.slice(1));

const ROOT_FOLDER = path.resolve(__dirname, '..', '..');

const targets = [];

if (argv.mac) {
    targets.push(builder.Platform.MAC);
}

if (argv.win) {
    targets.push(builder.Platform.WINDOWS);
}

if (argv.linux) {
    targets.push(builder.Platform.LINUX);
}

builder.build({
    targets: builder.createTargets(targets, null, 'all'),
    devMetadata: {
        build: {
            afterPack(params) {
                return Q.try(() => {
                    console.log('Copying LICENSE, AUTHORS, README...');

                    shell.cp(
              path.join(ROOT_FOLDER, 'LICENSE'),
              params.appOutDir
            );

                    shell.cp(
github Azure / BatchExplorer / scripts / package / package.ts View on Github external
async function createDarwinApp() {
    return baseBuild({
        targets: electronBuilder.Platform.MAC.createTarget(["dir"]),
    });
}
github wireapp / wire-desktop / bin / build-tools / lib / build-linux.ts View on Github external
export async function buildLinuxWrapper(
  builderConfig: electronBuilder.Configuration,
  linuxConfig: LinuxConfig,
  packageJsonPath: string,
  wireJsonPath: string,
  envFilePath: string,
): Promise {
  const wireJsonResolved = path.resolve(wireJsonPath);
  const packageJsonResolved = path.resolve(packageJsonPath);
  const envFileResolved = path.resolve(envFilePath);
  const {commonConfig} = await getCommonConfig(envFileResolved, wireJsonResolved);

  const targets = electronBuilder.Platform.LINUX.createTarget(
    linuxConfig.targets,
    electronBuilder.archFromString('x64'),
  );

  logger.info(
    `Building ${commonConfig.name} ${commonConfig.version} for Linux (target${
      linuxConfig.targets.length === 1 ? '' : 's'
    }: ${linuxConfig.targets.join(', ')}) ...`,
  );

  const backup = await backupFiles([packageJsonResolved, wireJsonResolved]);
  const packageJsonContent = await fs.readJson(packageJsonResolved);

  await fs.writeJson(
    packageJsonResolved,
    {...packageJsonContent, productName: commonConfig.name, version: commonConfig.version},
github sero-cash / wallet / gulpTasks / building.js View on Github external
y: 142,
                        type: 'file'
                    }
                ]
            }
        }
    });

    fs.writeFileSync(
        path.join(__dirname, `../dist_${type}`, 'app', 'package.json'),
        JSON.stringify(appPackageJson, null, 2), 'utf-8'
    );

    const targets = [];
    if (options.mac) targets.push(builder.Platform.MAC);
    if (options.win) targets.push(builder.Platform.WINDOWS);
    if (options.linux) targets.push(builder.Platform.LINUX);

    builder.build({
        targets: builder.createTargets(targets, null, 'all'),
        projectDir: path.join(__dirname, `../dist_${type}`, 'app'),
        publish: 'never',
        config: {
            afterPack(params) {
                return Q.try(() => {
                    shell.cp(
                        [
                            path.join(__dirname, '..', 'LICENSE'),
                            path.join(__dirname, '..', 'README.md'),
                            path.join(__dirname, '..', 'AUTHORS')
                        ],
                        params.appOutDir
github mubaidr / vue-electron-template / _scripts / build.js View on Github external
const os = require('os')
const builder = require('electron-builder')

const Platform = builder.Platform
const { name, productName } = require('../package.json')

let targets
var platform = os.platform()

if (platform == 'darwin') {
  targets = Platform.MAC.createTarget()
} else if (platform == 'win32') {
  targets = Platform.WINDOWS.createTarget()
} else if (platform == 'linux') {
  targets = Platform.LINUX.createTarget()
}

const config = {
  appId: `com.mubaidr.${name}`,
  copyright: 'Copyright ©2019 mubaidr@gmail.com',
github cutls / TheDesk / app / build.js View on Github external
const builder = require("electron-builder");
const fs = require('fs');
const os = process.platform;
const Platform = builder.Platform
const Arch = builder.Arch
const targets = new Map();
const archToType = new Map();
const pref = {
    productName: "TheDesk",
    appId: "top.thedesk",
    asarUnpack: [
        "node_modules/itunes-nowplaying-mac"
    ],
    directories: {
        output: "../build/"
    },
    win: {
        icon: "build/thedesk.ico",
        target: [
            "nsis",
github RedDuckss / CemUI / build.js View on Github external
"use strict"

var builder = require("electron-builder"),
    targets = builder.Platform;

builder.build({
    targets: targets.WINDOWS.createTarget(),
    config: {
        "appId": "com.cemui.app",
        "productName": "CemUI",
        "asar": true,
        "icon": "icon.ico",
        "directories": {
          "output": "builds"
        },
        extraResources: [
            "defaults",
            "uni.cert",
        ],
        files: [