forked from aeron-io/simple-binary-encoding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsbe-tool
More file actions
executable file
·42 lines (35 loc) · 794 Bytes
/
Copy pathsbe-tool
File metadata and controls
executable file
·42 lines (35 loc) · 794 Bytes
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
#! /usr/bin/env bash
ROOTDIR=`dirname $0`/..
SBE_TOOL_VERSION=`cat $ROOTDIR/version.txt`
SBE_JAR=$ROOTDIR/sbe-all/build/libs/sbe-all-$SBE_TOOL_VERSION.jar
[ -f $SBE_JAR ] || (echo "Missing $SBE_JAR. Run gradle first"; exit 1)
function usage {
echo usage: `basename $0` [-d output_dir] -s schema
}
# defaults
OUTPUTDIR=.
while getopts "d:s:" OPT "$@"; do
case $OPT in
d)
OUTPUTDIR=$OPTARG
;;
s)
SCHEMA=$OPTARG
;;
*)
echo $OPT
usage
exit 1
;;
esac
done
shift $(($OPTIND - 1))
# Check args
[ -z $SCHEMA ] && (usage; exit 1)
[ -f $SCHEMA ] || (echo invalid schema $SCHEMA; exit 1)
java \
-Dsbe.output.dir=$OUTPUTDIR \
-Dsbe.generate.ir="false" \
-Dsbe.target.language="golang" \
-jar $SBE_JAR \
$SCHEMA