-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathcompile-release-inruls.sh
More file actions
executable file
·61 lines (48 loc) · 1.98 KB
/
compile-release-inruls.sh
File metadata and controls
executable file
·61 lines (48 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
#
# This script compiles all INRUL files for inclusion in the installer.
#
# ./src/scripts/compile-release-inruls.sh
#
# The compiled INRUL files are located at `./target/controllers/`.
set -e
if [ ! -e "Controller" ]
then
echo "Call this script from the root directory of the Network-Addon-Mod repository."
exit 1
fi
PROJECT_ROOT="$(pwd)"
TEMP="target/controllers/temp"
mkdir -p "$TEMP"
BUILDRULS_ARCHIVE="target/BuildRULs_01.zip"
BUILDRULS_URL="https://www.dropbox.com/s/ckwhy11xxaz3z1q/BuildRULs_01.zip?dl=1"
if [ ! -e "$BUILDRULS_ARCHIVE" ]
then
# download compiler if it does not yet exist
curl -L "$BUILDRULS_URL" > "$BUILDRULS_ARCHIVE"
fi
echo "08816a61cb64c80392328f874c3b5bc031580514c156839af9a8359784a72071 $BUILDRULS_ARCHIVE" | sha256sum --check
unzip -d "$TEMP" "$BUILDRULS_ARCHIVE"
# build all INRULs
(cd "$TEMP/BuildRULs_01" && java -jar BuildRULs.jar -f "$PROJECT_ROOT/Controller/INRULs/" "$PROJECT_ROOT/Controller/INRULs/")
# RHD 4GB Full
DESTDIR="target/controllers/@0=0 NAM Controller_RHD_4GB_Full/"
mkdir -p "$DESTDIR"
cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_IndividualNetworkRULs_RHD.dat" "$DESTDIR"
# LHD 4GB Full
DESTDIR="target/controllers/@1-0 NAM Controller_LHD_4GB_Full/"
mkdir -p "$DESTDIR"
cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_IndividualNetworkRULs_LHD.dat" "$DESTDIR"
# RHD no-RHW
DESTDIR="target/controllers/@2-0 NAM Controller_RHD_LowRAM_NoRHW/"
mkdir -p "$DESTDIR"
cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_IndividualNetworkRULs_RHD.dat" "$DESTDIR"
# LHD no-RHW
DESTDIR="target/controllers/@3-0 NAM Controller_LHD_LowRAM_NoRHW/"
mkdir -p "$DESTDIR"
cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_IndividualNetworkRULs_LHD.dat" "$DESTDIR"
# Avenue turning lanes
cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_TurningLanes_Avenues_Plugin_INRULs.dat" "target/controllers/"
# advisor messages
cp -p "$PROJECT_ROOT/Controller/INRULs/NetworkAddonMod_Advice.dat" "target/controllers/"
rm -rf "$TEMP"