mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-11 09:11:50 +00:00
Slight improvements for the build process (#19)
* Unify the version source Changes the development config to use version from package.json and makes the production config use the same utility function. Also removes the version file as it's no longer needed. * Remove some Steam references from build process Removes files needed to publish the game on Steam and related tasks that can be only used by the developer anyway. Only the build process is affected, the actual game part still supports Steam integration. * Refactor/add packaging tasks Adds new Gulp tasks to create a distributable package of the game. A task for macOS is not provided because signing needs to be figured out first. Package creation tasks are also aliased in package.json for future usage in external tools or CI. Aside from that, alternative methods of downloading the libGDX Texture Packer are dropped.
This commit is contained in:
parent
b55001dd1a
commit
c2855d528d
3
.gitignore
vendored
3
.gitignore
vendored
@ -54,9 +54,6 @@ config.local.js
|
|||||||
# Editor artifacts
|
# Editor artifacts
|
||||||
*.*.swp
|
*.*.swp
|
||||||
*.*.swo
|
*.*.swo
|
||||||
app.vdf
|
|
||||||
|
|
||||||
steamtmp
|
|
||||||
build_output
|
build_output
|
||||||
built_vdfs
|
|
||||||
tmp
|
tmp
|
||||||
|
|||||||
@ -7,7 +7,7 @@ WORKDIR /shapez.io
|
|||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
ffmpeg default-jre \
|
ffmpeg default-jre \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json yarn.lock ./
|
||||||
RUN yarn
|
RUN yarn
|
||||||
@ -20,7 +20,6 @@ WORKDIR /shapez.io
|
|||||||
COPY res ./res
|
COPY res ./res
|
||||||
COPY src/html ./src/html
|
COPY src/html ./src/html
|
||||||
COPY src/css ./src/css
|
COPY src/css ./src/css
|
||||||
COPY version ./version
|
|
||||||
COPY sync-translations.js ./
|
COPY sync-translations.js ./
|
||||||
COPY translations ./translations
|
COPY translations ./translations
|
||||||
COPY src/js ./src/js
|
COPY src/js ./src/js
|
||||||
|
|||||||
13
README.md
13
README.md
@ -60,7 +60,10 @@ and does not intend to provide compatibility for older clients.
|
|||||||
- [Node.js 16](https://nodejs.org/en/about/previous-releases)
|
- [Node.js 16](https://nodejs.org/en/about/previous-releases)
|
||||||
(not 17+, see <https://github.com/tobspr-games/shapez.io/issues/1473>)
|
(not 17+, see <https://github.com/tobspr-games/shapez.io/issues/1473>)
|
||||||
- [Yarn 1](https://classic.yarnpkg.com/en/docs/install) (not 2, we haven't migrated yet)
|
- [Yarn 1](https://classic.yarnpkg.com/en/docs/install) (not 2, we haven't migrated yet)
|
||||||
- [Java](https://www.oracle.com/java/technologies/downloads/) (or [OpenJDK](https://openjdk.org/)) (to run texture packer)
|
- [Java](https://www.oracle.com/java/technologies/downloads/) (or [OpenJDK](https://openjdk.org/)) to run the texture packer
|
||||||
|
- [cURL](https://curl.se/download.html)[^1] to download the texture packer
|
||||||
|
|
||||||
|
[^1]: cURL is already installed on most Windows, Linux and macOS systems.
|
||||||
|
|
||||||
### Development
|
### Development
|
||||||
|
|
||||||
@ -72,13 +75,11 @@ and does not intend to provide compatibility for older clients.
|
|||||||
|
|
||||||
### Release
|
### Release
|
||||||
|
|
||||||
> [!CAUTION]
|
> [!IMPORTANT]
|
||||||
> Release steps are currently unchecked and unmaintained and will likely be revised in the future.
|
> While there is partial macOS support, it is not tested and adapted yet. Therefore, macOS package creation task is not provided.
|
||||||
|
|
||||||
- Run `yarn` in the root folder and in `electron/`.
|
- Run `yarn` in the root folder and in `electron/`.
|
||||||
- In the root folder, run `yarn gulp build.standalone-steam`.
|
- In the root folder, run `yarn package-$PLATFORM` where `$PLATFORM` is `win32` or `linux` depending on your system.
|
||||||
- Run `yarn gulp standalone.standalone-steam.prepare`.
|
|
||||||
- Run `yarn gulp standalone.standalone-steam.package.$PLATFORM` where `$PLATFORM` is `win64`, `linux64`, or `darwin64` depending on your system.
|
|
||||||
- The build will be found under `build_output/standalone-steam` as `shapez-...-x64`.
|
- The build will be found under `build_output/standalone-steam` as `shapez-...-x64`.
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
* standalone: boolean,
|
* standalone: boolean,
|
||||||
* environment?: 'dev' | 'staging' | 'prod',
|
* environment?: 'dev' | 'staging' | 'prod',
|
||||||
* electronBaseDir?: string,
|
* electronBaseDir?: string,
|
||||||
* steamAppId?: number,
|
|
||||||
* executableName?: string
|
* executableName?: string
|
||||||
* }>}
|
* }>}
|
||||||
*/
|
*/
|
||||||
@ -23,6 +22,5 @@ export const BUILD_VARIANTS = {
|
|||||||
"standalone-steam": {
|
"standalone-steam": {
|
||||||
standalone: true,
|
standalone: true,
|
||||||
executableName: "shapez",
|
executableName: "shapez",
|
||||||
steamAppId: 1318690,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import glob from "glob";
|
import glob from "glob";
|
||||||
import { execSync } from "child_process";
|
import { execSync } from "child_process";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path/posix";
|
|
||||||
|
|
||||||
export function getRevision(useLast = false) {
|
export function getRevision(useLast = false) {
|
||||||
const commitHash = execSync("git rev-parse --short " + (useLast ? "HEAD^1" : "HEAD")).toString("ascii");
|
const commitHash = execSync("git rev-parse --short " + (useLast ? "HEAD^1" : "HEAD")).toString("ascii");
|
||||||
@ -30,7 +29,8 @@ export function getTag() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getVersion() {
|
export function getVersion() {
|
||||||
return fs.readFileSync(path.join("..", "version")).toString().trim();
|
// Use the version number specified in package.json
|
||||||
|
return JSON.parse(fs.readFileSync("../package.json", "utf-8")).version;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -258,16 +258,22 @@ for (const variant in BUILD_VARIANTS) {
|
|||||||
|
|
||||||
gulp.task(buildName, gulp.series("utils.cleanup", buildName + ".all", "step.postbuild"));
|
gulp.task(buildName, gulp.series("utils.cleanup", buildName + ".all", "step.postbuild"));
|
||||||
|
|
||||||
// bundle
|
// Tasks for creating distributable packages
|
||||||
if (data.standalone) {
|
if (data.standalone) {
|
||||||
gulp.task(
|
// TODO: Figure out macOS support as a non-published app
|
||||||
"bundle." + variant + ".from-windows",
|
const packagePlatforms = ["win32", "linux"];
|
||||||
gulp.series(buildName, "standalone." + variant + ".build-from-windows")
|
|
||||||
);
|
for (const platform of packagePlatforms) {
|
||||||
gulp.task(
|
gulp.task(
|
||||||
"bundle." + variant + ".from-darwin",
|
`package.${variant}.${platform}`,
|
||||||
gulp.series(buildName, "standalone." + variant + ".build-from-darwin")
|
gulp.series(
|
||||||
);
|
`build.${variant}`,
|
||||||
|
"utils.cleanBuildOutputFolder",
|
||||||
|
`standalone.${variant}.prepare`,
|
||||||
|
`standalone.${variant}.package.${platform}`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// serve
|
// serve
|
||||||
@ -287,15 +293,5 @@ gulp.task(
|
|||||||
gulp.series("utils.requireCleanWorkingTree", "build.web-shapezio", "ftp.upload.prod")
|
gulp.series("utils.requireCleanWorkingTree", "build.web-shapezio", "ftp.upload.prod")
|
||||||
);
|
);
|
||||||
|
|
||||||
// Bundling (pre upload)
|
|
||||||
gulp.task(
|
|
||||||
"bundle.steam.from-darwin",
|
|
||||||
gulp.series("utils.cleanBuildOutputFolder", "bundle.standalone-steam.from-darwin")
|
|
||||||
);
|
|
||||||
gulp.task(
|
|
||||||
"bundle.steam.from-windows",
|
|
||||||
gulp.series("utils.cleanBuildOutputFolder", "bundle.standalone-steam.from-windows")
|
|
||||||
);
|
|
||||||
|
|
||||||
// Default task (dev, localhost)
|
// Default task (dev, localhost)
|
||||||
gulp.task("default", gulp.series("serve.standalone-steam"));
|
gulp.task("default", gulp.series("serve.standalone-steam"));
|
||||||
|
|||||||
@ -96,28 +96,12 @@ export default function gulptasksImageResources(gulp, buildFolder) {
|
|||||||
execute("java -version");
|
execute("java -version");
|
||||||
// Now check and try downloading runnable-texturepacker.jar (22MB)
|
// Now check and try downloading runnable-texturepacker.jar (22MB)
|
||||||
if (!fs.existsSync("./runnable-texturepacker.jar")) {
|
if (!fs.existsSync("./runnable-texturepacker.jar")) {
|
||||||
const safeLink = JSON.stringify(runnableTPSource);
|
const escapedLink = JSON.stringify(runnableTPSource);
|
||||||
const commands = [
|
|
||||||
// linux/macos if installed
|
|
||||||
`wget -O runnable-texturepacker.jar ${safeLink}`,
|
|
||||||
// linux/macos, latest windows 10
|
|
||||||
`curl -o runnable-texturepacker.jar ${safeLink}`,
|
|
||||||
// windows 10 / updated windows 7+
|
|
||||||
"powershell.exe -Command (new-object System.Net.WebClient)" +
|
|
||||||
`.DownloadFile(${safeLink.replace(/"/g, "'")}, 'runnable-texturepacker.jar')`,
|
|
||||||
// windows 7+, vulnerability exploit
|
|
||||||
`certutil.exe -urlcache -split -f ${safeLink} runnable-texturepacker.jar`,
|
|
||||||
];
|
|
||||||
|
|
||||||
while (commands.length) {
|
try {
|
||||||
try {
|
execute(`curl -o runnable-texturepacker.jar ${escapedLink}`);
|
||||||
execute(commands.shift());
|
} catch {
|
||||||
break;
|
throw new Error("Failed to download runnable-texturepacker.jar!");
|
||||||
} catch {
|
|
||||||
if (!commands.length) {
|
|
||||||
throw new Error("Failed to download runnable-texturepacker.jar!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@ export default function gulptasksStandalone(gulp) {
|
|||||||
}
|
}
|
||||||
const tempDestDir = path.join("..", "build_output", variant);
|
const tempDestDir = path.join("..", "build_output", variant);
|
||||||
const taskPrefix = "standalone." + variant;
|
const taskPrefix = "standalone." + variant;
|
||||||
const electronBaseDir = path.join("..", variantData.electronBaseDir || "electron");
|
const electronBaseDir = path.join("..", "electron");
|
||||||
const tempDestBuildDir = path.join(tempDestDir, "built");
|
const tempDestBuildDir = path.join(tempDestDir, "built");
|
||||||
|
|
||||||
gulp.task(taskPrefix + ".prepare.cleanup", () => {
|
gulp.task(taskPrefix + ".prepare.cleanup", () => {
|
||||||
@ -40,16 +40,6 @@ export default function gulptasksStandalone(gulp) {
|
|||||||
return gulp.src(requiredFiles, { base: electronBaseDir }).pipe(gulp.dest(tempDestBuildDir));
|
return gulp.src(requiredFiles, { base: electronBaseDir }).pipe(gulp.dest(tempDestBuildDir));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task(taskPrefix + ".prepare.writeAppId", cb => {
|
|
||||||
if (variantData.steamAppId) {
|
|
||||||
fs.writeFileSync(
|
|
||||||
path.join(tempDestBuildDir, "steam_appid.txt"),
|
|
||||||
String(variantData.steamAppId)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task(taskPrefix + ".prepare.writePackageJson", cb => {
|
gulp.task(taskPrefix + ".prepare.writePackageJson", cb => {
|
||||||
const packageJsonString = JSON.stringify(
|
const packageJsonString = JSON.stringify(
|
||||||
{
|
{
|
||||||
@ -94,8 +84,7 @@ export default function gulptasksStandalone(gulp) {
|
|||||||
taskPrefix + ".prepare.copyPrefab",
|
taskPrefix + ".prepare.copyPrefab",
|
||||||
taskPrefix + ".prepare.writePackageJson",
|
taskPrefix + ".prepare.writePackageJson",
|
||||||
taskPrefix + ".prepare.minifyCode",
|
taskPrefix + ".prepare.minifyCode",
|
||||||
taskPrefix + ".prepare.copyGamefiles",
|
taskPrefix + ".prepare.copyGamefiles"
|
||||||
taskPrefix + ".prepare.writeAppId"
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -155,41 +144,18 @@ export default function gulptasksStandalone(gulp) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (variantData.steamAppId) {
|
fs.writeFileSync(
|
||||||
|
path.join(appPath, "LICENSE"),
|
||||||
|
fs.readFileSync(path.join("..", "LICENSE"))
|
||||||
|
);
|
||||||
|
|
||||||
|
if (platform === "linux") {
|
||||||
|
// Write launcher script
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
path.join(appPath, "LICENSE"),
|
path.join(appPath, "play.sh"),
|
||||||
fs.readFileSync(path.join("..", "LICENSE"))
|
'#!/usr/bin/env bash\n./shapezio --no-sandbox "$@"\n'
|
||||||
);
|
);
|
||||||
|
fs.chmodSync(path.join(appPath, "play.sh"), 0o775);
|
||||||
fs.writeFileSync(
|
|
||||||
path.join(appPath, "steam_appid.txt"),
|
|
||||||
String(variantData.steamAppId)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (platform === "linux") {
|
|
||||||
// Write launcher script
|
|
||||||
fs.writeFileSync(
|
|
||||||
path.join(appPath, "play.sh"),
|
|
||||||
'#!/usr/bin/env bash\n./shapezio --no-sandbox "$@"\n'
|
|
||||||
);
|
|
||||||
fs.chmodSync(path.join(appPath, "play.sh"), 0o775);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (platform === "darwin") {
|
|
||||||
if (!isRelease) {
|
|
||||||
// Needs special location
|
|
||||||
fs.writeFileSync(
|
|
||||||
path.join(
|
|
||||||
appPath,
|
|
||||||
"shapez.app",
|
|
||||||
"Contents",
|
|
||||||
"MacOS",
|
|
||||||
"steam_appid.txt"
|
|
||||||
),
|
|
||||||
String(variantData.steamAppId)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -203,7 +169,7 @@ export default function gulptasksStandalone(gulp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Manual signing with patched @electron/osx-sign (we need --no-strict)
|
// Manual signing with patched @electron/osx-sign (we need --no-strict)
|
||||||
gulp.task(taskPrefix + ".package.darwin64", cb =>
|
gulp.task(taskPrefix + ".package.darwin", cb =>
|
||||||
packageStandalone(
|
packageStandalone(
|
||||||
"darwin",
|
"darwin",
|
||||||
"x64",
|
"x64",
|
||||||
@ -212,26 +178,6 @@ export default function gulptasksStandalone(gulp) {
|
|||||||
const appFileInner = path.join(appFile, "shapez.app");
|
const appFileInner = path.join(appFile, "shapez.app");
|
||||||
console.warn("++ Signing ++");
|
console.warn("++ Signing ++");
|
||||||
|
|
||||||
if (variantData.steamAppId) {
|
|
||||||
const appIdDest = path.join(
|
|
||||||
path.join(appFileInner, "Contents", "MacOS"),
|
|
||||||
"steam_appid.txt"
|
|
||||||
);
|
|
||||||
// console.warn("++ Preparing ++");
|
|
||||||
// fse.copySync(path.join(tempDestBuildDir, "steam_appid.txt"), appIdDest);
|
|
||||||
|
|
||||||
console.warn("Signing steam_appid.txt");
|
|
||||||
|
|
||||||
execSync(
|
|
||||||
`codesign --force --verbose --options runtime --timestamp --no-strict --sign "${
|
|
||||||
process.env.SHAPEZ_CLI_APPLE_CERT_NAME
|
|
||||||
}" --entitlements "${path.join("entitlements.plist")}" ${appIdDest}`,
|
|
||||||
{
|
|
||||||
cwd: appFile,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
console.warn("Base dir:", appFile);
|
console.warn("Base dir:", appFile);
|
||||||
|
|
||||||
signAsync({
|
signAsync({
|
||||||
@ -275,58 +221,7 @@ export default function gulptasksStandalone(gulp) {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
gulp.task(taskPrefix + ".package.win64", cb => packageStandalone("win32", "x64", cb));
|
gulp.task(taskPrefix + ".package.win32", cb => packageStandalone("win32", "x64", cb));
|
||||||
gulp.task(taskPrefix + ".package.linux64", cb => packageStandalone("linux", "x64", cb));
|
gulp.task(taskPrefix + ".package.linux", cb => packageStandalone("linux", "x64", cb));
|
||||||
gulp.task(
|
|
||||||
taskPrefix + ".build-from-windows",
|
|
||||||
gulp.series(
|
|
||||||
taskPrefix + ".prepare",
|
|
||||||
gulp.parallel(taskPrefix + ".package.win64", taskPrefix + ".package.linux64")
|
|
||||||
)
|
|
||||||
);
|
|
||||||
gulp.task(
|
|
||||||
taskPrefix + ".build-from-darwin",
|
|
||||||
gulp.series(taskPrefix + ".prepare", gulp.parallel(taskPrefix + ".package.darwin64"))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Steam helpers
|
|
||||||
gulp.task("standalone.prepareVDF", cb => {
|
|
||||||
const hash = getRevision();
|
|
||||||
const version = getVersion();
|
|
||||||
|
|
||||||
// for (const platform of ["steampipe", "steampipe-darwin"]) {
|
|
||||||
const templatesSource = path.join("steampipe", "templates");
|
|
||||||
const templatesDest = path.join("steampipe", "built_vdfs");
|
|
||||||
|
|
||||||
const variables = {
|
|
||||||
PROJECT_DIR: path.resolve(path.join("..")).replace(/\\/g, "/"),
|
|
||||||
BUNDLE_DIR: path.resolve(path.join("..", "build_output")).replace(/\\/g, "/"),
|
|
||||||
|
|
||||||
TMP_DIR: path.resolve(path.join("steampipe", "tmp")).replace(/\\/g, "/"),
|
|
||||||
// BUILD_DESC: "v" + version + " @ " + hash,
|
|
||||||
VDF_DIR: path.resolve(path.join("steampipe", "built_vdfs")).replace(/\\/g, "/"),
|
|
||||||
};
|
|
||||||
|
|
||||||
const files = fs.readdirSync(templatesSource);
|
|
||||||
for (const file of files) {
|
|
||||||
if (!file.endsWith(".vdf")) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
variables.BUILD_DESC = file.replace(".vdf", "") + " - v" + version + " @ " + hash;
|
|
||||||
|
|
||||||
let content = fs.readFileSync(path.join(templatesSource, file)).toString("utf-8");
|
|
||||||
content = content.replace(/\$([^$]+)\$/gi, (_, variable) => {
|
|
||||||
if (!variables[variable]) {
|
|
||||||
throw new Error("Unknown variable " + variable + " in " + file);
|
|
||||||
}
|
|
||||||
|
|
||||||
return variables[variable];
|
|
||||||
});
|
|
||||||
|
|
||||||
fs.writeFileSync(path.join(templatesDest, file), content, { encoding: "utf8" });
|
|
||||||
}
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
1
gulp/steampipe/.gitignore
vendored
1
gulp/steampipe/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
steamtemp
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
"appbuild"
|
|
||||||
{
|
|
||||||
"appid" "1318690"
|
|
||||||
"desc" "$BUILD_DESC$"
|
|
||||||
"buildoutput" "$TMP_DIR$"
|
|
||||||
"contentroot" ""
|
|
||||||
"setlive" ""
|
|
||||||
"preview" "0"
|
|
||||||
"local" ""
|
|
||||||
"depots"
|
|
||||||
{
|
|
||||||
"1318693" "$VDF_DIR$/standalone-darwin.vdf"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
"appbuild"
|
|
||||||
{
|
|
||||||
"appid" "1318690"
|
|
||||||
"desc" "$BUILD_DESC$"
|
|
||||||
"buildoutput" "$TMP_DIR$"
|
|
||||||
"contentroot" ""
|
|
||||||
"setlive" ""
|
|
||||||
"preview" "0"
|
|
||||||
"local" ""
|
|
||||||
"depots"
|
|
||||||
{
|
|
||||||
"1318691" "$VDF_DIR$\standalone-windows.vdf"
|
|
||||||
"1318692" "$VDF_DIR$\standalone-linux.vdf"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
"DepotBuildConfig"
|
|
||||||
{
|
|
||||||
"DepotID" "1318693"
|
|
||||||
"contentroot" "$BUNDLE_DIR$\standalone-steam\shapez-darwin-x64"
|
|
||||||
"FileMapping"
|
|
||||||
{
|
|
||||||
"LocalPath" "*"
|
|
||||||
"DepotPath" "."
|
|
||||||
"recursive" "1"
|
|
||||||
}
|
|
||||||
"FileExclusion" "*.pdb"
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
"DepotBuildConfig"
|
|
||||||
{
|
|
||||||
"DepotID" "1318692"
|
|
||||||
"contentroot" "$BUNDLE_DIR$\standalone-steam\shapez-linux-x64"
|
|
||||||
"FileMapping"
|
|
||||||
{
|
|
||||||
"LocalPath" "*"
|
|
||||||
"DepotPath" "."
|
|
||||||
"recursive" "1"
|
|
||||||
}
|
|
||||||
"FileExclusion" "*.pdb"
|
|
||||||
}
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
"DepotBuildConfig"
|
|
||||||
{
|
|
||||||
"DepotID" "1318691"
|
|
||||||
"contentroot" "$BUNDLE_DIR$\standalone-steam\shapez-win32-x64"
|
|
||||||
"FileMapping"
|
|
||||||
{
|
|
||||||
"LocalPath" "*"
|
|
||||||
"DepotPath" "."
|
|
||||||
"recursive" "1"
|
|
||||||
}
|
|
||||||
"FileExclusion" "*.pdb"
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
yarn gulp standalone.prepareVDF
|
|
||||||
steamcmd.sh +login $STEAM_UPLOAD_SHAPEZ_ID $STEAM_UPLOAD_SHAPEZ_USER +run_app_build $PWD/built_vdfs/app-darwin-demo.vdf +quit
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
yarn gulp standalone.prepareVDF
|
|
||||||
steamcmd.sh +login $STEAM_UPLOAD_SHAPEZ_ID $STEAM_UPLOAD_SHAPEZ_USER +run_app_build $PWD/built_vdfs/app-darwin.vdf +quit
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
@echo off
|
|
||||||
cmd /c yarn gulp standalone.prepareVDF
|
|
||||||
steamcmd +login %STEAM_UPLOAD_SHAPEZ_ID% %STEAM_UPLOAD_SHAPEZ_USER% +run_app_build %cd%/built_vdfs/app-winlinux-demo.vdf +quit
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
@echo off
|
|
||||||
cmd /c yarn gulp standalone.prepareVDF
|
|
||||||
steamcmd +login %STEAM_UPLOAD_SHAPEZ_ID% %STEAM_UPLOAD_SHAPEZ_USER% +run_app_build %cd%/built_vdfs/app-winlinux.vdf +quit
|
|
||||||
@ -18,43 +18,4 @@ export default function gulptasksTranslations(gulp) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task("translations.fullBuild", gulp.series("translations.convertToJson"));
|
gulp.task("translations.fullBuild", gulp.series("translations.convertToJson"));
|
||||||
|
|
||||||
gulp.task("translations.prepareSteamPage", cb => {
|
|
||||||
const files = fs.readdirSync(translationsSourceDir);
|
|
||||||
|
|
||||||
files
|
|
||||||
.filter(name => name.endsWith(".yaml"))
|
|
||||||
.forEach(fname => {
|
|
||||||
console.log("Loading", fname);
|
|
||||||
const languageName = fname.replace(".yaml", "");
|
|
||||||
const abspath = path.join(translationsSourceDir, fname);
|
|
||||||
|
|
||||||
const destpath = path.join(translationsSourceDir, "tmp", languageName + "-store.txt");
|
|
||||||
|
|
||||||
const contents = fs.readFileSync(abspath, { encoding: "utf-8" });
|
|
||||||
const data = YAML.parse(contents);
|
|
||||||
|
|
||||||
const storePage = data.steamPage;
|
|
||||||
|
|
||||||
const content = `
|
|
||||||
[img]{STEAM_APP_IMAGE}/extras/store_page_gif.gif[/img]
|
|
||||||
|
|
||||||
${storePage.intro.replace(/\n/gi, "\n\n")}
|
|
||||||
|
|
||||||
[h2]${storePage.what_others_say}[/h2]
|
|
||||||
|
|
||||||
[list]
|
|
||||||
[*] [i]${storePage.nothernlion_comment}[/i] [b]- Northernlion, YouTube[/b]
|
|
||||||
[*] [i]${storePage.notch_comment}[/i] [b]- Notch[/b]
|
|
||||||
[*] [i]${storePage.steam_review_comment}[/i] [b]- Steam User[/b]
|
|
||||||
[/list]
|
|
||||||
`;
|
|
||||||
|
|
||||||
fs.writeFileSync(destpath, content.replace(/(\n[ \t\r]*)/gi, "\n").trim(), {
|
|
||||||
encoding: "utf-8",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,9 +3,7 @@ import TerserPlugin from "terser-webpack-plugin";
|
|||||||
import webpack from "webpack";
|
import webpack from "webpack";
|
||||||
const { DefinePlugin, IgnorePlugin } = webpack;
|
const { DefinePlugin, IgnorePlugin } = webpack;
|
||||||
import DeadCodePlugin from "webpack-deadcode-plugin";
|
import DeadCodePlugin from "webpack-deadcode-plugin";
|
||||||
import pj from "../package.json" assert { type: "json" };
|
import { getAllResourceImages, getRevision, getVersion } from "./buildutils.js";
|
||||||
const { version } = pj;
|
|
||||||
import { getAllResourceImages, getRevision } from "./buildutils.js";
|
|
||||||
|
|
||||||
const globalDefs = {
|
const globalDefs = {
|
||||||
"assert": "false && window.assert",
|
"assert": "false && window.assert",
|
||||||
@ -16,7 +14,7 @@ const globalDefs = {
|
|||||||
"G_APP_ENVIRONMENT": JSON.stringify("release"),
|
"G_APP_ENVIRONMENT": JSON.stringify("release"),
|
||||||
"G_BUILD_TIME": new Date().getTime().toString(),
|
"G_BUILD_TIME": new Date().getTime().toString(),
|
||||||
"G_BUILD_COMMIT_HASH": JSON.stringify(getRevision()),
|
"G_BUILD_COMMIT_HASH": JSON.stringify(getRevision()),
|
||||||
"G_BUILD_VERSION": JSON.stringify(version),
|
"G_BUILD_VERSION": JSON.stringify(getVersion()),
|
||||||
"G_ALL_UI_IMAGES": JSON.stringify(getAllResourceImages()),
|
"G_ALL_UI_IMAGES": JSON.stringify(getAllResourceImages()),
|
||||||
|
|
||||||
"G_IS_RELEASE": "true",
|
"G_IS_RELEASE": "true",
|
||||||
|
|||||||
@ -11,7 +11,9 @@
|
|||||||
"gulp": "gulp --cwd gulp",
|
"gulp": "gulp --cwd gulp",
|
||||||
"lint": "eslint src/js",
|
"lint": "eslint src/js",
|
||||||
"prettier-all": "prettier --write src/**/*.* && prettier --write gulp/**/*.*",
|
"prettier-all": "prettier --write src/**/*.* && prettier --write gulp/**/*.*",
|
||||||
"buildTypes": "tsc src/js/application.js --declaration --allowJs --emitDeclarationOnly --skipLibCheck --out types.js"
|
"buildTypes": "tsc src/js/application.js --declaration --allowJs --emitDeclarationOnly --skipLibCheck --out types.js",
|
||||||
|
"package-win32": "gulp package.standalone-steam.win32",
|
||||||
|
"package-linux": "gulp package.standalone-steam.linux"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ajv": "^6.10.2",
|
"ajv": "^6.10.2",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user