Initial commit
[com/gs-lite.git] / bin / buildit_with-stats
diff --git a/bin/buildit_with-stats b/bin/buildit_with-stats
new file mode 100755 (executable)
index 0000000..cbf2bee
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# ------------------------------------------------
+#   Copyright 2014 AT&T Intellectual Property
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+# -------------------------------------------
+
+# GSLITE_ROOT environment variable need to be set
+
+if [ -z "$GSLITE_ROOT" ]
+then
+    echo "GSLITE_ROOT must be set to non-empty string"
+    exit -1
+fi
+
+$GSLITE_ROOT/bin/translate_fta -h localhost -c -M -S -R $GSLITE_ROOT -C  $GSLITE_ROOT/cfg -l $GSLITE_ROOT/qlib packet_schema.txt *.gsql
+ret=$?
+if [ $ret -ne 0 ]
+then
+    echo "Query translation failed!"
+    exit $ret
+fi
+    
+make
+ret=$?
+if [ $ret -ne 0 ]
+then
+    echo "Query build failed!"
+    exit $ret
+fi    
+exit $ret