1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-09-23 20:35:47 +00:00

Remove more unused dependencies (#527)

* Remove more unused dependencies

* Remove gulp-jsbeautifier
This commit is contained in:
Bjorn Stromberg
2020-08-07 16:16:23 +09:00
committed by GitHub
parent a44ec7182a
commit 997fabd52c
13 changed files with 90 additions and 1435 deletions

View File

@@ -1,11 +1,11 @@
const packager = require("electron-packager");
const path = require("path");
const buildutils = require("./buildutils");
const { getVersion } = require("./buildutils");
const fs = require("fs");
const fse = require("fs-extra");
const execSync = require("child_process").execSync;
function gulptasksStandalone($, gulp, buildFolder) {
function gulptasksStandalone($, gulp) {
const electronBaseDir = path.join(__dirname, "..", "electron");
const tempDestDir = path.join(__dirname, "..", "tmp_standalone_files");
@@ -47,49 +47,7 @@ function gulptasksStandalone($, gulp, buildFolder) {
});
gulp.task("standalone.prepare.minifyCode", () => {
return (
gulp
.src(path.join(electronBaseDir, "*.js"))
// .pipe(
// $.terser({
// ecma: 6,
// parse: {},
// module: false,
// toplevel: true,
// keep_classnames: false,
// keep_fnames: false,
// safari10: false,
// compress: {
// arguments: false, // breaks
// drop_console: false,
// // keep_fargs: false,
// keep_infinity: true,
// passes: 2,
// module: false,
// toplevel: true,
// unsafe_math: true,
// unsafe_arrows: false,
// warnings: true,
// },
// mangle: {
// eval: true,
// keep_classnames: false,
// keep_fnames: false,
// module: false,
// toplevel: true,
// safari10: false,
// },
// output: {
// comments: false,
// ascii_only: true,
// beautify: false,
// braces: false,
// ecma: 6,
// },
// })
// )
.pipe(gulp.dest(tempDestBuildDir))
);
return gulp.src(path.join(electronBaseDir, "*.js")).pipe(gulp.dest(tempDestBuildDir));
});
gulp.task("standalone.prepare.copyGamefiles", () => {
@@ -122,15 +80,14 @@ function gulptasksStandalone($, gulp, buildFolder) {
* @param {'win32'|'linux'|'darwin'} platform
* @param {'x64'|'ia32'} arch
* @param {function():void} cb
* @param {boolean=} isRelease
*/
function packageStandalone(platform, arch, cb, isRelease = false) {
function packageStandalone(platform, arch, cb) {
const tomlFile = fs.readFileSync(path.join(__dirname, ".itch.toml"));
packager({
dir: tempDestBuildDir,
appCopyright: "Tobias Springer",
appVersion: buildutils.getVersion(),
appVersion: getVersion(),
buildVersion: "1.0.0",
arch,
platform,
@@ -164,19 +121,6 @@ function gulptasksStandalone($, gulp, buildFolder) {
'#!/usr/bin/env bash\n./shapezio --no-sandbox "$@"\n'
);
fs.chmodSync(path.join(appPath, "play.sh"), 0o775);
} else if (platform === "win32") {
// Optional: Create a playable copy. Shouldn't be required
// const playablePath = appPath + "_playable";
// fse.copySync(appPath, playablePath);
// fs.writeFileSync(path.join(playablePath, "steam_appid.txt"), "1134480");
// fs.writeFileSync(
// path.join(playablePath, "play.bat"),
// "start shapezio --dev --disable-direct-composition --in-process-gpu\r\n"
// );
// fs.writeFileSync(
// path.join(playablePath, "play_local.bat"),
// "start shapezio --local --dev --disable-direct-composition --in-process-gpu\r\n"
// );
}
if (platform === "darwin") {
@@ -226,11 +170,11 @@ function gulptasksStandalone($, gulp, buildFolder) {
);
}
gulp.task("standalone.package.prod.win64", cb => packageStandalone("win32", "x64", cb, true));
gulp.task("standalone.package.prod.win32", cb => packageStandalone("win32", "ia32", cb, true));
gulp.task("standalone.package.prod.linux64", cb => packageStandalone("linux", "x64", cb, true));
gulp.task("standalone.package.prod.linux32", cb => packageStandalone("linux", "ia32", cb, true));
gulp.task("standalone.package.prod.darwin64", cb => packageStandalone("darwin", "x64", cb, true));
gulp.task("standalone.package.prod.win64", cb => packageStandalone("win32", "x64", cb));
gulp.task("standalone.package.prod.win32", cb => packageStandalone("win32", "ia32", cb));
gulp.task("standalone.package.prod.linux64", cb => packageStandalone("linux", "x64", cb));
gulp.task("standalone.package.prod.linux32", cb => packageStandalone("linux", "ia32", cb));
gulp.task("standalone.package.prod.darwin64", cb => packageStandalone("darwin", "x64", cb));
gulp.task(
"standalone.package.prod",
@@ -240,8 +184,6 @@ function gulptasksStandalone($, gulp, buildFolder) {
"standalone.package.prod.win64",
"standalone.package.prod.linux64",
"standalone.package.prod.darwin64"
// "standalone.package.prod.win32",
// "standalone.package.prod.linux32",
)
)
);