BlueGit

timfa raytracer

Files

raytracer / src / build.sh

build.sh

build.sh 901 B Download Raw
1#!/usr/bin/env bash
2set -euo pipefail
3ROOT="$(cd "$(dirname "$0")/.." && pwd)"
4BUILD_FILE="$ROOT/build/game.js"
5SRC_DIR="$ROOT/src"
6
7printf "Build started, output file: %s\n" "$BUILD_FILE"
8rm -f "$BUILD_FILE"
9
10FILES=(
11 "$SRC_DIR/textureColumn.js"
12 "$SRC_DIR/ppda/depthDecode.js"
13 "$SRC_DIR/ppda/viewFrame.js"
14 "$SRC_DIR/ppda/compositor.js"
15 "$SRC_DIR/ppda/loadPpda.js"
16 "$SRC_DIR/ppda/atlasRuntime.js"
17 "$SRC_DIR/levels.js"
18 "$SRC_DIR/tiles.js"
19 "$SRC_DIR/world.js"
20 "$SRC_DIR/player.js"
21 "$SRC_DIR/npc.js"
22 "$SRC_DIR/raycastScene.js"
23 "$SRC_DIR/main.js"
24)
25
26for file in "${FILES[@]}"
27do
28 if [[ ! -f "$file" ]]
29 then
30 printf "Missing source file: %s\n" "$file" >&2
31 exit 1
32 fi
33 printf "\n/*\n * Start File:\n * %s\n */ \n" "$file" >> "$BUILD_FILE"
34 printf "Building %s\n" "$file"
35 cat "$file" >> "$BUILD_FILE"
36 printf "\n/*\n * End File:\n * %s\n */ \n" "$file" >> "$BUILD_FILE"
37done
38printf "DONE\n"