Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions interface/compile_interface.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

ESNACC="esnacc-compiler/output/bin/esnacc"
ASN1DIR="asn1"

if [ ! -f "$ESNACC" ]; then
pushd esnacc-compiler
source ./build.sh
if [ $? -ne 0 ]; then
echo "Failed to build esnacc compiler"
exit 1
fi
popd
fi

echo "Building browser client stubs..."
OUTDIR="../browser-client/src/stub"
if [ -d "$OUTDIR" ]; then
rm -rf "$OUTDIR"
fi
mkdir -p "$OUTDIR"
echo "$ESNACC -JT -j -RTS_CLIENT_BROWSER -comments -ValidationLevel 0 -o $OUTDIR $ASN1DIR/*.asn1"
$ESNACC -JT -j -RTS_CLIENT_BROWSER -comments -ValidationLevel 0 -o "$OUTDIR" "$ASN1DIR"/*.asn1

if [ $? -ne 0 ]; then
echo "Build has failed, check console..." >&2
exit 1
fi

echo "Building node client stubs..."
OUTDIR="../node-client/src/stub"
if [ -d "$OUTDIR" ]; then
rm -rf "$OUTDIR"
fi
mkdir -p "$OUTDIR"
echo "$ESNACC -JT -j -RTS_CLIENT_NODE -comments -ValidationLevel 0 -o $OUTDIR $ASN1DIR/*.asn1"
$ESNACC -JT -j -RTS_CLIENT_NODE -comments -ValidationLevel 0 -o "$OUTDIR" "$ASN1DIR"/*.asn1

if [ $? -ne 0 ]; then
echo "Build has failed, check console..." >&2
exit 1
fi

echo "Building openapi files..."
OUTDIR="../openAPI/example/"
rm -f "$OUTDIR"*.json
echo "$ESNACC -JO -j -comments -ValidationLevel 0 -o $OUTDIR $ASN1DIR/*.asn1"
$ESNACC -JO -j -comments -ValidationLevel 0 -o "$OUTDIR" "$ASN1DIR"/*.asn1

if [ $? -ne 0 ]; then
echo "Build has failed, check console..." >&2
exit 1
fi