From 1d118cc8be7974e5d99aec8e749891a2d5f6061d Mon Sep 17 00:00:00 2001 From: Martin Fournier Date: Sun, 23 Jan 2022 12:56:32 -0500 Subject: [PATCH 1/2] Modify electron build script to select platforms Allows to build only mac windows or linux for a quicker build time while developping. --- electron/package.json | 2 ++ package.json | 4 ++++ package.sh | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/electron/package.json b/electron/package.json index 8612cb794..f3697e2c1 100755 --- a/electron/package.json +++ b/electron/package.json @@ -16,6 +16,8 @@ "./dist/**/*", "./node_modules/**/*", "./public/**/*", + "./src/**", + "./lib/**,", "*.js" ], "directories": { diff --git a/package.json b/package.json index ab72e91fd..d0b6701c3 100644 --- a/package.json +++ b/package.json @@ -119,6 +119,10 @@ "watch:dev": "webpack --watch --mode development", "electron": "sh ./package.sh", "electron:packager": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png --no-prune", + "electron:packager-all": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png", + "electron:packager-win": "electron-packager .package bitburner --platform win32 --arch x64 --out .build --overwrite --icon .package/icon.png", + "electron:packager-mac": "electron-packager .package bitburner --platform darwin --arch x64 --out .build --overwrite --icon .package/icon.png", + "electron:packager-linux": "electron-packager .package bitburner --platform linux --arch x64 --out .build --overwrite --icon .package/icon.png", "allbuild": "npm run build && npm run electron && git add --all && git commit --amend --no-edit && git push -f -u origin dev" } } diff --git a/package.sh b/package.sh index 866be1700..60a032247 100755 --- a/package.sh +++ b/package.sh @@ -26,5 +26,6 @@ cd electron npm install cd .. +BUILD_PLATFORM="${1:-"all"}" # And finally build the app. -npm run electron:packager +npm run electron:packager-$BUILD_PLATFORM From 73d777ef86fb89bc1d68fa612b8775a463efeb70 Mon Sep 17 00:00:00 2001 From: Martin Fournier Date: Sun, 23 Jan 2022 13:24:14 -0500 Subject: [PATCH 2/2] Remove files from previous electron builds Ensure we don't keep old files around in the published app. --- package.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.sh b/package.sh index 60a032247..5659c0016 100755 --- a/package.sh +++ b/package.sh @@ -1,5 +1,8 @@ #!/bin/sh +# Clear out any files remaining from old builds +rm -rf .package + mkdir -p .package/dist/src/ThirdParty || true mkdir -p .package/src/ThirdParty || true mkdir -p .package/node_modules || true