Skip to content

Commit

Permalink
Update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
AlyxMoon committed Jan 13, 2020
1 parent fe47302 commit c823dec
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
Binary file added _icons/icon.icns
Binary file not shown.
Binary file added _icons/icon.ico
Binary file not shown.
Binary file added _icons/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 18 additions & 9 deletions _scripts/build.js
Expand Up @@ -5,13 +5,12 @@ const { name, productName } = require('../package.json')

const config = {
appId: `com.alyxmoon.${name}`,
copyright: `Copyright @2019 allisterkmoon@gmail.com`,
copyright: `Copyright ${(new Date()).getFullYear()} - Allister Moon - allisterkmoon@gmail.com`,
productName,
directories: {
output: 'build/',
},
files: [
'!**/node_modules/**/*',
'dist/**/*',
'src/data/**/*',
],
Expand All @@ -35,26 +34,36 @@ const config = {
},
},
linux: {
// icon: '_icons/icon.png',
target: ['deb', 'snap', 'AppImage'],
icon: '_icons/icon.png',
target: ['deb'],
},
mac: {
category: 'public.app-category.utilities',
// icon: '_icons/icon.icns',
target: ['dmg', 'zip'],
icon: '_icons/icon.icns',
target: ['zip'],
type: 'distribution',
},
win: {
// icon: '_icons/icon.ico',
target: ['nsis', 'zip', 'portable'],
icon: '_icons/icon.ico',
target: ['zip'],
},
nsis: {
allowToChangeInstallationDirectory: true,
oneClick: false,
},
}

let targets

if (process.argv[2] === 'linux') {
targets = Platform.LINUX.createTarget()
} else if (process.argv[2] === 'mac') {
targets = Platform.MAC.createTarget()
} else {
targets = Platform.WINDOWS.createTarget()
}

builder.build({
targets: Platform.WINDOWS.createTarget(),
targets,
config,
}).then(console.log).catch(console.error)
9 changes: 6 additions & 3 deletions package.json
Expand Up @@ -3,7 +3,7 @@
"productName": "LFMM",
"version": "2.0.0",
"description": "An unofficial mod manager for Factorio",
"main": "dist/main.js",
"main": "./dist/main.js",
"scripts": {
"debug": "node _scripts/dev-runner.js --remote-debug",
"dev": "node _scripts/dev-runner.js",
Expand All @@ -12,7 +12,10 @@
"test": "jest --config test/unit/jest.conf.js",
"test:watch": "jest --config test/unit/jest.conf.js --watch",
"test:coverage": "jest --config test/unit/jest.conf.js --coverage",
"build": "yarn run pack && node _scripts/build.js",
"build": "yarn run pack && yarn run build:windows",
"build:windows": "yarn run pack && node _scripts/build.js windows",
"build:linux": "yarn run pack && node _scripts/build.js linux",
"build:mac": "yarn run pack && node _scripts/build.js mac",
"pack": "yarn run pack:main && yarn run pack:renderer",
"pack:main": "webpack --mode=production --env.NODE_ENV=production --hide-modules --config _scripts/webpack.main.config.js",
"pack:renderer": "webpack --mode=production --env.NODE_ENV=production --hide-modules --config _scripts/webpack.renderer.config.js",
Expand All @@ -34,7 +37,7 @@
"url": "https://github.com/AlyxMoon/Lunar-Factorio-Mod-Manager/issues"
},
"homepage": "https://github.com/AlyxMoon/Lunar-Factorio-Mod-Manager",
"author": "Allister Moon",
"author": "Allister Moon <allisterkmoon@gmail.com> (http://www.allistermoon.com)",
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.5.5",
Expand Down

0 comments on commit c823dec

Please sign in to comment.