-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add script to compile bridge controller (#470)
* add script to compile bridge controller * make script executable, handle case-sensitive file names, quote folders containing spaces --------- Co-authored-by: memo <memo33@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
120 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# | ||
# Syntax: | ||
# | ||
# Lines starting with # are interpreted as comments. | ||
# | ||
# 'File' denotes the name of the target file. The path is interpreted | ||
# relative to the location of the RULConfig.txt file. | ||
# | ||
# 'TGI' and 'Compressed' are self-explanatory. | ||
# | ||
# 'Source' specifies the source that is used to build a RUL file. | ||
# If multiple source files are specified, these will be concatenated | ||
# preserving their order. Note that the source files must explicitly | ||
# end with a newline in this case, unless the next file starts with | ||
# a comment anyway. Paths are interpreted relative to the source | ||
# directory passed to the BuildRULs utility. | ||
# | ||
# -memo | ||
# | ||
############################################################# | ||
|
||
File: NetworkAddonMod_Bridge_Controller.dat | ||
|
||
# Road | ||
TGI: 0x0A5BCF4B 0xAA5BCF57 0x00001000 | ||
Compressed: 1 | ||
Source: 00001000.rul | ||
|
||
# Rail | ||
TGI: 0x0A5BCF4B 0xAA5BCF57 0x00001001 | ||
Compressed: 1 | ||
Source: 00001001.rul | ||
|
||
# Street | ||
TGI: 0x0A5BCF4B 0xAA5BCF57 0x00001003 | ||
Compressed: 1 | ||
Source: 00001003.rul | ||
|
||
# Avenue | ||
TGI: 0x0A5BCF4B 0xAA5BCF57 0x00001006 | ||
Compressed: 1 | ||
Source: 00001006.rul | ||
|
||
# Light Rail | ||
TGI: 0x0A5BCF4B 0xAA5BCF57 0x00001008 | ||
Compressed: 1 | ||
Source: 00001008.rul | ||
|
||
# Monorail | ||
TGI: 0x0A5BCF4B 0xAA5BCF57 0x00001009 | ||
Compressed: 1 | ||
Source: 00001009.rul | ||
|
||
# One Way Road | ||
TGI: 0x0A5BCF4B 0xAA5BCF57 0x0000100A | ||
Compressed: 1 | ||
Source: 0000100a.rul | ||
|
||
# Dirt Road | ||
TGI: 0x0A5BCF4B 0xAA5BCF57 0x0000100B | ||
Compressed: 1 | ||
Source: 0000100b.rul | ||
|
||
# Ground Highway | ||
TGI: 0x0A5BCF4B 0xAA5BCF57 0x0000100C | ||
Compressed: 1 | ||
Source: 0000100c.rul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
# | ||
# This script compiles all bridge rul files for inclusion in the installer. | ||
# | ||
# ./src/scripts/compile-release-bridge-controller.sh | ||
# | ||
# The compiled bridge controller is 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 | ||
unzip -d "$TEMP" "$BUILDRULS_ARCHIVE" | ||
|
||
# build bridge controller | ||
(cd "$TEMP/BuildRULs_01" && java -jar BuildRULs.jar -f "$PROJECT_ROOT/Controller/Bridge Controller/" "$PROJECT_ROOT/Controller/Bridge Controller/") | ||
|
||
# copy to target | ||
DESTDIR="target/controllers/" | ||
mkdir -p "$DESTDIR" | ||
cp -p "$PROJECT_ROOT/Controller/Bridge Controller/NetworkAddonMod_Bridge_Controller.dat" "$DESTDIR" | ||
|
||
rm -rf "$TEMP" |